Re: Using luajit runtime for non-lua languages

  • From: Pierre-Yves Gérardy <pygy79@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 3 Feb 2013 00:06:35 +0100

The LuaJIT bytecode is very close to Lua semantics, but so is Jack [0], so
it could be a good fit.

Seeing how close they are, I think it would be easier and almost as
efficient to compile to Lua. The only impedance mismatches I see would be
the tuple type (but I guess it could be done using the FFI), and the
enforcement of the "density" of the list type.

-- Pierre-Yves

[0] https://github.com/creationix/jack

On Sat, Feb 2, 2013 at 11:26 PM, Tim Caswell <tim@xxxxxxxxxxxxxx> wrote:

> I'm designing a toy language called Jack and I'm in search of a way to
> make it run outside a javascript environment.  I'm pretty good at writing
> compile-to-js and interpret-in-js languages, but I want something more
> native.
>
> I thought LLVM would be the answer to all my needs, but it seems terribly
> complex and C++ oriented.
>
> Would it make sense to have my compiler generate luajit bytecode (assuming
> it's possible to represent all my language's semantics) and the somehow
> embed the luajit runtime in binaries?
>
> I would want to pull all of the lua standard library and lua compiler
> code.  I don't expect too much left at that point other than the assembler
> interpreters and the JIT engines.
>
> Is this a good idea or am I completely crazy?
>
> -Tim Caswell
>

Other related posts: