scheme48(1)

πŸ“¦
version 1.9.2 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

scheme48 β€” a Scheme interpreter πŸ’œ (yes bestie, that's the whole vibe, it interprets Scheme)


πŸ¦‹ SYNOPSIS πŸ¦‹

scheme48 [-i image] [-h heapsize] [-a argument]

🌸 DESCRIPTION 🌸

Okay so scheme48 is an implementation of the Scheme programming language, exactly as described in the Revised^5 Report on the Algorithmic Language Scheme. Periodt.

A runnable system needs two parts, no cap:

  • an executable program that implements the Scheme 48 virtual machine, and
  • an image that gets used to initialize the store of the virtual machine.

And scheme48 itself? It's a shell script 🐚 that starts the virtual machine with an image that runs in a Scheme command loop. It's giving middle-manager energy but make it iconic.

The scheme48 command loop reads Scheme expressions, evaluates them, and prints their results. It also executes commands, which you can spot because they start with a comma character. Type the command ,help to receive a list of available commands. fr fr, do it.


πŸ’… The -h lore πŸ’…

The meaning of the -h option depends on the type of garbage collector that was chosen at configuration time. It's giving "it depends" but for real this time.

If heapsize is a positive number, it specifies the number of words that can be live at any given time. One word is four bytes. Cons cells are currently 3 words, so if you want to make sure you can allocate, say, a million cons cells, you should specify -h 3000000 (actually a little more, to account for the initial heap image and breathing room). Bestie, budget for the vibes too.

If you specify a maximum smaller than the memory needed to load the image file, the maximum is increased accordingly and a message is written to the console. The system is basically like "noted, but no" 😭.

For the BIBOP garbage collector, heapsize may be 0. This means the heap will possibly keep growing until your system runs out of memory. Because of this risk, a warning message is written to the console if you specify -h 0.

🚨 BIBOP + -h 0 = the heap just keeps eating until your system runs out of memory. It will warn you on the console, but it will warn you while doing it. Be careful, queen.

πŸŽ€ ,dump, ,build and friends πŸŽ€

The ,dump and ,build commands put heap images in files.

  • The -i option causes the initial heap image to be taken from file image.
  • The -a option causes a list of strings to be passed as the argument to an image generated using the ,build command.

The first argument to ,build is a procedure that is passed the arguments following -a and which should return an integer (which is the return value of the Scheme 48 process). Slay.

Check it out, this is literally the example:

> ,build (lambda (a) (display a) (newline) 0) foo.image
> ,exit
$ scheme48 -i foo.image -a mumble
mumble
$

Look at that. mumble came out the other side. We love a full circle moment 🌈.


🌟 FILES 🌟

  • /usr/lib/scheme48-1.9.2/scheme48vm β€” the virtual machine.
  • /usr/lib/scheme48-1.9.2/scheme48.image β€” the default image.

And that's the whole page, bestie 🫢 this one lives in the General Commands Manual, goes by scheme48(1), and the version hanging out in all those file paths is 1.9.2. The footer's just the name and the section, so take it from me: you're all caught up. Bye bye, go type ,help πŸ’–βœ¨πŸŽ€