I'm looking for a VM with the following features:
- Small compiled code footprint (under 200K).
- No external dependencies.
- Unicode (or raw) string support.
- Clean code/well organized.
- C(99) code, NOT C++.
- C/Java-like syntax.
- Operators/bitwise: AND/OR, etc.
- Threading support.
- Generic/portable bytecode. Bytecode should work on different machines even if it was compiled on a different architecture with different endianness etc.
- Barebones, nothing fancy necessary. Only the basic language support.
- Lexer/parser and compiler separate from VM. I will be embedding the VM in a program and then compile the bytecode independently.
So far I have reviewed Lua, Squirrel, Neko, Pawn, Io, AngelScript... and the only one which comes somewhat close to the spec is Lua, but the syntax is horrible, it does not have bitwise support, and the code style generally sucks. Squirrel and IO are huge, mostly. Pawn is problematic, it is small, but bytecode is not cross platform and the implementation has some serious issues (ex bytecode is not validated at all, not even the headers AFAIK).
I would love to find a suitable option out there.
Thanks!
Update: Javascript interpreters are... interpreters. This is a VM question for a bytecode-based VM, hence the compiler/bytecode vm separation requirement. JS is interpreted, and very seldom compiled by JIT. I don't want JIT necessarily. Also, all current ECMAScript parsers are all but small.