Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My understanding is that guile is an extension language. Create a prog.c and link to guile, that's how I think you can create an executable.


Creating a C program that links to libguile is kind of a legacy use-case at this point. It was the original purpose of Guile back when it was but a simple interpreter. The trajectory for the past decade or so has been to build up Guile as a platform for writing your entire application. Rather than embedding an interpreter in a C program, the recommended approach is to write a Scheme program that uses the C FFI if and when necessary. The interpreter was once written in C but is now written in Scheme (a minimal C interpreter is kept around for bootstrapping purposes.) There's a sophisticated optimizing compiler that emits bytecode for the Guile VM as well as a JIT compiler. A new garbage collector and a Wasm compiler backend are currently being developed. The big missing piece is ahead-of-time native compilation, but the work on the Wasm backend will help that along as it needs to solve a lot of the same problems.


I originally got a PAUSE id to upload to CPAN to add support for returning continuations from Guile code to Perl and being able to resume them as a function call on the Perl side later.

That let me write linear async-await-ish logic code in Guile and then have all the I/O and grungy stuff handled by an event driven layer in Perl space.

(this was about 20 years ago, give or take, but I still periodically get accused of writing lisp in whatever language I'm implementing things in at the time ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: