Paradigm | multi-paradigm, concurrent, functional |
---|---|
Designed by | Joseph Wayne Norton |
Developer | Joseph Wayne Norton |
First appeared | 2013 |
Stable release |
v0.5.4 / 12 May 2014
|
Typing discipline | dynamic, strong |
Scope | lexical |
License | MIT License |
Filename extensions | .scm, .erl |
Website | the-concurrent-schemer |
Influenced by | |
Erlang, Common Lisp, MACLISP, Scheme, Elixir, Clojure, Hy | |
Influenced | |
Joxa |
CSCM (The Concurrent Schemer) is an implementation of the Scheme programming language built on top of the Erlang virtual machine (BEAM). CSCM combines the sequential programming model of Scheme with the concurrent, distributed, and fault-tolerant programming model of Erlang.
By leveraging the Erlang language, CSCM can target a concise, precise specification of the Scheme language. Consequently, by leveraging the Erlang VM, CSCM can target a performant, robust implementation of the Scheme language. The default language is Scheme R7RS and the default virtual machine is Erlang/OTP 17 or higher. Scheme R5RS is available as a Scheme library.
CSCM builds on top of Erlang in order to provide a Scheme syntax for writing distributed, fault-tolerant, soft real-time, non-stop applications. CSCM also extends Erlang to support meta-programming with hygenic macros and an improved developer experience with a feature-rich REPL.
Joseph Wayne Norton announced the first release of CSCM on GitHub in March 2013. This release of CSCM was very limited: it did not handle recursive letrec
s, binary
s, receive
, or try
;.
CSCM is aimed as an:
Joseph Wayne Norton has stated that there were a number of reasons why he started the CSCM project:.
Being a Scheme, CSCM is an expression-oriented language. Unlike non-homoiconic programming languages, Lisps make no or little syntactic distinction between "expressions" and "statements": all code and data are written as expressions. CSCM brought homoiconicity to the Erlang VM.
The cons function actually accepts any two values, not just a list for the second argument. When the second argument is not empty and not itself produced by cons, the result prints in a special way. The two values joined with cons are printed between parentheses, but with a dot (i.e., a period surrounded by whitespace) in between:
Thus, a value produced by cons is not always a list. In general, the result of cons is a pair. The more traditional name for the cons? function is pair?
The Erlang operators are used in the same way. The expression
evaluates to 42. Unlike functions in Erlang, arithmetic operators in scheme are variadic (or n-ary), able to take any number of arguments.