On Sun, Oct 12, 2025 at 2:11 PM Srayan Jana <[email protected]> wrote: > > This is actually not much of a proposal, since I'm just bringing up a bunch > of previous art. > A couple of other languages like C#, Rust, D and a few others have a > "dialect" embedded within their language for "unsafe" operations. > > Rust has "unsafe", C# also calls it unsafe, and I think D calls it @system > It would be nice to have similar functionality in Guile so you could do a lot > more low level stuff. It would be fun to be able to use as little C as > possible while still creating stuff that's super close to the metal!
The Guile compiler is built upon a tower of languages that get lowered to bytecode. For example, Scheme is lowered to Tree-IL which is lowered to CPS which is lowered to bytecode. You could imagine instead starting with some statically typed language that is Scheme-like but maybe lowers directly to CPS or something. With the right interface wrapped around it, the resulting bytecode would be callable from Scheme. > There was actually a similar proposal/project a while back that I was > following along quite closely: > https://prescheme.org/ > https://codeberg.org/prescheme > This was a scheme-inspired language that did low level memory management and > pointers and stuff, used to implement Scheme-48. > It was revived for a bit, but the author seemed to have vanished off the > internet. > Still, there's a lot of good work here, so I'm wondering if it would somehow > be possible to turn all of this stuff into a SFRI of sorts? > The only problem is that something like PreScheme breaks a lot of the > assumptions Guile has, so I'm not sure if it would be able to fit a SFRI I still hope to see PreScheme succeed as it would be a great language for implementing a Scheme runtime, which is what Scheme-48 did. That's a different use-case than what you are after, though, IIUC. > There's also Crunch (https://wiki.call-cc.org/eggref/6/crunch), which is a > similar idea by the guys who do Chicken scheme. However, that still uses > reference counting, whereas I'm interested in something low-level that can > compete with C/Odin/Zig/Hare/etc. Crunch is like PreScheme in that it doesn't compose with existing Scheme programs. Competing with those static, linear memory languages is going to be tough without native compilation. Even so, Guile is fundamentally a GC managed thing. - Dave
