[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How best to produce a standalone executable with Guile?

From: James Cooper
Subject: How best to produce a standalone executable with Guile?
Date: Sun, 5 Apr 2020 05:28:10 +0000

Hi Guile folks,

I am currently experimenting with a handful of languages that include
modern implementations of Concurrent ML, to determine which one appears
best able to handle computationally- and message-heavy workloads (at least
for my purposes, Computer Vision).  Guile is one of the languages I am
trying out with the Fibers library.

My question is, how can I best go about creating Linux executables from
Guile, where said programs benefit from the most ahead-of-time compilation
and optimisation possible?  I don't believe they strictly need to be
standalone, as the environment I will be running the programs in will
likely be the same as the development environment. So they can undoubtedly
have dependencies on external libraries.  Furthermore, I am perfectly happy
with the process being a bit convoluted, as I can easily automate it with a
makefile.  I would, however, prefer if at all possible that the option to
target other processor architectures remains available down the line (I
assume using GCC can enable this, but I'm not sure).

I have looked at all the sections of the Guile manual that appeared
relevant, but to be honest I'm still a bit confused about what the best
approach would be.  *s* *9.4.5 Bytecode* in the manual seems to suggest
that one can use guild to produce what will be a standalone executable that
looks like an ELF binary to the system and runs on the Guile VM, but I'm
entirely sure if I am reading it correctly.  *s 6.18.5 Compiling Scheme
Code* also discusses compilation but seems to denounce the practice
explicitly.  *s 9.3.8 Just-In-Time Native Code* talks about JIT compilation
to native code for a given target.  Is it possible to apply this process

A potential alternative approach I can see is using the capabilities of
running Guile code in a C program (compiled with GCC).  This would
presumably involve creating a template C program that just calls the
appropriate Guile functions and passes the relevant command line parameters

Any thoughts on what would likely produce the most efficient executable in
the end?  The target programs do not need to modify themselves at run-time
(or really do anything dynamic) if that makes a difference.  And does
anyone know of pre-existing examples they could point me to?  Please do let
me know if there is further information I could provide that would help.
Thanks in advance.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]