Scheme implementation comparison table


Comparison between Scheme implementations

This guide was written by someone looking from the outside in, so, without much experience. Therefore, inconsistencies an important omissions may take place. Please, refer to the footnotes as they will include more information and explanations.

The motivation for doing this comparison chart is to select an Scheme implementation with which an Ada/GNAT bootstrapping compiler could be created. Some of the more important aspects that we are looking for are:

ImplementationTypeLicenseOS supportArch support1Scheme StandardBuild dependenciesRuntime dependenciesCan be X-compiledSupports X-compilingTCC support2Library support3Full numeric towerFull tail recursion optimisationCPS (Continuation Passing Style)Macro supportDefine typesFFI (Foreign Function Interface)Unicode supportEmbeddableRuns on RISC-V/LinuxBuild-project systemNotes
ChezCompiler, InterpreterApache v2Linux, OSX, Windows, Android4x86*, arm[6], powerpc, more?R6RSC compilerNone??? Does not seem like itYes5Seems like itNeeds itself to compile itself -> bootstrap problem
Chibi SchemeVM-InterpreterBSDv3Linux, *BSD, Solaris, Plan 9, Android, iOS, WASM, OSX, WindowsEverything supported by the C compiler?R7RSC compiler, GNU Make recommendedNone, can use Boehm-GCMore or less yes6-Yes7R7RS small, some SRFIsYesYesYessyntax-rules, SRFI-46, low-level hygienic with syntactic-closures interfaceYes, SRFI-9, SRFI-99YesYesYes, goal of the implementationNo
Chicken 5Compiler8, InterpreterBSDv3Linux, *BSD, Solaris, Hurd, Haiku, Android, Windows, OSX, more?Everything supported by the C compiler?R5RS, R7RS9C compiler10, GNU MakeNone11YesYesYesYesYesYessyntax-rules, implicit and explicit renaming macro transformersSRFI-9 (built-in), SRFI-99 (egg). Yes12YesNo/Yes13Using -embedded can create .soYesYesHas some autogenerated Scheme files
CycloneCompiler14, InterpreterMITLinux, FreeBSD, OSX, WindowsKnow to run on *x86, and arm[7-8]R7RSC compiler, GNU Make, libtommath, concurrencykitConcurrencyKit??Maybe with the generated C codeR7RS largeNo, can create .so?Requires and has a bootstrap
GambitCompiler15-Translator, InterpreterApache v2 and LGPLv2.1Linux, *BSDs, OSX, Windows, JavaScript, iOS, NintendoDS, FPGAs…Everything supported by the C compiler?R4RS, R5RS, R7RSC compiler, GNU Make, (autotools)NoneYesYesYes CC=tccCan create .soYes
GaucheVM-InterpreterBSDv3Unix-like, AndroidEverything supported by the C compiler…?R7RSC compiler, GNU Make, (autotools) (libiconv?, Mbed TLS, pthreads)16None??/Likely-No, requires C++ (gc)It is still not v1.0, but should be there closely
GerbilCompiler, InterpreterApache v2 and LGPLv2.1Gambit’s supportGambit’s supportR5RS, R7RSGambit, libcryptoNoneLikely??-Yes
GNU Guile 3VM-Interpreter, JITGPLv3, Library LGPLv3Linux, *BSD, Solaris, Hurd, Windows, OSXEverything supported by the C compiler?R5RS, R6RS, R7RSC compiler, GNU Make, pkg-config, runtime dependenciesGMP, libFFI, Boehm-GC, libltdl, libunistringYes-NoYes?Yes, official GNU scripting langNo17Fully bootstrapped and reproducible. LOC count in18
Loko SchemeCompilerEUPL-1.2Linux, NetBSD, Bare-metal x86_64x86_64R6RS, R7RSC compiler, GNU Make, Akku, see NotesNoneYesYes19Requires bootstrap from another Scheme compiler…
MaruTODO
OlVM-Interpreter, Compiler20MIT and LGPLv3LibCEverything supported by the C compiler?R7RS subsetC compilerNoneYesYes?
OwlVM-InterpreterMITLibCEverything supported by the C compiler?R7RS subsetC compilerNoneUnlikelyUnlikelyYesBasicNoYes?YesNo?Yes21NoVery small implementation in C/Scheme
Racket2223VM-Interpreter, Wierd compilerMIT and Apache v2, Runtime LGPLv3Linux, FreeBSD, OSX, WindowsMostly everythingEverything?C compiler, GNU Make, libffiNone?YesYes24HugeYesNoYes?Biggest Scheme implementation, it is basically its own language
RibbitVM-InterpreterBSDv3Any target languageAny target languageSubset of SchemeNoneLikelyNo
S7Interpreter0-clause-BSD (simpler ISC)LibCEverything supported by the C compiler?R5RS25, R7RSC compilerNoneYes-Yes26Yes/Mostly27YesYesLow-level: CL-style define-macroSRFI-9, SRFI-99 and setters28YesYes/Fully manual29Meant to, main designYes30NoExtremely minimal (once .c and one .h file). Modelled after Guile 1.8
s9fesTODO
SCMVM-Interpreter, Compiler31LGPLv3Amiga, Atari, Linux, OSX, MS-DOS, Windows, OS/2, VMS, *NIXEverything supported by the C compilerR5RSC compiler, GNU Make, SLIB32, (autotools)NoneYesMaybe with the generated C codeNo, compiler errorsR5RS plus SLIBYesNo
sharpFCompilerBSDv3LibC?Everything supported by the C compilerR5RS/R7RSC compilerC compilerYes-YesR5RSNoYesYesNo?Much larger than it seems, it stands at ~105kLOC
STklosVM-InterpreterGPLv2Linux, OSX, Windows, Android (used to work in many others)Everything supported by the C compilerR7RSC compiler, GNU Make, Bohem-GC?, GMPLite?, PCRE?, FFI?, pthreads? (autotools) <- C++ deps!None,Unlikely-No, requires C++, also33R7RSYes?Package manager
TR7VM-InterpreterBSD-0LibCEverything supported by the C compilerR7RSC compilerNoneYes-YesR7RSYesYesYesIn the works??YesYesNeeds workNoStill fresh. Based on TinyScheme
TinySchemeVM-InterpreterBSDv3LibCEverything supported by the C compilerR5RsC compilerNoneYes-YesNoneNo rationals/complexNo hygienic macrosYesYesYesNoVery small34, but lacks in a few areas…
TinyScheme.CTODO
LISP and LISP-like
BoCLTODO
Embedded CLCompiler35, InterpreterLGPLv2Linux, *BSD, Solaris, Android, Windows, OSXx86, sparc, arm[6-8], alpha, powerpcCommon Lisp ANSI X3J12C compiler, GNU Make, libatomic_ops[fn:29], Boehm-GC (autotools)None if built-inYesYesNo, requires C++ (gc)LispYesYesYes, ASDF
Easy-ISLispCompiler36, InterpreterBSDv2Linux, *BSD, OSX, NIXEverything supported by the C compiler?ISLispC compiler, ncurses**37None (ncurses)38LikelyLikelyYes, patched39YesYes
FemtolispTODO
MiniLISPInterpreterPublic DomainLibCEverything supported by the C compiler?MinimalC compilerNoneLikelyYesNoneNoNoNoBasicNoNoProbablyLikelyNoMinimal implementation under 1kLOC
newLISPTODO
TinyLispTODO
uLispTODO
JanetVM-InterpreterMITTODOEverything supported by the C complier?No formal specificationC compiler, MakeNoneYes through Make-Yes40-YesYesYesYesYes?
Lua and Lua-based
LuaVM-InterpreterMITAix, *BSD, Linux, C89, POSIX, Solaris, OSX, WindowsEverything supported by the C compiler?Lua, no formal specificationC compiler, Make41NoneYes-Yes, minor patch-+-??No??YesBasicYesYesLuaRocksNot lispy
FennelTODOMITSame as LuaEverything supported by the C compiler?No formal specification
TCL
TCLVM-InterpreterMITEverything supported by the C compiler?TCLC compilerNoneYes-YesTCLYesYesYesYesNone?
Jim TCLVM-InterpreterBSDv2Everything supported by the C compiler?Most of TCLC compiler, autosetup42NoneYes-YesSome extrasYesYesYesYesNone?
JavaScript
Jerry Script (JS)VM-InterpreterApache v2TODOES6/ES2015 at leastNone-YesThe build system is complex (CMake, scripts…) but it works
MuJSVM-InterpreterISCTODOEverything supported by the C compiler?ES5NoneYes-YesYes
QuickJSVM-Interpreter, CompilerMITTODOEverything supported by the C compiler?ES2023C compilerC compiler for compilationYes-YesYes

Deeper look into selected Scheme implementations

These implementations were chosen because they can be comiled by TCC and they seem to compile to a large number of targets.

ImplementationTypeLicenseArch support(Scheme) StandartLibrary support, SRFIs43SLOCRequires pregenerated filesWeight (RISC-V)DrawbacksAdvantagesComments
Chibi SchemeVM-InterpreterBSDv3C compiler and LibCR7RSQuite a few44~85_00045No, with a catch46237KB47, 1.2MB libchibi.so, 1.7MB static48Cross-compiling is not that straight forward. Not very performantGreat license for reusability
Chicken 5Compiler, InterpreterBSDv3C compiler and LibCR5RS, R7RSQuite a few49~620_00050Yes512.4MB52Requires pregenerated Scheme files, requires GNU MakeGreat license for reusability
GambitCompiler, InterpreterApache v2, LGPLv2.1C compiler, LibC and common OSsR4RS, R5RS, R7RSQuite a few53~1_700_00054Yes55Requires autotools, GNU MakePotentially one of the most complete and performat implementationsCheck which which parts of the library are under LGPL.
OwlVM-InterpreterMITC compiler, LibCSubset R7RSMinimal~20_00056No1.3MB57Not a full R7RS implementation. Very slow, has some compile issues. Unmaintained?Extremely small C core
RibbitVM-InterpreterBSDv3SubsetNone~6_50058Non Scheme files seem to be pregeneratedMinimal bootstrapping implementation
S7VM-Interpreter0-BSDC compiler and LibCR5RS, partial R7RSBasic5982_60560No2.7MB61, 2.0MB static62Compiling to RISC-V staticly is not so simple63. Reduced library supportSmallest implementation by far. Extremely easy to compile. Great license for reusability
TR7VM-Interpreter0-BSDC compiler and LibCR7RSBasic~13_60064No715KB65Very fresh and still unfinished. Still has errors while testing in RISC-VIncredibly small and targets R7RSKeep an eye on it
LISPs
Easy-ISLispCompiler, InterpreterBSDv2C compiler and LibCISLisp-39_00066No843KB67Defined standard. Can compile to C. Great license for reusability. Very small.Keep an eye on it
JanetVM-InterpreterMITC compiler and LibC--31_70068No
Lua
LuaVM-InterpreterMITC compiler, LibC and common OSs--~20_00069No210KB70No defined standardVery smallWorth it compared to Schemes?
TCL
Jim TCLVM-InterpreterBSDv2C compiler, LibC and common OSs--41_20071, 21_000 autosetup72No?1.4MB static73TCL is a bit quirky. Jim is not THE standard TCLTCL is extremely flexible. Core is small. Most tests pass74!
JavaScript
MuJSVM-InterpreterISCC compiler, libCES5-17_00075No172KB76, dynamicaly linkedOlder JS implementation, still fails a few testsIt is standard JS, one of the easiest, most widely used languages
QuickJSVM-Interpreter, CompilerISCC compiler, libCES2023-87_50077No?853KB78

Things that could also be interesting

  • Silex: a lexer gene|ator for R5RS/R7RS implementations. See Github.

Footnotes

Maybe libc_s7.c could be compiled directly into s7?

cloc *.scm
      23 text files.
      23 unique files.                              
       0 files ignored.

github.com/AlDanial/cloc v 1.92  T=1.14 s (20.2 files/s, 130341.3 |ines/s)
------------------------------------------------------------------|------------
Language                     files          blank        comment  |        code
------------------------------------------------------------------|------------
Scheme                          23          12549           5078  |      131062
------------------------------------------------------------------|------------
SUM:                            23          12549           5078  |      131062
------------------------------------------------------------------|------------

Footnotes

  1. A lot of the information presented has been taken by the package support in Debian Sid as of <2022-04-28 Do>.

  2. TCC is the Tiny C compiler. This is an important compiler since it is used in the first stages of the Guile/World bootstrapping system. For more information see Live-bootstrap.

  3. There is this wonderful page that lists all SRFIs and known implementations that supports them.

  4. See this page.

  5. See this page.

  6. Compiled with default flags: -O3 -g3, dynamicly. JUST THE CHIBI EXECUTABLE! Cannot cross-compile cleanly directly as the libraries need to be built by the executable, which does not run natively. In order to fix this, we follow a two step compilation process, see this procedure.

  7. Some tests fail, they are mostly related to mathematical operations having the wrong sign.

  8. Requires a C compiler on the host in order to compile Scheme. It basically translates Scheme into C and compiles it.

  9. R7RS support is added by explicitly including the R7RS egg (Chicken jargon for extension).

  10. It is known to work with the Tiny C Compiler. It would not surprise me if it worked with other “small” compilers.

  11. The dependence on LibC is said to be small, which means it could run on a customised LibC.

  12. Requires the probably non-portable (chicken type) import.

  13. The compiler, as of <2022-05-15 So> does not support UTF-8. However, a major rewrite is taking place that will add it. The UTF-8 egg is what currently provides support.

  14. Requires a C compiler on the host in order to compile Scheme. It basically translates Scheme into C and compiles it.

  15. Requires a C compiler on the host in order to compile Scheme. It basically translates Scheme into C and compiles it.

  16. Can be turned off.

  17. There is the package hall that does it however.

  18. LOC count generated from git on <2022-12-10 Sa>

    fernando@localhost:~/Builds/Guile/guile> cloc . --process=4 --exclude-dir=doc,emacs,examples,bechmark,benchmark-suite,test-suite,gc-benchmarks
        1447 text files.
        1347 unique files.                                          
         101 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=1.15 s (1168.1 files/s, 351669.4 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                              490          23763          17250         144168
    Scheme                         352          12097          22104          93785
    C/C++ Header                   264           7220          10317          32305
    m4                             199           1651           1739          25996
    make                            19           1323           1520           5025
    Bourne Shell                    12            398            635           2556
    Lisp                             2            128             35            507
    awk                              2             76            166            240
    diff                             4             13             43            171
    lex                              1             36             13            147
    Markdown                         1             16              0             41
    YAML                             1              6              0             32
    -------------------------------------------------------------------------------
    SUM:                          1347          46727          53822         304973
    -------------------------------------------------------------------------------
    
  19. See this page.

  20. Requires a C compiler on the host in order to compile Scheme. It basically translates Scheme into C and compiles it.

  21. Seems to have an issue running tests. A second make is required to build it. The error:

    Running tests/ against bin/vm fasl/bootp.fasl: .....................................................................|............................. FAILED
    1c1
    < #true
    ---
    > #false
    ERROR: tests/char-ready.sh
    
  22. Minimal variant.

  23. It uses Chez Scheme at its core.

  24. See this page.

  25. R5RS differences.

  26. touch mus-config.h && tcc -c s7.c -I. && tcc -o repl repl.c s7.o -lm -I. && ./repl ~~May require a patch to enable/force WITH_~GCC~~~ Already fixed <2022-06-25 Sa>.

  27. For multiprecision arithmetic, GMP, MPFR, MPC are needed…

  28. setters are likely to not be portable.

  29. From this mailing list discussion, it seem it does support it but only when entered raw… So a very rudimentary way.

  30. Compiled with $CC s7.c -o s7-riscv -I. -DWITH_MAIN -DWITH_C_LOADER=0 -static -Os -lm -pthread -Wl,-export-dynamic and stripped.

    In order for S7 to be useful with the C library, it needs libc_s7.so. libc_s7.so is generated automatically by S7 when it loads r7rs.scm or libc.scm. It transpiles libc.scm to C producing libc_s7.c. Then it loads cload.scm to compile the generated libc_s7.c into libc_s7.so.

    The technique that is theorised but still not successfully used to cross-compile S7 would be:

    1. Compile S7 natively, for example: gcc s7.c -o s7 -DWITH_MAIN -I. -O2 -g -ldl -lm -Wl,-export-dynamic or tcc -o s7 s7.c -I. -lm -DWITH_MAIN -ldl -rdynamic -DWITH_C_LOADER
      1. -Wl,-export-dynamic is needed! Otherwise some symbols, such as s7_f will not be found and loading libc_s7.so will fail.
    2. Run ./s7 r7rs.scm so that S7 generates libc_s7.c
    3. Compile S7 with a cross-compiler riscv32-buildroot-linux-gnu-gcc s7.c -o s7-riscv -DWITH_MAIN -DWITH_C_LOADER=1 -ldl -static -Os -lm -I. -Wl,-export-dynamic
    4. Cross compile libc_s7.c, for example riscv32-buildroot-linux-gnu-gcc libc_s7.c -o libc_s7.so -shared -rdynamic -DWITH_MAIN -DWITH_C_LOADER=1 -Os -ldl -lm -I. -pthread -Wl,-export-dynamic

    The method described above does not work as symbols are still not found:

    s7: 22-Jun-2022
    load /mnt/s7/libc_s7.so failed: /mnt/s7/libc_s7.so: undefined symbol: s7_f
    
    ;unbound variable (symbol "\x7f;ELF\x01;\x01;\x01;")
    ;    (symbol "\x7f;ELF\x01;\x01;\x01;")
    ;    libc_s7.so, line 1, position: 7
    
    ;unbound variable fileno in (fileno stdin)
    ;    (fileno stdin)
    ;    repl.scm, line 207, position: 6849
    ; (fileno stdin)
    ; ((terminal-fd (fileno stdin)) (tab-as-spa...
    ; ((lambda (hook lst) (when (or (not (proce...
    
    ;unbound variable *repl*
    ; (*repl* 'run)
    ; ((*repl* 'run))
    ; ((lambda (new-size) (unless (= new-size h... ; histsize: 100, histpos: 0
    ;                                              histbuf: #("" "" "" "" ...)
    ;
    
  31. Requires a C compiler on the host in order to compile Scheme. It basically translates Scheme into C and compiles it.

  32. Scheme portable library.

  33. Also

    tcc -DHAVE_CONFIG_H -I. -I. -I./../gc/include -I../gc/include `./get-atomic-ops-flags.sh .. .. --cflags`   -g -Wall -Wextra -Wno-unused-label -fPIC  -c box.c
    In file included from box.c:35:
    In file included from gauche.h:124:
    In file included from ./gauche/float.h:43:
    In file included from /usr/include/complex.h:110:
    /usr/include/bits/cmathcalls.h:55: error: ';' expected (got "cacos")
    make[1]: *** [Makefile:17: box.o] Fehler 1
    
  34. tinyscheme-1.42> cloc .
          15 text files.
           8 unique files.                              
           7 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.04 s (197.4 files/s, 165288.6 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                2            576            256           4370
    C/C++ Header                     4             82             32            568
    Scheme                           1             96             78            542
    make                             1             20             39             39
    -------------------------------------------------------------------------------
    SUM:                             8            774            405           5519
    -------------------------------------------------------------------------------
    
  35. Requires a C compiler on the host in order to compile Scheme. It basically translates Scheme into C and compiles it.

  36. Requires a C compiler on the host in order to compile Scheme. It basically translates Scheme into C and compiles it.

  37. curses support has been recently made optional. Compile with WITHOUT_CURSES. Currently it requires ncurses, however, we may be able to easily patch it out, see this issue.

  38. curses support has been recently made optional. Compile with WITHOUT_CURSES. Currently it requires ncurses, however, we may be able to easily patch it out, see this issue.

  39. The set of patches has been upstreamed. A set of patches to disable nana and “complex.h” are needed. They are basic and simple.

  40. JANET_USE_STDATOMIC=1 has to be enabled within COMMON_CFLAGS. The end result would, therefore, be: make CC=tcc COMMON_CFLAGS="-DJANET_USE_STDATOMIC=1 -std=c99 -Wall -Wextra -Isrc/include -Isrc/conf -fvisibility=hidden -fPIC"

  41. Could easily be taken out

  42. Build system included as part of the source code.

    ~/Builds/jim-tcl/jimtcl/autosetup> cloc .
          19 text files.
          13 unique files.                              
           6 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.59 s (22.0 files/s, 51834.1 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                1           3959           3192          15358
    Bourne Shell                     4            380           1012           4722
    Tcl/Tk                           8            169            605           1184
    -------------------------------------------------------------------------------
    SUM:                            13           4508           4809          21264
    -------------------------------------------------------------------------------
    
  43. There is this wonderful page that lists all SRFIs and known implementations that supports them.

  44. Chibi has a List of supported modules. It has standard SRFIs and Chibi specific ones.

  45. Output from cloc. Cloned from git early may 2022.

    cloc . --exclude-dir=benchmarks,build-lib,contrib,data,js,examples,doc,tests,tools
         594 text files.
         561 unique files.                                          
          39 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=1.00 s (560.0 files/s, 106811.8 lines/s)
    --------------------------------------------------------------------------------
    Language                      files          blank        comment           code
    --------------------------------------------------------------------------------
    Scheme                          494           8187           7951          58099
    C                                46           1806            653          24629
    C/C++ Header                     11            540            373           3357
    make                              1             86             21            427
    CMake                             1            113             65            424
    Markdown                          3             48              0            104
    YAML                              3              9              0             71
    Bourne Again Shell                1              2              2             26
    Bourne Shell                      1              1              0              4
    --------------------------------------------------------------------------------
    SUM:                            561          10792           9065          87141
    --------------------------------------------------------------------------------
    
  46. If Chibi is being compiled staticly, it needs the `clibs.c` file (which can be generated via `make clibs.c`). This file translates all the hand-written Scheme libraries to C so that it can be compiled statictly using `chibi-ffi`, which is a handwritten utility. If no library support is needed, then this is not required.

  47. Compiled with default flags: -O3 -g3, dynamicly. JUST THE CHIBI EXECUTABLE! Cannot cross-compile cleanly directly as the libraries need to be built by the executable, which does not run natively. In order to fix this, we follow a two step compilation process, see this procedure.

  48. Compiled by building first make clibs.c with the local Chibi installation and then compiling with make -B chibi-scheme-static SEXP_USE_DL=0 CFLAGS="-DSEXP_USE_STATIC_LIBS -DSEXP_USE_STATIC_LIBS_NO_INCLUDE=0 -Os -g0". Adding -march=rv32imafd generates a binary of the same size. Executing the static version requires passing the -q flag, for example: CHIBI_IGNORE_SYSTEM_PATH=1 CHIBI_MODULE_PATH=lib ./chibi-scheme-static -q tests/r7rs-tests.scm

  49. Chicken maintains a somewhat outdated (as of <2022-05-15 So>) list of supported SRFIs.

  50. Output from cloc. Version 5.3.0. It includes the pregenerated C files for the bootstrap. This means that the handwritten Scheme files and their translation to C are counted. This may seem unfair, but the Scheme files are written by humans, and therefore count, and the C transpilation is needed by the compiler.

    cloc . --exclude-dir=manual-html,tests,scripts
         244 text files.
         208 unique files.                                          
          41 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=4.20 s (49.5 files/s, 178924.0 lines/s)
    -----------------------------------------------------------------------------------
    Language                         files          blank        comment           code
    -----------------------------------------------------------------------------------
    C                                   90          25984          92662         577108
    Scheme                             109           4697           4309          41229
    C/C++ Header                         1            472            188           2930
    Tcl/Tk                               1            419             60           1446
    Bourne Shell                         2              7             32             41
    make                                 2              5             29             27
    R                                    1              3              0             10
    DOS Batch                            1              0              0              2
    Windows Resource File                1              1              1              1
    -----------------------------------------------------------------------------------
    SUM:                               208          31588          97281         622794
    -----------------------------------------------------------------------------------
    
  51. Some files need to be generated by a previous version. See the Bootstrapping section from the README.

  52. Compiled dynamicly, chicken executable, the csi executable weights 183 KB. In order to cross-compile Chicken, we follow this guide.

  53. The documentation entry is quite outdated as of <2022-05-15 So>. However, Gambit has support for a nice number of SRFIs and can use package managers as documented in the link of the previous sentence.

  54. Output from cloc. Version 4.9.4. It includes the pregenerated C files for the bootstrap. This means that the handwritten Scheme files and their translation to C are counted. This may seem unfair, but the Scheme files are written by humans, and therefore count, and the C transpilation is needed by the compiler.

    cloc . --exclude-dir=bench,bin,contrib,doc,examples,githooks,misc,prebuilt,tests
         739 text files.
         707 unique files.                                          
          51 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=11.10 s (63.7 files/s, 166709.0 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                               69          22583           3802        1464490
    Scheme                         484          34913          18820         231427
    Bourne Shell                    10           2927           2172          17574
    C/C++ Header                    33           3500           1407          15329
    Pascal                           2              2          10432           9184
    m4                               1            767              0           3063
    make                            83            921            123           2984
    C++                             11            319            206           1733
    Qt                               5              1              0           1608
    YAML                             2             56             21            217
    Smalltalk                        1             27             25            194
    Markdown                         2             48              0             64
    JavaScript                       3             21              6             39
    Dockerfile                       1              0              0              6
    -------------------------------------------------------------------------------
    SUM:                           707          66085          37014        1747912
    -------------------------------------------------------------------------------
    
  55. See make bootstrap.

  56. cloc . --exclude-dir=tmp,tests,doc
          86 text files.
          83 unique files.                              
           5 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.11 s (746.7 files/s, 221577.2 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    Scheme                          78           2921           1831          18070
    C                                1             60             41           1389
    make                             1             41             21            135
    Markdown                         1             25              0             69
    sed                              1              0              0             18
    YAML                             1              2              0              6
    -------------------------------------------------------------------------------
    SUM:                            83           3049           1893          19687
    -------------------------------------------------------------------------------
    
  57. Compiled with make CC=gcc CFLAGS="-Os -static", not stripped.

  58. cloc . --exclude-dir=docs,bench  --fullpath --not-match-d="/*prebuilt" --exclude-lang=OCaml,Scala,Haskell,Rust,Idris,JavaScript,Java,Python,Go
         114 text files.
          88 unique files.                              
          37 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.12 s (681.6 files/s, 76586.0 lines/s)
    --------------------------------------------------------------------------------
    Language                      files          blank        comment           code
    --------------------------------------------------------------------------------
    Scheme                           44           1028            898           4460
    Bourne Shell                     10             71             33            724
    C                                 1            136             37            649
    Lua                               1             42             24            284
    make                             16             35             14            275
    Markdown                          2             46              0             95
    HTML                              1              0              0             10
    JSON                              1              0              0              6
    CMake                             1              2              0              4
    Bourne Again Shell                1              0              0              2
    Ruby                              1              0              0              2
    --------------------------------------------------------------------------------
    SUM:                             79           1360           1006           6511
    --------------------------------------------------------------------------------
    
  59. S7 by default is a small language. However, it does support some of the more important extensions and it could use some external SRFIs to expand its library.

  60. Output from cloc. Core implementation is s7.c s7.h. Cloned from git early may 2022.

    cloc s7.c s7.h 
           2 text files.
           2 unique files.                              
           0 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.85 s (2.4 files/s, 113773.1 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                1           8990           3625          82605
    C/C++ Header                     1            137            584            509
    -------------------------------------------------------------------------------
    SUM:                             2           9127           4209          83114
    -------------------------------------------------------------------------------
    
  61. REPL binary compiled with GCC for RISC-V, dynamic linking to LibC.

  62. Compiled with $CC s7.c -o s7-riscv -I. -DWITH_MAIN -DWITH_C_LOADER=0 -static -Os -lm -pthread -Wl,-export-dynamic and stripped.

    In order for S7 to be useful with the C library, it needs libc_s7.so. libc_s7.so is generated automatically by S7 when it loads r7rs.scm or libc.scm. It transpiles libc.scm to C producing libc_s7.c. Then it loads cload.scm to compile the generated libc_s7.c into libc_s7.so.

    The technique that is theorised but still not successfully used to cross-compile S7 would be:

    1. Compile S7 natively, for example: gcc s7.c -o s7 -DWITH_MAIN -I. -O2 -g -ldl -lm -Wl,-export-dynamic or tcc -o s7 s7.c -I. -lm -DWITH_MAIN -ldl -rdynamic -DWITH_C_LOADER
      1. -Wl,-export-dynamic is needed! Otherwise some symbols, such as s7_f will not be found and loading libc_s7.so will fail.
    2. Run ./s7 r7rs.scm so that S7 generates libc_s7.c
    3. Compile S7 with a cross-compiler riscv32-buildroot-linux-gnu-gcc s7.c -o s7-riscv -DWITH_MAIN -DWITH_C_LOADER=1 -ldl -static -Os -lm -I. -Wl,-export-dynamic
    4. Cross compile libc_s7.c, for example riscv32-buildroot-linux-gnu-gcc libc_s7.c -o libc_s7.so -shared -rdynamic -DWITH_MAIN -DWITH_C_LOADER=1 -Os -ldl -lm -I. -pthread -Wl,-export-dynamic

    The method described above does not work as symbols are still not found:

    s7: 22-Jun-2022
    load /mnt/s7/libc_s7.so failed: /mnt/s7/libc_s7.so: undefined symbol: s7_f
    
    ;unbound variable (symbol "\x7f;ELF\x01;\x01;\x01;")
    ;    (symbol "\x7f;ELF\x01;\x01;\x01;")
    ;    libc_s7.so, line 1, position: 7
    
    ;unbound variable fileno in (fileno stdin)
    ;    (fileno stdin)
    ;    repl.scm, line 207, position: 6849
    ; (fileno stdin)
    ; ((terminal-fd (fileno stdin)) (tab-as-spa...
    ; ((lambda (hook lst) (when (or (not (proce...
    
    ;unbound variable *repl*
    ; (*repl* 'run)
    ; ((*repl* 'run))
    ; ((lambda (new-size) (unless (= new-size h... ; histsize: 100, histpos: 0
    ;                                              histbuf: #("" "" "" "" ...)
    ;
    
  63. Compiling staticly does not work out of the box. It needs to then run repl libc.scm which generates a libc_s7.c file and tries compiling it to a libc_s7.so file which it then loads. However, in a embedded RISC-V we do not have a working C compiler… Compiling it dynamicly does not seem to work out of the box either. Need to ask the authors.

  64. Version 0.3.1

    cloc . --exclude-dir=tests,examples
          14 text files.
           8 unique files.                              
           8 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.19 s (41.4 files/s, 97154.8 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                1           1474           1975          11819
    Scheme                           5            272            606           1027
    C/C++ Header                     1            124            659            711
    make                             1             26              2             89
    -------------------------------------------------------------------------------
    SUM:                             8           1896           3242          13646
    -------------------------------------------------------------------------------
    
  65. Compiled with -Os -g0 -static and stripped.

  66. The patch has been upstreamed. Patched out nana and fixed TCC build.

    fernando@localhost:~/Builds/Easy-ISLisp/eisl> cloc . --exclude-dir=example,tests,verify,documents,bench,nana-mv
         146 text files.
         138 unique files.                                          
          10 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.17 s (820.2 files/s, 270043.7 lines/s)
    ---------------------------------------------------------------------------------------
    Language                             files          blank        comment           code
    ---------------------------------------------------------------------------------------
    C                                       60           2693           1055          26234
    Lisp                                    34           1154            973           7848
    C/C++ Header                            33            265             83           3124
    Markdown                                 2            122              0            433
    HTML                                     1             29              0            311
    make                                     3             36             10            304
    Windows Module Definition                1              0              1            286
    Assembly                                 1              0             12            171
    D                                        2              8              2             96
    diff                                     1             12             91             84
    ---------------------------------------------------------------------------------------
    SUM:                                   138           4319           2227          38891
    ---------------------------------------------------------------------------------------
    
  67. Default compile options (-O3 -lto) with -static and stripped.

  68. LOC count generated from git checkout on 2024-02-11

    fernando@localhost:~/Dirt/janet> scc --exclude-dir=examples,test,tools
    ───────────────────────────────────────────────────────────────────────────────
    Language                 Files     Lines   Blanks  Comments     Code Complexity
    ───────────────────────────────────────────────────────────────────────────────
    C                           46     34620     2427      2774    29419       5102
    C Header                    13      3419      446       667     2306        125
    YAML                         6       259       20         0      239          0
    Markdown                     3      1364      182         0     1182          0
    Meson                        2       345        8        23      314          3
    Batch                        1       180       28         0      152         15
    Janet                        1      4281      125        61     4095         80
    License                      1        19        3         0       16          0
    Makefile                     1       415       63        61      291         22
    SVG                          1        11        1         0       10          0
    gitignore                    1       154       32        34       88          0
    ───────────────────────────────────────────────────────────────────────────────
    Total                       76     45067     3335      3620    38112       5347
    ───────────────────────────────────────────────────────────────────────────────
    Estimated Cost to Develop (organic) $1,235,122
    Estimated Schedule Effort (organic) 14.90 months
    Estimated People Required (organic) 7.36
    ───────────────────────────────────────────────────────────────────────────────
    Processed 1592052 bytes, 1.592 megabytes (SI)
    ───────────────────────────────────────────────────────────────────────────────
    
  69.  cloc .
          73 text files.
          70 unique files.                              
          42 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.32 s (218.0 files/s, 134655.6 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                               34           3259           3769          17327
    HTML                             3           3949             11           9013
    C/C++ Header                    28           1354           1492           2534
    make                             2             65             38            225
    CSS                              3             34              0            169
    -------------------------------------------------------------------------------
    SUM:                            70           8661           5310          29268
    -------------------------------------------------------------------------------
    
  70. Compiled with CFLAGS="-Os -static -fPIC" and stripped.

  71. This includes some modules that could be taken out.

    cloc . --exclude-dir=example.api,example.ext,freebsd,examples,sqlite3,tests,tools,jsmn,autosetup
         113 text files.
          86 unique files.                              
          28 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.52 s (165.1 files/s, 102332.6 lines/s)
    ---------------------------------------------------------------------------------------
    Language                             files          blank        comment           code
    ---------------------------------------------------------------------------------------
    C                                       44           3965           5545          26287
    HTML                                     1            108              0           9263
    Tcl/Tk                                  19            330            554           2321
    C++                                      1            443            162           1671
    C/C++ Header                            10            233            586            930
    Windows Module Definition                1             60              0            570
    Bourne Shell                             4             19             54             97
    IDL                                      1              0              0             34
    YAML                                     2              0              0             28
    XML                                      1              0              0             11
    make                                     1              8             10             11
    m4                                       1              0              0              3
    ---------------------------------------------------------------------------------------
    SUM:                                    86           5166           6911          41226
    ---------------------------------------------------------------------------------------
    
  72. Build system included as part of the source code.

    ~/Builds/jim-tcl/jimtcl/autosetup> cloc .
          19 text files.
          13 unique files.                              
           6 files ignored.
    
    github.com/AlDanial/cloc v 1.92  T=0.59 s (22.0 files/s, 51834.1 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C                                1           3959           3192          15358
    Bourne Shell                     4            380           1012           4722
    Tcl/Tk                           8            169            605           1184
    -------------------------------------------------------------------------------
    SUM:                            13           4508           4809          21264
    -------------------------------------------------------------------------------
    
  73. Compiled with CC=riscv32-buildroot-linux-gnu-gcc CFLAGS="-static -Os -g0" ./configure --utf8 --math --disable-lineedit. It can be made smaller if modules are disabled and if it is stripped.

  74. The results are great. And some errors come because of dynamic modules, which will always fail with this system.

    root@buildroot:/mnt/jimtcl# LD_LIBRARY_PATH="/mnt/jimtcl:$(LD_LIBRARY_PATH)" ./jimsh "/mnt/jimtcl/tests/runall.tcl"
    [...]
    =========================================================================
              Totals: Total  5462   Passed  5276  Skipped   176  Failed    11
    
  75. LOC count generated from version 1.3.4

    fernando@localhost:~/Dirt/mujs-1.3.4> scc . --exclude-dir=test262
    ───────────────────────────────────────────────────────────────────────────────
    Language                 Files     Lines   Blanks  Comments     Code Complexity
    ───────────────────────────────────────────────────────────────────────────────
    C                           28     15789     1718       346    13725       2901
    C Header                     7      3431      191        74     3166          3
    HTML                         5      1159      266         0      893          0
    CSS                          1        40        2         0       38          0
    JavaScript                   1       152       17        26      109         29
    License                      1        16        4         0       12          0
    Makefile                     1       170       31         3      136          1
    Python                       1        79        5         2       72          7
    gitignore                    1        12        2         3        7          0
    ───────────────────────────────────────────────────────────────────────────────
    Total                       46     20848     2236       454    18158       2941
    ───────────────────────────────────────────────────────────────────────────────
    Estimated Cost to Develop (organic) $567,043
    Estimated Schedule Effort (organic) 11.09 months
    Estimated People Required (organic) 4.54
    ───────────────────────────────────────────────────────────────────────────────
    Processed 458440 bytes, 0.458 megabytes (SI)
    ───────────────────────────────────────────────────────────────────────────────
    
  76. Dynamically linked, stripped, optimization at -Os

  77. LOC count generated from version 2024-01-13

    fernando@localhost:~/Dirt/quickjs-2024-01-13> scc . --exclude-dir=tests,examples
    ───────────────────────────────────────────────────────────────────────────────
    Language                 Files     Lines   Blanks  Comments     Code Complexity
    ───────────────────────────────────────────────────────────────────────────────
    D                           18        23        0         0       23          0
    C                           14     85740     3309      1934    80497       8013
    C Header                    12      7752      430       438     6884         93
    Plain Text                   3         9        0         0        9          0
    HTML                         2      2144      179        52     1913          0
    JavaScript                   2      4247      270       172     3805       1013
    Shell                        2       199       64        15      120         21
    License                      1        22        4         0       18          0
    Makefile                     1       487       87        53      347          1
    ───────────────────────────────────────────────────────────────────────────────
    Total                       55    100623     4343      2664    93616       9141
    ───────────────────────────────────────────────────────────────────────────────
    Estimated Cost to Develop (organic) $3,173,313
    Estimated Schedule Effort (organic) 21.33 months
    Estimated People Required (organic) 13.22
    ───────────────────────────────────────────────────────────────────────────────
    Processed 3365448 bytes, 3.365 megabytes (SI)
    ───────────────────────────────────────────────────────────────────────────────
    
  78. Compiled dynamically using make CROSS_PREFIX=riscv64-suse-linux-, stripped with LTO enabled by default.