sprymicro

Small demo Spry interpreters

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Tags

Installation

nimble install sprymicro
choosenim install sprymicro
git clone https://github.com/gokr/sprymicro

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
sprymicro - - - - - - -

Source

Repository https://github.com/gokr/sprymicro
Homepage https://github.com/gokr/sprymicro
Registry Source nimble_official

README

Sprymicro

This is a demonstration of compiling minimal Spry interpreters.

  • sprymin.nim - A minimal core Spry interpreter that can still read a file
  • sprymicro.nim - As small as it can get, source is embedded instead of accessed as file

Going small

The Spry interpreter is fairly small, but it does include the Nim soft realtime GC so we can't go ultra small. But using for example musl-libc or diet-libc you can make a statically linked stripped 64 bit x86_64 VM that is only around 100kb. Clang makes a smaller non-size optimized binary, but larger size optimized.

musl-libc

If you want to try building with musl-libc (which seems to be the most competent small libc) you need to install musl-dev and then use a build command like this:

nim -d:release --opt:size --passL:-static --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc c sprymin && strip -s sprymin

diet-libc

If you want to try building with diet-libc you need to install dietlibc-dev and add this file:

gokr@yoda:~$ cat /usr/bin/dietgcc diet gcc $@

...then use a build command like this:

nim -d:release --opt:size --passL:-static --gcc.exe:dietgcc --gcc.linkerexe:dietgcc c sprymin && strip -s sprymin

On my machine that produces a sprymin around 122kb and sprymicro around 114kb.