lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 08/01/12 21:10, Reuben Thomas wrote:
> On 8 January 2012 21:09, David Kolf <kolf@gmx.de> wrote:
[...]
>> Somebody already wrote a PC emulator in JavaScript. ;-)
>> <http://bellard.org/jslinux/>
> 
> And with something like Javascript's typed arrays extension for Lua
> you could do it in Lua.

I should point out that most of the magic in Fabrice Bellard's emulator
is that it's *not* emulating x86 code; it's dynamically recompiling it
into Javascript, and then running the Javascript directly. (It builds on
a lot of the same logic as qemu.)

The same trick would work just as well in Lua, and LuaJIT's ffi even
gives the fast byte arrays to make it all efficient.

The massive amounts of work to actually make it all happen is left as an
exercise for the reader...

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│
│ "Never attribute to malice what can be adequately explained by
│ stupidity." --- Nick Diamos (Hanlon's Razor)

Attachment: signature.asc
Description: OpenPGP digital signature