2017-09-09 18:39:51 +00:00
|
|
|
# dst
|
2017-02-09 20:02:59 +00:00
|
|
|
|
2017-09-09 18:39:51 +00:00
|
|
|
[![Build Status](https://travis-ci.org/bakpakin/dst.svg?branch=master)](https://travis-ci.org/bakpakin/dst)
|
2017-06-25 23:56:17 +00:00
|
|
|
|
2018-01-12 15:41:27 +00:00
|
|
|
dst is a functional programming language and vm. It is a variant of
|
2017-04-25 22:22:43 +00:00
|
|
|
Lisp with several native useful datatypes. Some of the more interesting and
|
|
|
|
useful features are first class functions and closures, immutable and mutable
|
|
|
|
hashtables, arrays, and bytebuffers, macros (NYI), tail-call optimization,
|
2018-01-12 15:41:27 +00:00
|
|
|
and continuations (coroutines, error handling). The runtime and
|
2018-01-24 22:59:00 +00:00
|
|
|
compiler are written in C99.
|
2017-04-25 22:22:43 +00:00
|
|
|
|
2017-07-02 02:46:56 +00:00
|
|
|
There is a repl for trying out the language, as well as the ability
|
2017-04-25 22:22:43 +00:00
|
|
|
to run script files. This client program is separate from the core runtime, so
|
2017-09-09 18:39:51 +00:00
|
|
|
dst could be embedded into other programs.
|
2017-04-25 22:22:43 +00:00
|
|
|
|
2018-01-12 15:41:27 +00:00
|
|
|
## Features
|
|
|
|
|
2018-01-24 22:59:00 +00:00
|
|
|
* First class closures
|
|
|
|
* Garbage collection
|
|
|
|
* Lexical scoping
|
|
|
|
* First class green threads (continuations)
|
|
|
|
* Mutable and immutable arrays (array/tuple)
|
|
|
|
* Mutable and immutable hashtables (table/struct)
|
|
|
|
* Mutable and immutable strings (buffer/string)
|
|
|
|
* Byte code interpreter with an assembly interface, as well as bytecode verification
|
|
|
|
* Proper tail calls for functional code
|
|
|
|
* Direct interop with C
|
|
|
|
* REPL (read eval print loop)
|
|
|
|
|
|
|
|
The code can be compiled to be either a bytecode interpreter and runtime, or
|
|
|
|
a full language.
|
2018-01-12 15:41:27 +00:00
|
|
|
|
2017-04-25 22:22:43 +00:00
|
|
|
## Compiling and Running
|
|
|
|
|
2018-01-19 17:37:37 +00:00
|
|
|
To build the runtime and run test, run
|
2017-04-25 22:22:43 +00:00
|
|
|
```sh
|
2018-01-19 17:37:37 +00:00
|
|
|
make test
|
2017-04-25 22:22:43 +00:00
|
|
|
```
|
|
|
|
|
2018-01-19 17:37:37 +00:00
|
|
|
A repl can also be run with
|
|
|
|
```sh
|
|
|
|
make repl
|
2017-04-25 22:22:43 +00:00
|
|
|
```
|