in ,

rochus-keller / LjTools, Hacker News

rochus-keller / LjTools, Hacker News


                    

        

This is a parser, browser, assembler and test VM for LuaJIT 2.0 bytecode written in C and Qt. Seehttp://luajit.org/for more information about LuaJIT.

The goal of this project (work in progress) is to better understand how LuaJIT works, and to support the development of alternative front ends which generate LuaJIT bytecode (as it is eg done inhttps://github.com/rochus-keller/Oberon).

The viewer can be used to edit and compile Lua source code and display it side by side with its corresponding LuaJIT bytecode. The test VM implements a subset of LuaJIT bytecodes to study and validate their functions (see the examples subfolder).

Here is a screenshot:LjBcViewer Screenshot

The assembler can be used to directly program and test with LuaJIT bytecode. The syntax is defined in LjAsm.ebnf; here is a PDF of the syntax:http://software.rochus-keller.info/LjAsm_Syntax.pdf. It slightly abstracts from original LuaJIT bytecode and supports automatic register allocation. Documentation of the syntax is TBD; varargs and for loops are not yet supported (because most likely not used by the new front ends).

Here is a screenshot:LjAsmEditor Screenshot

Build Steps

Follow these steps if you want to build LjBcViewer yourself:

  1. Make sure a Qt 5.x (libraries and headers) version compatible with your C compiler is installed on your system.
  2. A compiled version of LuaJIT 2.0 is also required; your distro likely includes a dev package. Alternatively download the source fromhttp://luajit.org/download/LuaJIT-2.0.5.tar. gzand run the Makefile; make sure the resulting libluajit.so/lib is accessible to the linker.
  3. Create a directory; let’s call it BUILD_DIR
  4. Download the source code fromhttps://github.com/rochus-keller/LjTools/archive/master.zipto the BUILD_DIR; rename the subdirectory to “LjTools”.
  5. Download the GuiTools source code fromhttps://github.com/rochus-keller/GuiTools/archive/master.zipand unpack it to the BUILD_DIR; rename it to “GuiTools”.
  6. Goto the BUILD_DIR / LjTools subdirectory and executeQTDIR / bin / qmake LjBcViewer.pro(see the Qt documentation concerning QTDIR).
  7. Run make; after a couple of seconds you will find the executable in the build directory.

Alternatively you can open LjBcViewer.pro using QtCreator and build it There.

LjAsmEditor.pro is compiled in the same way. The application makes use of a parser generated by Coco / R based on input from EbnfStudio (seehttps://github.com/rochus-keller/EbnfStudio). There is no other dependency than the Qt Basic library. The repository already contains the generated files. In order to regenerate LjasParser.cpp / h you have to use this version of Coco / R:https://github.com/rochus-keller/Coco.

The repository includes the original LuaJIT 2.0.5 headers for convenience.

  

Brave Browser
Read More
Payeer

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

Discovering Hard Disk Physical Geometry Through Microbenchmarking, Hacker News

Great apes pass a false-belief test, hinting at a theory of mind, Ars Technica

Great apes pass a false-belief test, hinting at a theory of mind, Ars Technica