SKINT -- a new kid on the block
Maxim 10 Aug 2024 09:25 UTC
I've recently learnt about this R7RS implementation:
https://github.com/false-schemers/skint
The blurb:
Cheap and fast R7RS Scheme Interpreter
SKINT is a portable interpreter for the R7RS Scheme programming
language. It can be built from five C source files (10K lines of code)
with a single command. There is no distributives or packages; just
compile the source files with your favorite C compiler, link them with
the standard C runtime libraries, and you're done. For some platforms,
precompiled binaries are available
It seems to work... (-:
~/dump/skint
🚀 make
clang is detected
x86_64 architecture is detected
clang -O3 -DNDEBUG -D NAN_BOXING -c -o s.o s.c
clang -O3 -DNDEBUG -D NAN_BOXING -c -o k.o k.c
clang -O3 -DNDEBUG -D NAN_BOXING -c -o i.o i.c
clang -O3 -DNDEBUG -D NAN_BOXING -c -o n.o n.c
clang -O3 -DNDEBUG -D NAN_BOXING -c -o t.o t.c
clang -O3 -DNDEBUG -D NAN_BOXING -o skint s.o k.o i.o n.o t.o -lm
~/dump/skint
🚀 ./skint --help
SKINT Scheme Interpreter v0.4.9
usage: skint [OPTION]... [FILE] [ARG]...
Options:
-v, --verbose Increase output verbosity
-q, --quiet Suppress nonessential messages
-A, --append-libdir=DIR Append a library search directory
-I, --prepend-libdir=DIR Prepend a library search directory
-D, --define-feature=NAME Add name to the list of features
-e, --eval=SEXP Evaluate and print an expression
-s, --script=FILE Run file as a Scheme script
-p, --program=FILE Run file as a Scheme program
-V, --version Display version info
-h, --help Display this help
'--' ends options processing. Standalone FILE argument is treated as a script.
If no FILE is given, skint enters Read-Eval-Print loop (stdin>eval-print>stdout)
~/dump/skint
🚀 ./skint
SKINT Scheme Interpreter v0.4.9
Copyright (c) 2024 False Schemers
skint] (define mod truncate-remainder)
(define leap-year?
(lambda (year)
(and (zero? (mod year 4))
(boolean=? (zero? (mod year 100))
(zero? (mod year 400))))))
skint]
skint] (leap-year? 2004)
#t
Just wanted to share for your information.