A Command Line Interpreter for Spoofax

Updated with screenshot! Also take a look at the Eclipse Shell.

Good news, boys and girls! If you happen to be a Stratego and/or Spoofax user, you might appreciate that I finally took some time to piece together an interactive command line interpreter—-a REPL—-for Spoofax.

A small chat session with the Spoofax interpreter

There are numerous other things you can do in the shell. The help “page” gives a short summary.

1/ok> :help
 :help                       -- print this page
 :forget var1 var2 ... varN  -- forget specific global variables
 :forget strat/(n,m)         -- forget strategy with arity (n, m), e.g :forget zip/(1,0)
 :forget _                   -- forget all global variables
 :arity strategy             -- show available arities for a strategy
 :strategies                 -- show all global strategies
 :vars                       -- show all global variables

Now that I’m a full time Spoofax-user, low hanging productivity fruits suddenly seem a lot more ripe for the picking. I’ve personally been using Stratego Shell for a long time for my interactive needs, but it was getting increasingly out of date. Enter the Spoofax Interpreter, which runs on the JVM.

With a good portion of help from Rob and Eelco, I set up a build job for this thing in the hydra build farm, so that the latest builds will always be available.

There are bound to be a bunch of stuff that doesn’t work. When you find issues, please report them in YellowGrass and tag me (@karltk). I’m especially interested in how well this works on the more obscure developer platforms, such as Windows and OSX.

A sample contribution could be a cmd script that makes this thing easily start on Windows. Hint, hint.