fhahn / luna

A luajit bytecode interpreter written in RPython

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Luna

Build Status Coverage Status

Luna is a bytecode register interpreter for Lua. At the moment it uses Luajit to compile Lua files to bytecode and interprets it.

You'll need to have a few dependencies installed. You can get them with pip install -r requirements.txt. Then make sure you have a recent checkout of PyPy and have it on your PYTHONPATH. Finally you need a recent version of luajit (luajit -b is used to generate the bytecode).

To run the tests::

$ py.test

To translate run::

$ python translate.py

This will compile Luna, it'll take about 30 seconds.

To run Luna directly on top of Python you can do::

$ python -m luna /path/to/file.lua

TODO

  • Compiler in Rpython
  • Interators
  • JIT
  • more standard library functions

Features

At the moment, Luna supports most of the Lua standard constructs, except iterators.

Following parts of the standard library (the code can be found in luna/modules) have been implemented:

  • Builtins
  • assert
  • print
  • loadfile
  • loadstring
  • tonumber
  • type
  • math
  • floor
  • sin
  • mod
  • table
  • concat
  • insert
  • remove
  • string
  • find
  • match
  • gsub

About

A luajit bytecode interpreter written in RPython

License:Other


Languages

Language:Python 95.4%Language:Lua 3.3%Language:Groff 1.1%Language:Common Lisp 0.2%