lua-users home
lua-l archive

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


On 10/15/2013 11:42 PM, Benjamin Heath wrote:
Hello list. :)

My hobby is NES development, and I've heard that an apparently
lite version of Python has been "ported" to 6502 assembly. That
is, it translates to 6502 instead of byte code. Personally, I'm
actively developing a program in Lua to create video game music by
generating 6502 assembly from a Lua script that describes the
song. (Music notation is in a very basic form of MML.)

Looking at "A No-Frills Introduction to Lua 5.1 VM Instructions",
I wonder what about Lua could safely translate to 6502. Clearly,
the high-level instructions could be expressed in terms of
multiple 6502 instructions. You'd have to remove strings. No
locals. Interestingly, functions as first-class data types and
thus functions within functions seems okay! :)

There must be more and I'd really like to explore all this. What
do you all think?

I agree that the more you cut, the easier it gets to translate to assembly. Or keep as much functionality as possible and end up as fast as Microsoft BASIC. Good old retro stuff... also, I keep having this mental image of switching on to Lua on my VIC-20...

I think a few years ago, there was an attempt at translating a subset of Lua (or Lua bytecode?) to PIC16 assembly. For PIC16, the quickest way would be to limit to globals, byte-sized numbers, drop strings, drop tables, and some other stuff.

I would love to see the end result...

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia