Presentation
STklos (pronounced /ˈɛs.’ti.kl’ɔss/) is a free Scheme system mostly compliant with the language features defined in R⁷RS small. The aim of this implementation is to be fast as well as light. The implementation is based on an ad-hoc Virtual Machine.
The salient points of STklos are:
- an efficient and powerful object system based on CLOS
(Common Lisp Object System) providing
- Multiple Inheritance,
- Generic Functions,
- Multi-methods
- an efficient MOP (Meta Object Protocol)
- a simple to use module system, as well as R⁷RS libraries
- a full Numerical tower, as defined in R⁷RS,
- a simple FFI (Foreign Function Interface),
- an easy connection to the GTK+ toolkit,
- a Perl compatible regular expressions thanks to the PCRE package,
- Unicode support,
- native threads built on top of Posix threads,
- Tail Call Optimization, as required by R⁷RS,
- Support for a large number of SRFIs.
Latest News
Version “2.10” released 2024-10-10
This version of STklos mostly enhances the 2.00 version released a year ago. As usual, this version could not have be finalized without the help of Jeronimo Pellegrini (@jpellegrini).
Contributors for this version:
- Akinori Hattori (@hattya)
- Jeronimo Pellegrini (@jpellegrini)
Enhancements:
- Corrected the result of
stklos-config --compile
- Added the second (optional) parameter to R7RS
load
(andtry-load
) - Enhanced various things about STklos compilation/installation
- Added information in the summary of configuration script
- Builds are now reproducible
- FFI support can be completely disabled, if needed.
- Updated GTklos, the GTK+ extension
- Optimize
expt
primitive. - Avoid unneeded boxing of numbers in the
+
,-
,*
and/
operations - Added
!
as a shell escape under the REPL - Added statistics to the VM
- Permit to build STklos with the
tcc
C compiler. - Added an simple hybrid (C and Scheme) module in the examples directory
- Correct/enhance implementation of numerical functions in some corner cases (in particular with NaNs and infinities).
- Added an API to add expressions rewriting rules before their compilation.
- Location given in error message is more precise
- Error messages don’t loop anymore when displaying circular structures
- Added
list-set!
as the setter function oflist-ref
- Added the number of allocations and collections to the output of the
time
form - Added special instructions in the VM for
member
,memq
andmemv
- Added special instructions in the VM for
assoc
,assq
andassv
- Do constant folding before in-lining usual functions
- Better UTF-8 support and updated Unicode tables to version 16.0.0
- Enhance the
apropos
primitive - New REPL variables:
@*
,@1
,@2
,@3
,@4
and@5
- New REPL commands:
time
,describe
,expand
,import
,require-feature
,open
,browse
,manual
,apropos
- Documentation of a function can be accessed directly into the HTML Reeference Manual
- Length of symbols is no more limited.
New primitives / parameters:
read-ci
eval-form-string-ci
read-from-sring-ci
compiler:source-rewrite
compiler:peephole-optimizer
1+
and1-
push!
andpop
inc!
anddec!
dolist
apropos/alist
apropos/pp
default-browser
open-in-browser
manual
install-path
define-parameter
Updated embedded libraries
libgc
updated to version 8.2.8libffi
updated to version 3.4.6libpcre2
updated to version 10.44
New supported SRFI
- SRFI-115: Scheme Regular Expressions
- SRFI-178: Bitvector library
- SRFI-232: Flexible curried procedures
Misc:
- Updated documentation
- Added tests
- Code cleaning an optimizations
- Bug fixes
Version “2.00” released 2023-09-12
This is a major version of STklos, bringing it from R5RS to R7RS. It is the fruit of nearly two years of development with the help of the following persons (in alphabetical order):
- Amirouche Boubekki (@amirouche)
- Lassi Kortela (@lassik)
- Ivan Maidanski (@ivmai)
- Tom Niget (@zdimension)
- Jeronimo Pellegrini (@jpellegrini)
- Ryan Schmidt (@ryandesign)
- Ben Taca (@bentaca)
- Robby Zambito (@Zambito1)
The main changes in this version are:
- Support for R⁷RS libraries
- Macro system has been rewritten
- Support for ScmPkg packages has been suppressed
- New options for the commands stklos(1) and stklos-compile(1)
- Optimizations on numerical operations
- Documentation is rewritten in
asciidoctor
and has been greatly enhanced - Updated the Docker build files
- New instructions in the VM
- Fixed some issues in the compilation/installation procedure
- New extension:
curl
to access the multiprotocol file transfer library - Better support for macOS
describe
has been enhanced for some type of objects- REPL has now tab completion
- Bash and zsh completions for
stklos
andstklos-compile
commands - Better
SLIB
support - Use PCRE2 library instead of legacy PCRE
- New-command
stklos-pp(1)
- Better error messages
- New SRFIS supported
- SRFI-19: Time Data Types and Procedures
- SRFI 43: Vector Library
- SRFI-95: Sorting and Merging
- SRFI 116: Immutable List Library
- SRFI 125: Intermediate hash tables
- SRFI-138: Compiling Scheme programs to executables
- SRFI 152: String Library (reduced)
- SRFI-162: Comparators sublibrary
- SRFI 154: First-class dynamic extents
- SRFI-215: Central Log Exchange
- SRFI 217: Integer Sets
- SRFI 222: Compound objects
- SRFI 224: Integer Mappings
- SRFI-227: Optional Arguments
- SRFI 228: Composing Comparators
- SRFI-229: Tagged Procedures
- SRFI-230: Atomic Operations
- SRFI 235: Combinators
- SRFI 236: Evaluating expressions in an unspecified order
- SRFI-238: Codesets
- SRFI 244: Multiple-value Definitions
- Added support for some R7RS-large libraries
- supported libraries of the Red edition are
(scheme bytevector)
(scheme box)
(scheme charset)
(scheme comparator)
(scheme generator)
(scheme hash-table)
(scheme ideque)
(scheme ilist)
(scheme list)
(scheme list-queue)
(scheme lseq)
(scheme set)
(scheme sort)
(scheme stream)
(scheme text)
(scheme vector)
- supported libraries of the Tangerine edition are
(scheme bitwise)
(scheme bytevector)
(scheme division)
(scheme fixnum)
(scheme flonum)
(scheme generator)
(scheme vector @)
- supported libraries of the Red edition are
- New primitives
library-name
library-list
module-list
module-lock!
module-locked?
symbol-mutable?
define-constant
cpointer-null?
syntax-error
hash-table-clear!
environement
send-signal
set-signal-handler!
get-signal-handler
void?
procedure-source
procedure-formals
short-version
radians->degrees
degrees->radians
sinh
,cosh
, …
- New compiler options (also parameter objects):
compiler:gen-line-number
compiler:show-assembly-code
compiler:time-display
compiler:keep-formals
compiler-keep-source
compiler:inline-common-functions
compiler:unroll-iterations
repl-show-startup-message
- New predefined classes
<uvector>
<bytevector>
<hash-table>
<port>
<input-port>
<output-port>
- Code cleaning an optimizations
- Added tests
- Bug fixes
Version “1.70” released 2021-11-25
This version further improves compliance with R7RS and brings some new SRFIs
The main changes in this version are:
- Added the some comma-commands to the REPL (,pwd ,cd and ,shell)
- Use system Posix glob instead of the provided gnu-glob
- Improved reader (
|.|
is wow valid symbol as well as numbers with bars) - New primitive/syntaxes
tagbody
repeat
keyword-colon-position
is a parameter object specifying the places where the colon can be used in keyword.
- Suppressed the calls to insecure C function (such as
strcpy
orstrcat
) - List reading is tail recursive now
- Added an extension directory, which contains for now:
- GTKlos which gives access to the GTK+ toolkit using the OO layer available in STklos. This version uses the GTK+3 toolkit. It also defines a canvas widget. if the to have the goocanvas library is installed.
- an extension which permits to make a file system in Scheme, using FUSE (Filesystem in Userspace).
- Use gmp-mini (which is provided) if gmp is not available, instead of our version which was based on old unmaintained version of mpi.
- Support of new SRFIs:
- SRFI-25: Multi-dimensional Arrays
- SRFI-27: Source of random bits
- SRFI-29: Localization
- SRFI-94: Type-Restricted Numerical Functions
- SRFI-132: Sort Libraries
- SRFI-133: Vector Library (R7RS-compatible)
- SRFI-143: Fixnums
- SRFI-144: Flonums
- SRFI-170: POSIX API
- SRFI-208: NaN procedures
- SRFI-214: Flexvectors
- SRFI-217: Integer Sets
- SRFI-219: Define higher-order lambda
- SRFI-223: Generalized binary search procedures
- SRFI can be implemented in C and Scheme
- Various optimizations
- Documentation update
- Added tests
- Bug fixes