Tin is a lisp implemented in rust. 🚨 Warning 🚨 Currently tin
is not close
to being ready for running in production. Expect bugs and a subpar UX (for now).
Currently it can only be run from source. Assuming you have rlwrap
installed,
build the rust project,
$ cargo build --release
and execute it by running ./tin
.
- Hash maps
- standard hash map functions
- Vectors
- standard hash vector functions
- Standard "functional programming functions"
- macros
- variadic arguments
Although Tin is mainly based of the Scheme dialect, it does present some differences with scheme.
Instead of using the #( ... )
syntax for vectors, the [ ... ]
is used in Tin. This is inspired
in Clojure and other (non lisp) programming languages like Python.
Tin provides a hash map datatype that can be created by using the make-hash
function on a
sequence of key-value pairs, or by using the hash construct { ... }
. For example:
(define my-map { 'a 1 'b 2 })
In Tin the notion of (hash)map and vector is interpreted as a mapping from the index space to the
value space. Therefore, both hash
and vector
values can be evaluated on its indices:
> ({ 'a 1 'b 2 } 'a)
1
> (['a 'b 'c] 2) ; vectors are 0-indexed *this might change in the future*
b
Macros in Tin are defined using the defmacro
function:
(defmacro defn (name args body)
`(define ,name (lambda ,args ,body)))
(defn plus-1 (x) (+ 1 x))