(Extended) Scheme R7RS Small with (extended) WAT as IR on bare metal

I have started a personal project of an OS (more like an environment) for both old and new featurephones using ARMv5 SoC (Spreadtrum and Mediatek chips). Would like to discuss, how are Hoot and Goblins dependent on Guile-specific features. I’m afraid, Guile is too big for this project. Is it possible to fork Hoot at some point and add bare-metal interface, capability security for applications, etc.?

3 Likes

Hi @smt50001! On the compiler side, Hoot is an extension of Guile. It re-uses most of Guile’s compilation pipeline, replacing the backend that emits bytecode for the Guile VM and instead emitting WebAssembly. The binaries produced by Hoot could be run on any Wasm runtime that can provide the necessary host facilities (clock, bigints, weak hash tables, etc.). Goblins is not so tied to Guile in that there are two flavors of Goblins: one for Guile and one for Racket. Neither is written in standard Scheme, as there is no Scheme standard that could provide everything needed. Guile Goblins is the “flagship” flavor with the most features and it is built on Guile’s Fibers concurrency library. I’m not sure what you mean by “bare-metal interface” in this context, but I hope this information helps.

Thank you for a quick answer. By “bare-metal interface” I mean the ability to work with platform’s assembly mostly. So it seems most likely I’ll need to write my own Scheme with a simplified compilation pipeline and some Guile compatibility (because Goblins for me seems very nice to use for some phone-specific tasks such as messaging).

Sorry, need to ask some community questions. Should I introduce myself in a dedicated thread? May I post updates on the OS in this thread?

We have an introductions thread here: https://community.spritely.institute/t/welcome-to-the-spritely-institute-discourse-introduce-yourself-here

And sure, you can keep posting to this thread about your project.

3 Likes

If you’re looking for a bare-metal actor/capability system, you might consider uFork. It’s inspired by many of the same sources as Goblins.

A compiler for a small Scheme dialect with actor extensions is supported by the coding playground. The VM (written in Rust) currently targets WASM (1.0), but could be compiled for ARM. I’ve considered porting it to the Raspberry PI, but haven’t tried it yet.

1 Like

Thank you for your reply. Right now I am considering compiling Scheme to ARM instructions directly, and translating WAT to Scheme via a transpiler similar to Zabavno.

1 Like

After reading Distributed System Daemons: More Than a Twinkle in Goblins' Eye -- Spritely Institute I wish to say that Pre-Scheme is not the way I’m going, using this article as refernece instead: Zero Feet: a proposal for a systems-free Lisp

How many problems will I have if I’ll check inline assembly for pointer bounds with dependent types?

Still trying to work on this. For now I’ve found a good phone on Unisoc SoC which has UART access.

Writing a compiler for R7RS Small purely in itself is an interesting expirience. Hope to share more soon.