ELK(1)

πŸ’– NAME πŸ’–

okay so bestie, meet elk and scheme-elk β€” literally an extensible Scheme interpreter. two names, one icon. πŸ¦‹


✨ SYNOPSIS ✨

elk [ -l file ] [ -h KBytes ] [ -p load-path ] [ -g ] [ -i ] [ -v type ]
[[ -- ] args]

elk...

that's the whole vibe check. yes there are two forms. no we're not gonna argue about it. πŸ’…


🌸 DESCRIPTION 🌸

Elk β€” short for Extension Language Kit β€” is a Scheme implementation that was designed to be a general extension language for apps written in C or C++. no cap. 🫢

Normally Elk gets linked with the application it serves. but there's also a stand-alone version of the Scheme interpreter that gets installed too (usually just called elk). and with that interpreter plus the standard Scheme toplevel? Elk can be used as a totally ordinary, stand-alone implementation of the Scheme language. it's giving versatile. ✨

here's how the startup behavior works:

  • if you call it with no -l option, Elk loads the standard β€œtoplevel” and starts an interactive session. cozy. πŸŽ€
  • if you call it with -l file, the contents of that file get loaded instead. plot twist!
  • and if you hand it a - as the filename argument, Elk loads from standard input. iconic.

now the options, one by one, because we respect a complete list in this house:

  • -p load-path β€” overrides the standard load-path. the argument is a colon-separated list of directories. and if you don't pass this option but the environment variable ELK_LOADPATH is defined, then that variable's value is what initializes the load-path. ELK_LOADPATH takes the exact same format as the argument to -p. iykyk. πŸ’œ
  • -h KBytes β€” lets you specify a non-standard heap size. the default heap size is 512 KBytes. that's the number, bestie. remember it. ⭐
  • -i β€” maps symbols to lower case. normally Elk is case-sensitive, so this one changes the whole energy. πŸ™ˆ
  • -g β€” makes the interpreter run the garbage collector every single time memory is allocated on the heap. this is genuinely useful for writers of extensions who want to test the garbage collect behavior of an extension. running Elk with -g is likely to reveal GC-related bugs in extensions β€” stuff like not properly protected local objects β€” because it triggers a garbage collection each time an object is allocated on the Scheme heap. and fun detail: a dot gets written to standard output each time a garbage collection is performed when -g has been specified. little dot. big power. πŸ”₯
  • -v type β€” the β€œverbose” option, and you can pass one or more of them. the interpreter prints additional informational messages to standard output, depending on what type is. specifically:
    • if type is load, the linker command and options get printed each time an object file is loaded.
    • if type is init, the names of extension initialization and finalization functions get printed as they're called.
  • -- β€” if your arguments could be interpreted as options, use -- to indicate the end of the options. savior behavior honestly.

and the remaining args? those get put into a list of strings, and the Scheme variable command-line-args is bound to that list in the global environment. so your args are never lost, they just get a new home. πŸ’–


πŸŽ€ FILES πŸŽ€

  • $TMPDIR/ldXXXXXX β€” temporary files. yes the XXXXXX is intentional. it's a whole thing. ✨

πŸ‘‘ AUTHOR πŸ‘‘

Oliver Laumann β€” the legend behind it all. πŸ’œ


and that's a wrap, bestie! this page comes to you from the 4th Berkeley Distribution, dated 15 January 1991. vintage. iconic. ate. periodt. 🫢✨πŸ’