I should look closer into compilers (and into roto, in particular). They are fascinating,and I did not have many opportunities to play with them.
#hylang might be the closest I've got, and that was a while ago, and I'd like to dig deeper.
I should look closer into compilers (and into roto, in particular). They are fascinating,and I did not have many opportunities to play with them.
#hylang might be the closest I've got, and that was a while ago, and I'd like to dig deeper.
Way back when I was trying to find The Language to use in iocaine, I looked at pretty much every language embeddable into Rust I could find on crates.io.
I tried Rhai, Rune, Lua (via mlua
), Dyon, Roto, Steel, wasmtime, and a bunch more.
Of these, Roto and wasmtime were the most performant by far. Surprisingly, a trivial wasmtime script (equivalent of return false
) clocked in as slower than the same script in Roto, though, within margin of error.
Lua is about an order of magnitude slower than that.
And everything else is even slower than Lua, or they don't even support the kind of thing I'm doing in iocaine to begin with.
In iocaine, every request is served by a script, and there can be any number of them in flight at the same time. I do not control the threads, and I do not want to. Anything thread bound is a no-go.
Any scripting language I'd even consider embedding needs to separate runtime from environment/context/whatever it ends up calling that thing, and must be able to run any number of scripts concurrently, in isolation.
I pretty much need the engine to be Send
+ Sync
, really.
Interpreters are out aswell, they're never going to match the speed of a compiled language (Roto & wasmtime are compiled to machine code via cranelift
).
There are fast-ish languages, like Lua, but my experiments indicate that for iocaine's use-case, neither LuaJIT nor LuaU provide any gains (they usually measured below Lua 5.4!) - my scripts are short, and don't live long, JIT doesn't help much there, as far as I can tell.
I'm willing to add new languages to iocaine, if they match or exceed the speed of Lua, but that's already stretching it. The only reason I have Lua support in iocaine is because of #Fennel. I desperately wanted a lisp. Even if I won't be using it myself, I wanted iocaine to support one. Lua, and thus Fennel, are considerably slower than Roto, but they run at an acceptable speed nevertheless.
Most languages I tried were waaay slower than Lua.
But the goal here is not adding a new language that competes with Lua. Ideally, I'd want one that competes with Roto and wasmtime. I want a language that I can use in Nam-Shub of Enki, without sacrificing performance.
I'd like this language to be Lisp-y (and in that family, closer to Clojure than to Scheme).
...and this is why I'd love to have the time and opportunity to dig deeper into compilers, so I could figure out if I could build such a language. Because I have a perhaps unhealthy obsession with parentheses.
A space for Bonfire maintainers and contributors to communicate