guile-user
[Top][All Lists]
Advanced

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

Re: How best to produce a standalone executable with Guile?


From: James Cooper
Subject: Re: How best to produce a standalone executable with Guile?
Date: Tue, 7 Apr 2020 09:31:53 +0000

Hi Matt and Christopher,

Thank you for your responses.  Apologies for replying to my email - for
some reason I never received either of yours into my inbox, I only saw them
when I looked up my email on the mailing list archive online.

I'm afraid I am not (currently) a Guix user.  I did try to install it on my
working system but had no end of issues, which led me to leave it for the
time being and instead simply build Guile from source.  That's a story for
another time, however, and it certainly sounds like something I should look
into.

Am I correct in understanding that guild essentially is what the Guile
runtime will use to compile my source files before executing them?  And
that the way to create a traditional executable would be to create a C
program that includes libguile.h and wraps my actual Guile program
(probably using scm_boot_guile)?  I'll try out this approach as soon as I
can.  If you're wondering, the reason why I'm interested in having a
traditional executable is that I'm planning to run comparative benchmarking
directly on equivalent versions of the same program in different languages,
and I *think *that will work a lot better if I can specify an executable
name for the Guile implementation.

Thanks again.

Regards,

James

On Sun, 5 Apr 2020 at 05:28, James Cooper <address@hidden> wrote:

> 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 ahead-of-time?
>
> 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
> in.
>
> 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.
>
> Regards,
>
> James
>


reply via email to

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