lua-users home
lua-l archive

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


Hi Sean,

On 13 September 2017 at 20:49, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Dibyendu Majumdar once stated:
>> I have been trying to figure out a way to create a small JIT backend
>> that trades size for performance. Additionally, writing the backend in
>> IR is tedious and errorprone, so it would be better if the backend
>> could be written in a language such as C.
>
>   What's wrong with using DynASM from LuaJIT?  That might be a good place to
> start.

Dynasm is an assembler so that is even worse than writing LLVM IR -
you have to write assembly code for each architecture you wish to
support.

> There's also TCC (Tiny C compiler) which can be used as a library to
> compile C code directly into memory, but the license is LGPL.  I have two
> modules that wraps up TCC [1] that you can look at though.
>

Right now I am using a C front end based on Linux Sparse, and as of
now my fork of Sparse (named dmrC after Dennis M Ritchie) has two
backends - LLVM and NanoJIT. I might look at TCC at some point too,
although the license is not ideal.

Regards
Dibyendu