[DGD] llvm/jit

Jared Maddox absinthdraco at gmail.com
Fri Feb 22 05:57:22 CET 2013


> Date: Wed, 20 Feb 2013 20:21:07 -0800
> From: Raymond Jennings <shentino at gmail.com>
> To: All about DGD and Hydra <dgd at dworkin.nl>
> Subject: Re: [DGD] llvm/jit
> Message-ID:
> 	<CAGDaZ_p3MKzh7Wm-tsO035-dO3aadyvvNeLORYaXSfmHPaScVg at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Wed, Feb 20, 2013 at 7:30 PM, Jared Maddox <absinthdraco at gmail.com>
> wrote:

<snip>

>> Yes. Have you tried the TCC compiler? It has a library version that
>> does something similar to what you might be looking for.
>
> I've never even heard of it.
>

Here's the mailing-list interface:
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

And here's the website:
http://bellard.org/tcc/

I don't know that you'd want to use it, OR emulate it (it started in
an obfuscated C contest), but among it's features is the ability to
run C files as scripts, as well as the ability to compile C within
your application and then call it without loading it as a dynamic
library (note: for whichever specific reason, SELinux forces the code
to be loaded as a library). At one point, it was also used to
boot-load the Linux kernel's source code (instead of an already
compiled version) with a custom build script. As a result, I suspect
that you can find some relevant information by e.g. digging through
it's mailing-list archives.

> The first thing I'm trying to do is learn and successfully implement
> JIT period, because I am a complete and total n00b at it.
>

Welcome to the joys of writing a compiler! Because that's
approximately what you're doing. One of my own projects is to write an
improved Flash/JVM "competitor" (yeah, as if that'll work out), so I
can sympathize, and will eventually need to do the very same thing.

I think that for a DGD JIT, one of the most important things would be
to create an easy way to swap DGD-VM functions for DGD-JIT ones at
run-time. If you hope for this to eventually work it's way into Hydra
then it'll need to work atomically, so I'd suggest looking at how some
project or another (e.g. SDL2) does Atomic Reads and Atomic CAS
(Atomic Write is... not what you want). This'll give you an overview
of the rules that the JIT will need to work with AFTER the
VM-to-Native bytecode-compilation is done. For just a DGD version you
wouldn't need to work with atomic operations (and it could actually
slow things down), but restraining yourself to a non-atomic equivalent
would probably be a good idea.


> Date: Wed, 20 Feb 2013 21:06:56 -0800
> From: Raymond Jennings <shentino at gmail.com>
> To: All about DGD and Hydra <dgd at dworkin.nl>
> Subject: Re: [DGD] llvm/jit
> Message-ID:
> 	<CAGDaZ_o5EsE5SH+G7kEBis+kN-qhu0QqXv9sc7FT3-D=Tzrwwg at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Personally I know that felix plans to boot precompilation out of dgd
> as soon as jit support is in.  I've had nothing but problems with
> precomp and it's even hampering my work on skotos 1.5
>

Is he still planning to keep the extensions interface?



More information about the DGD mailing list