GCC JIT vs others JIT ....
Paulo César Pereira de Andrade
paulo.cesar.pereira.de.andrade@gmail.com
Tue Jan 1 00:00:00 GMT 2013
2013/10/23 Basile Starynkevitch <basile@starynkevitch.net>:
> On Wed, 2013-10-23 at 13:22 -0200, Paulo César Pereira de Andrade wrote:
>>
>> A more complex, still WIP, use case example of lightning is
>> https://github.com/pcpa/owl (lib/oemit*c files are the lightning
>> interfaces)
>
>
> Thanks for your message Paulo.
Hi Basile,
> Actually, of all the JIT libraries I have cited, GNU lightning is
> probabnly the one I am the more familiar with. Long time ago, I coded
> ocamljit - a small JIT for ocaml bytecode - in it (but the current
> ocamljit2 is probably unrelated to it).
I did significant changes to lightning when I became maintainer of
it. Unless you used private interfaces (previously it was implemented
all in one pass as C macros, so, could not hide internals), basically
the main difference is that now function arguments are passed left
to right, and there is a large set of new ports.
> I'm interested by your OWL work (did you know that as a computer
> language, OWL means quite often
> http://en.wikipedia.org/wiki/Web_Ontology_Language ?)
I did not know about it.
> But I am not able to find out some small examples of OWL code and/or
> some syntax (and semantic) definition of your OWL. Or is OWL a JIT for
> full C (e.g. able to interpret any C program)?
It is a C/C++ like language, with static and dynamic typing. The only
examples so far are in check/test, that you can cut&paste under gdb,
or just run "./owl check/test" to run all examples in a row. The file is quite
large, and growing, to help stress test the current implementation.
> How do you code fibionacci and hello world in OWL? How do you code a
> program reading a list of integers and computing the list of their
> square?
It is still in the early stages of implementation, there are still too many
incomplete features, so, the best bet is to look in check/test that is
being used to slowly test code generation and correct code generation
bugs. But the hello world test is easy :-)
$ echo 'print("hello world!\n");' | ./owl
hello world!
I promise to add working Fibonacci examples to check/test in my next
commit :-) There is an internal stream implementation, but only "exported"
so far is the print builtin, that prints to stdout, so the example of an integer
list would need to have the input encoded in a vector for now.
> And back to David Malcolm's GCC JIT, would you find easy to re-implement
> OWL in it?
My interest is in writing a managed language with dynamic typing,
and static typing for faster execution. But porting to gcc jit should not
be much different from the initial code I am writing, mainly to exercise
lightning, that would "optimize" when types are know, check for overflow
when it can happen and otherwise fallback to calling functions to
implement the vm primitives.
> Cheers.
>
> --
> Basile STARYNKEVITCH http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mine, sont seulement les miennes} ***
Paulo
More information about the Jit
mailing list