Running Compiled Guile Objects
Basile Starynkevitch
basile@starynkevitch.net
Sat Dec 14 17:11:02 GMT 2024
On Sat, 2024-12-14 at 09:15 +0900, Nala Ginrut wrote:
> Hi Hakan!
> The current Guile is not AOT yet. Although the object file is ELF,
> it's
> just bytecode wrapped ELF header. So you can't run it as a regular
> executable file.
>
Those willing to contribute a proper ahead-of-time compiler to GNU
guile could use the GNU CC libgccjit library which is part of the GCC
compiler.
https://gcc.gnu.org/onlinedocs/jit/
This libgccjit layer of the GCC compiler is stable and maintained C API
and has some obsolete C++ API (which seems unmaintained in december
2024). Most of the libgccjit code is internally coded (under GPL
license) in C++, but the stable API is for C.
I am using the C API of libgccjit in the RefPerSys open source
inference engine project (GPLv3+ licensed) on
https://github.com/RefPerSys/RefPerSys/
Both libgccjit and GNU lightning (see
https://www.gnu.org/software/lightning/ ...) could be a basis for
adding a genuine compilation layer to GNU guile. And RefPerSys uses
both.
I guess a significant issue would be to use libgccjit (or GNU
lightning) with GUILE's garbage collector (which seems to be Boehm
conservative GC).
The RefPerSys project has a precise garbage collector and some
persistence (to textual files). Since it is GPLv3+ licensed, its code
could be reused in a future GUILE major version. RefPerSys is mostly
coded in C++.
I did contribute to GCC long time ago and hope that RefPerSys could
become a GNU project (but don't know how to make that happen)
Regards from near Paris in France.
--
Basile STARYNKEVITCH <basile@starynkevitch.net>
8 rue de la Faïencerie
92340 Bourg-la-Reine, France
http://starynkevitch.net/Basile & https://github.com/bstarynk
More information about the Jit
mailing list