Skip to content
ikotler edited this page May 30, 2012 · 5 revisions

A list of proposed syntaxes, see this discussion thread for more information.

Anyone can edit this wiki page and add a new syntax proposal. A proposal can a new idea, based on another, or mix-up of two or more.

Also, every syntax proposal must include the following programs written in the proposed syntax:

  • Hello World program
  • 99 Bottles of Beer program
  • Multithread Counter (simple loop that print from 1 to 10 in each thread) program

Please do not use the Wiki for questions/comments. Use our Google Groups mailing list instead.

1. Python-like Syntax

1.1. Hello World

"Hello World":
    -> print

1.2. 99 Bottles of Beer

range(99, 0, -1):
    |  str
    -> _ + " bottle(s) of beer on the wall,"
    -> print
    -> _.split(" on")[0] + '.'
    -> print
    -> print("Take one down, pass it around,")

1.3. Multithread 1 to 10 Counter

range(1, 10):
    -> print("In Thread A"):
        -> print
    -> print("In Thread B"):
        -> print

2. C-like Syntax

2.1. Hello World

"Hello, world" -> [
    print
]

2.2. 99 Bottles of Beer

range(99, 0, -1) | [
    str -> 
    _ + " bottle(s) of beer on the wall," ->
    print ->
    _.split(" on")[0] + '.' ->
    print ->
    print("Take one down, pass it around,")
]

2.3. Multithread Counter (1 to 10)

range(1, 10) -> [
    [
        print("In Thread A") -> 
        print
    ] 
    ,
    [
        print("In Thread B") -> 
        print
    ]
]

3. Musical notation / Modern staff notation -like Syntax

3.1. Hello World

"Hello World":
[ # -> 
    print
]

3.2. 99 Bottles of Beer

range(99, 0, -1): 
    [ # ->
        str
        _ + " bottle(s) of beer on the wall,"
        print
        _.split(" on")[0] + '.'
        print
        print("Take one down, pass it around,")
    ]

3.3. Multithread Counter (1 to 10)

range(1, 10)
[ # ->
   [ # ->
      print("In Thread A")
      print
   ]
   ,
   [ # ->
      print("In Thread B")
      print
   ]
]

3.4. Extras

3.4.1 Repeat signs

3.4.1.1 Repeat const times

Repeats "print -> print" block 2 times

"Hello World" -> [: print -> print :] * 2

3.4.1.2 Repeat N times

Repeats "print -> print" block N times

"Hello World" -> [: print -> print :] * N

3.4.1.3 Repeat expression result times

Repeats "print -> print" block fcn_A() result times

"Hello World" -> [: print -> print :] * fcn_A()

3.4.2. Simile marks

3.4.2. Repeat the Previous Block

"Hello World" | print | % 

Equals to:

"Hello World" -> print -> print

3.4.3. Repeat the Two Previous Blocks

"Hello World" | print | print | %%

Equals to:

"Hello World" -> print -> print -> print -> print

3.4.4. Volta brackets

Prints "Hello World" 10 times, and, on the 2nd iteration it will also print "Second iteration"

"Hello World" -> [: print -> 2: print("2nd Iteration") :] * 10

4. F#-like Syntax

4.1. Hello World

"Hello World": -> print

4.2. 99 Bottles of Beer

range(99, 0, -1): |  str
                  -> _ + " bottle(s) of beer on the wall,"
                  -> print
                  -> _.split(" on")[0] + '.'
                  -> print
                  -> print("Take one down, pass it around,")

4.3. Multithread Counter (1 to 10)

range(1, 10): -> print("In Thread A"): -> print
              -> print("In Thread B"): -> print

Clone this wiki locally