Re:Moonshine – A lightweight Lua VM for the browser
by j-b on Tuesday April 01, 2014 @09:39AM
(#7508042)
Interesting, any useful resources you recommend for those interested in learning how to write a VM in Javascript as a fun side project?
Re:Moonshine – A lightweight Lua VM for the browser
by dubcanada on Tuesday April 01, 2014 @09:59AM
(#7508198)
Don't write it in JS :)
No but seriously, if you want to write a VM in Javascript, I would suggest learning how to write a VM in a language more suited to writing a VM in. Maybe C or C++ then writing one in Javascript.
Re:Moonshine – A lightweight Lua VM for the browser
by stcredzero on Tuesday April 01, 2014 @10:27AM
(#7508403)
Do what you want. The nice thing about writing a managed language with GC in a managed language with GC, is that you don't have to write the GC. (Or the JIT, if you do it right.)
The result is a much smaller size, it's more understandable, hackable, extensible - all things that Lua's standard C implementation is great for. It's likely also easier to optimise this way.
I began on a similar project some years back, but as many spare-time projects go, never finished it: http://code.matthewwild.co.uk/ljs