Scripting with Nashorn

You should look at Lua. I think it meets all of your requirements.

Other than for academic reasons, hand-rolling a scripting language is a bit crazy these days. So many prebuilt options.

Yes, I looked long and hard at Lua. I wound up passing it by for several reasons… (a) I didn’t want to deal with native Lua (the pain of interfacing to native code + potential overhead), (b) the JVM ports of Lua don’t seem to have a lot of activity, and I’m extremely leery of adopting something as central as a scripting engine that may not be well maintained, and © if I remember correctly the arbitrary suspend/resume was still problematic (I may be wrong on that point though; it was quite some time ago that I last looked into Lua). Plus, I’m not all that keen on the Lua syntax, and 1-based array indices don’t appeal to me either. Those alone aren’t a good reason to drop Lua, but combined with all the other reasons I figured I might as well sit down and make a language that I’d be happy with in the long run. The first scripting engine I made runs a high-level assembly-type language (very easy to parse, not so nice for end users), and the second scripting engine is intended to run a very high-level Python-like language. I’m currently investigating using Xtext to develop the compiler for it.

The second scripting engine I’m developing partially because it would add a lot to my main project, and partially as a hobby project on the side. Scripting engines are a pain to develop, but somehow I can’t escape the draw of rolling my own language. :wink: