dworkin / lpc-ext

Extension modules for Hydra and DGD
The Unlicense
9 stars 5 forks source link

Alternate JIT compiler based on libgccjit? #4

Open dworkin opened 3 years ago

dworkin commented 3 years ago

The current JIT compiler, as of version 1.2.5, makes use of clang. It might be nice to have a GCC-based alternative.

The problem here is that GCC is licensed under the GPLv3. This includes libgccjit.h, which must be #included. GPLv3 is compatible with DGD, but not with Hydra. Since the JIT compiler for DGD/Hydra is actually a separate program (released into the public domain), and only the object file that it produces is linked with Hydra at runtime, this may technically not be in conflict with the GPLv3, but the Free Software Foundation could well take the view that it goes against the spirit of the license, regardless.

Furthermore, the JIT-compiled code produced might also be subject to the GPLv3. This may actually be the cause that libgccjit has seen little uptake and is still in alpha.

For these reasons, I am not going to touch it, but perhaps someone else wants to have a go at it.