Welcome to Lunar Logo, an experimental scripting language based on Logo and Lua, with a tiny core and clean, minimal syntax. Example usage:
$ ./lunar sqrt add mul 3 3 mul 4 4 5.0
That's right, you can type Lunar Logo code at a Bash prompt without escaping it (within reason). For a bigger sample, put this code in a file, say
print [Welcome to Lunar Logo. Enter your commands, or BYE to quit.] while [true] do type > type space make cmd readlist if eq nil :cmd do break end if eq 0 count :cmd do continue end if eq bye lowercase first :cmd do break end foreach i results parse :cmd do if neq :i nil do show :i end end end
Now you can load it as follows:
$ ./lunar load repl.lulz
Indeed, Lunar Logo doesn't need a built-in interactive mode because you can code one yourself in just a few lines!
Lunar Logo isn't really meant to be used by itself (see below). But you can get a native interpreter for your operating system to try it out:
All builds are 32-bit, but have no dependencies; they should run fine on 64-bit systems.
You can learn more about Lunar Logo from the tutorial and frequently asked questions; people familiar with older Logo dialects might want to beware of differences.
Lunar Logo is mainly intended for programmers who need a scripting language for their application but don't want to bother with external libraries. You can find the source code on GitHub: each implementation is just one file to be copied over.
That said, possible stand-alone uses are as a fancy calculator (much more powerful than
expr), or for writing Awk-style filters: Lunar Logo should handle TSV files very well indeed.
This is the second time I do a Logo dialect. The first time around I kept much closer to the original language, but the result was a messy implementation that left much of the heavy lifting to individual procedures, and still didn't have much in the way of speed or capabilities.
As of 31 January 2017, Lunar Logo has two implementations that can run all the examples correctly. The language supports over 100 procedures. See the tutorial for an overview.
The software is considered beta quality. More real-world testing is needed, and the feature set may still change. Anything mentioned in the tutorial and examples should stay put from now on, though.
Error reporting needs some way to provide better context.