BooTer Reduced

Edit: Apparently the way to prove a new esoteric language is turing-complete is to implement a [BF][] interpreter. This technique has been used to show that [LOLCODE is turing complete][lolcode-bf], so I suppose I could target that as the first non-trivial program to write as soon as I get a working BooTer interpreter :D Or, I suppose I could implement a LOLCODE interpreter in BooTer in which I could run a BF interpreter...

Thinking about BooTer, I decide that I wasn’t making it esoteric enough..so I’ve slimmed down my specification for simpler implementation, and much more difficulty doing anything useful with it :)

The only thing allowed is simple expressions and boolean ternary expressions. No comma-separated lists of expressions, no assigning expressions to variables, no symbols, no quoting of expressions.

Maybe in the future I’ll re-expand it out into a more “real” language, but for now I just want to do something that I can do simply and easily without accidentally building an entire broken LISP.

So, with all that stuff gone..what’s left? What’s different now?

The previous example programs are both a bit more complex than they were previously (but hey, the parser and interpreter will be much easier to implement!):

Infinite NOOP loop: ( ^ : : )

100 bottles of beer:

(n = 101 :
  (
    (n = n-1 :
      print [n, “bottles of beer on the wall!\n”] :
    ) :
    ^ :
  ) :
)

In the beer example, assume that print prints the items passed into its array to the stdout and then evaluates to the same string it printed out.

Here’s a BooTer “for loop” with more of an explanation of what’s going on:

(i = -1 :              ; initialize loop variable
  (
    (100 > i = i + 1 : ; increment loop variable, check it against condition
      …              ; do things, must evaluate to true
    :
      …              ; this one must evaluate to false (leaving it empty works)
    )
  :
    ^                  ; re-evaluate this expression, causing the loop
  :
    …                ; whatever can go here, this will be evaluated after the loop is done
  )
: )                    ; done, this last sub-expression will never be run

Even with this new “simplified” syntax, it’s enough to make your head hurt. Now I just need to actually write a reference implementation with some standard library calls, then try to write something non-trivial with it. Who wants to try their hand at writing a BooTer web server?

blog comments powered by Disqus