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 repl.lulz
:
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 is abandoned as of 15 March 2022. Source code (in Python and Go) is preserved because why not. You can have it under the MIT License.
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.
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.
To do: Error reporting needs some way to provide better context.