lua-users home
lua-l archive

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

It was thus said that the Great Dibyendu Majumdar once stated:
> On 23 June 2018 at 20:51, Soni "They/Them" L. <> wrote:
> > Would it be possible to implement CC-JIT support?
> If you mean compiling with external compiler then yes I suppose so,
> but that would mean creating some kind of shared library and loading
> code from that ... pretty inefficient.

  There's always TCC [1], a library which can compile code into memory that
can be called directly.  I have a Lua wrapper for it [2] and code on top of
that that allows the loading of C based modules directly from source code
[3], as well as making an easy to use API for compiling C code.

  On the good side, TCC compliles *fast* [4].  On the down side, the code it
produces is *not fast*.  It's a trade off.  And it's fun to play with.





[4]	There was an older version that could boot the Linux kernel, from
	source code, in under 10 seconds.