libgccjit and Racket

152 views
Skip to first unread message

Vibhav Pant

unread,
Nov 3, 2018, 3:15:43 PM11/3/18
to Racket Developers
Hi,

Has there been any interest in using libgccjit as a JIT compilation library for Racket? Owing to the library's use of GCC as a code generation backend, libgccjit:

* Supports a wider range of architecture (as compared to GNU lightning)

* Uses a C-like IR to represent code, as opposed to the virtual instruction set used by lightning.

* Allows JIT compilers to generate better optimized code, and generate debugging information for running JIT compiled on a debugger.

The library is still in alpha, but is pretty promising. While I haven't completely understood Racket internals, I would be interested in knowing if any effort towards writing a JIT compiler for Racket using libgccjit is worth it.

Best,
Vibhav Pant

Paulo Matos

unread,
Nov 4, 2018, 4:25:16 PM11/4/18
to Vibhav Pant, Racket Developers
Hi,

I really like libgccjit. A lot of work has gone into it and it does a
really good job interfacing with gcc. That said, integrating it into
Racket is a _huge_ amount of work. It is nonetheless very interesting
and I would certainly like to see it done.

However, note Racket is moving to running on Chez (Racket-On-Chez). I
imagine if you want to get it run over libgccjit it would be easier to
target Chez. So, in principle if you get Chez-On-GCC, then you can have
Racket-On-Chez-On-GCC. It's a hard project, no doubt about it but
certainly interesting and possibly useful. It might be the case that
there's no way to describe all of Chez features in libgccjit, meaning
you'll have to coordinate with others to get things done.

Good luck,

Paulo Matos
> --
> You received this message because you are subscribed to the Google
> Groups "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-dev+...@googlegroups.com
> <mailto:racket-dev+...@googlegroups.com>.
> To post to this group, send email to racke...@googlegroups.com
> <mailto:racke...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-dev/7facb12c-be2a-4989-9b1d-ce1c9079de5f%40googlegroups.com
> <https://groups.google.com/d/msgid/racket-dev/7facb12c-be2a-4989-9b1d-ce1c9079de5f%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
Paulo Matos

Gustavo Massaccesi

unread,
Nov 4, 2018, 8:47:13 PM11/4/18
to pma...@linki.tools, vib...@gmail.com, racke...@googlegroups.com
In both cases, I think there will be a license problem. IIUC the license of libgccjit is GPLv3.

Gustavo

Paulo Matos

unread,
Feb 6, 2019, 7:37:31 AM2/6/19
to Vibhav Pant, Racket Developers


On 03/11/2018 20:15, Vibhav Pant wrote:
> Hi,
>
> Has there been any interest in using libgccjit as a JIT compilation
> library for Racket?

Vibhav, have you pursued any work in this direction?

--
Paulo Matos

Paulo Matos

unread,
Feb 6, 2019, 7:51:54 AM2/6/19
to Gustavo Massaccesi, vib...@gmail.com, racke...@googlegroups.com


On 05/11/2018 02:46, Gustavo Massaccesi wrote:
> In both cases, I think there will be a license problem. IIUC the license
> of libgccjit is GPLv3.

I am not a lawyer but Racket is LGPL. LGPL is GPL3 compatible. Am I
missing something?

--
Paulo Matos

Paulo Matos

unread,
Feb 6, 2019, 8:01:50 AM2/6/19
to Gustavo Massaccesi, vib...@gmail.com, racke...@googlegroups.com
I also confirmed that after the license change [1], we will remain GPL3
compatible - both Apache2 and MIT are GPL3 compatible [2].

[1] https://github.com/racket/racket/issues/1570
[2]
https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licenses
--
Paulo Matos

Paulo Matos

unread,
Feb 21, 2019, 9:13:21 AM2/21/19
to Vibhav Pant, Racket Developers
FYI, I started some do some work on this:
https://github.com/LinkiTools/racket-gccjit

Not ready to be a proper pkg yet though. But it does already JIT an
hello world function (from libgccjit tutorial 1).
Reply all
Reply to author
Forward
0 new messages