SkillAgentSearch skills...

Luna

A luajit bytecode interpreter written in RPython

Install / Use

/learn @fhahn/Luna
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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
View on GitHub
GitHub Stars11
CategoryDevelopment
Updated9mo ago
Forks1

Languages

Python

Security Score

67/100

Audited on Jun 24, 2025

No findings