Btw, a JVM target (generating JVM bytecode directly) was recently merged into the Haxe compiler. Previously there was already a target that generates Java source code, but that had some issues like slowing down compile times with the native Java compilation step that needed to be done.
This is almost always cache miss.
If the collection is polymorphic it's even worse because you dereference to access the dispatch table which then redirects you to the real value.
Furthermore, each variable will need heap allocation and tracking, stressing the garbage collector and the underlying allocator (unless you preallocate big chunks like Java).
> [...] Neko is very slow. The main reason for this is that it's dynamically typed. So every "value" in the VM can be either an Int, a Float, a Bool, some Bytes, an Array, a Function or Object, etc. And because this value needs to be recognized at run-time, its type together with its data need to be stored in the memory. [...]
I found the following three resources helpful in getting a bit of an idea about what Neko really is beyond being a target VM of Haxe.
Neko C FFI - https://nekovm.org/doc/ffi/
A comparison of Neko and Lua - https://nekovm.org/doc/lua/
Language Interoperability - https://nekovm.org/doc/multilang/
See https://haxe.org/documentation/introduction/compiler-targets... for a full list of targets.
Minor criticism: It would be helpful to see some code so you can tell what you're going to have to be generating to use the VM. Especially since it's not bytecode or abstract machine instructions so it's hard to know what to expect.
Otherwise, this is an incredibly cool project, which I'm definitely going to check out more in the future. Out of curiosity, how does its performance and memory usage compare versus the JVM or even LLVM (for the standalone compiler)? It's a super cool idea to have a lightweight standardized VM to program for, but I think generating bytecode or LLVM IR would be easier to design a programming language atop, at least because it'd be less likely to be a leaky abstraction like JS transpilers. So it'd be nice to know if any more technical benefits.
One technical question, (forgive me I don't know what I'm talking about) why have a bytecode at all, since no users of the languages based on Neko VM will touch Neko PL themselves (usually), why can't Neko PL act as a bytecode?