Daffodil

From Esolang
Jump to navigation Jump to search

Daffodil is an esoteric programming language by User:BoundedBeans. It is a clone of Subleq. That means every command is 3 memory locations, which ran through the following procedure: Subtract m2 - m1, store result in m2, if m2 <= 0: jump to m3.

Format

Daffodil instead uses binary to write memory locations. A lowercase letter is 0, an uppercase letter is 1. The letters always make up the word daffodil.

Here are the first few numbers in this format:

0. daffodil

1. daffodiL

2. daffodIl

3. daffodIL

4. daffoDil

5. daffoDiL

6. daffoDIl

7. daffoDIL

8. daffOdil

9. daffOdiL

10. daffOdIl

11. daffOdIL

12. daffODil

13. daffODiL

14. daffODIl

15. daffODIL

-1 (which is used for input, output, and halting the program depending on the position in the 3 arguments) can be represented with "Bulb". So this is an example of accepting input: Bulb DafFoDIL DAFfodIl Output: daffoDIl Bulb DAFFODiL Halt the program if <= 0 daffodil DAFfOdil Bulb

You might notice this only allows up to 256 memory addresses. Luckily, there's a solution.

  • Encode all further bits beyond the 128-value bit in base 6, with these digits: (0: d, 1: a, 2: f, 3: o, 4: i, 5: l)
  • Put them in square brackets before a daffodil word, no spaces.

An example to encode memory address 75000: [afdi]DAFFOdil

Examples

Hello world

daffODil daffODil daffodIL
daFfoDil daFfoDiL daffoDIl
daFfoDiL daffODil daffOdiL
daFfoDiL daFfoDiL daffODil
daffodil Bulb daffODIL
daFfoDIl daFfoDil dafFodIl
daffODil daffODil dafFoDiL
daFFoDiL daFfoDiL dafFOdil
daFfoDiL daffODil dafFOdIL
daFfoDiL daFfoDiL dafFODIl
daFfoDil daffODil Bulb
daFfoDiL daFfoDiL daffodil
daFfoDIL daffodil Bulb
dAffOdil dAFfoDiL dAFfODil
dAFfODil dAFfODIL daFfODil
daFfodil dAfFoDIL dAFfODIL
dAFFodIl dAFfODil dAFfoDil
daFfodiL daffOdIl daFFoDiL

Variants

Daffodil also has some variants. Any word can theoretically be used (other than Bulb, since that is reserved), but it is recommended to be other bulb flowers. Here's a second example: Amaryllis. This word has 9 letters, meaning it can hold 512 memory addresses without brackets. However, when using brackets, instead of base 6 with dafoil, it will have base 7 with amrylis.

Here's truncated hello world in Amaryllis:

amaryLLis amaryLLis amaryllIS
amaRylLis amaRylLiS amarylLIs
amaRylLiS amaryLLis amaryLliS
...

Here's a truncated hello world in Tulip

tULip tULip tulIP
[u]tuLip [u]tuLiP tuLIp
[u]tuLiP tULip tUliP
...

You can imagine the shorter a word is, the harder to code in. The bare minimum is just one letter. Like the language A. A only has two memory locations, a and A, not even enough for one command. So in order to have any functioning program, you need to put stuff in square brackets. But in order to do that, you have to encode the number/2 in unary, using only "a". Writing 100 is [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa]a. Writing 5000 requires writing 2500 a's in square brackets, plus one more a. You can imagine programming in A would be annoying.

To distinguish these languages from their counterparts, such as Befunge (which can be either the normal language Befunge, or a Daffodil sibling using the word "Befunge"), language names of this family of languages should be prefixed with #Flora#.

So Tulip should be called #Flora# Tulip, Amaryllis should be called #Flora# Amaryllis, A should be called #Flora# A, and Befunge (the Daffodil alternate, not the 2d one) should be called #Flora# Befunge.

However, since Daffodil is the head of this language family, it does not need to be prefixed.