Compiling the .scm to .go ahead of time (with guild) and loading the .go 
directly makes a lot of sense:

• It avoids issues with locating the .go (no need to set .go path when invoking 
guile, although if it does use additional dependencies, depending on where they 
are located the script may need to set the .go (and .scm) path).
• It needs to look at less files (no need to compare .scm & .go modification 
times) (*)
• Easier to set compilation options (e.g. optimisation level)
• It avoids auto-compilation (no "compiling this thing / that thing” messages, 
no compilation cache filled with old junk, and in case of some forms of 
containerisation, avoids permission issues & transmission vector).

(*) won’t make a big difference since it most likely uses other modules, but 
it’s something.

>I tried the following commands with no luck:
>guile3.0 example.scm.go
>guile3.0 --language=bytecode example.scm.go

To my understanding of the language tower, the second is supposed to work. What 
does “no luck” mean here? (I don’t have a guile setup at the moment.)

(You need to recompile in case of some version changes, but that’s hardly 
Guile-specific.)

(There is an internal caching mechanism for autocompilation, but AOT (to 
bytecode) is a fine thing to do, and Guile supports that too. I recommend it 
for things like libraries and installed software (for random scripts 
autocompilation is likely good enough unless the extra messages or shared 
(per-user) cache directory are problematic.).)

Best regards,
Maxime Devos

Reply via email to