Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matijapretnar/millet
A ML-like pure functional language that can be used as a template for creating your own language
https://github.com/matijapretnar/millet
Last synced: 19 days ago
JSON representation
A ML-like pure functional language that can be used as a template for creating your own language
- Host: GitHub
- URL: https://github.com/matijapretnar/millet
- Owner: matijapretnar
- Created: 2021-01-08T11:48:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-09T17:32:05.000Z (over 1 year ago)
- Last Synced: 2024-08-05T15:06:39.751Z (3 months ago)
- Language: OCaml
- Homepage: https://matija.pretnar.info/millet/
- Size: 4.42 MB
- Stars: 26
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Millet
Do you, like me, test theoretical programming language concepts by building your own programming language? Do you, like me, do it by copying and modifying your most recent language because you are too lazy to build everything from scratch? Do you, like me, end up with a mess? Then Millet is for you. It is a pure ML-like language with simple and modular codebase that you can use as a template for your next language.
## How to install and run Millet?
Install dependencies by
opam install menhir ocaml-vdom ocamlformat
and build Millet by running (requires OCaml >= 4.14.0)
make
and you can clean up by running
make clean
Millet gives you two options to run programs:
- The first option is a web interface, accessible at `web/index.html`, which allows you to load one of the built-in examples or enter your own program, and then interactively click through all its (non-deterministic and asynchronous) reductions or introduce external interrupts. The web interface is also available at .
- The second option is a command line executable run as
./cli.exe file1.mlt file2.mlt ...
which loads all the commands in all the listed files and starts evaluating the given program, displaying all outgoing signals and the terminal configuration (if there is one). Non-deterministic reductions are chosen randomly and there is no option of introducing external interrupts. If you do not want to load the standard library, run Millet with the `--no-stdlib` option.
## How to use Millet as a template?
The easiest way is to first create an empty repository:
mkdir the-best-language
cd the-best-language
git initNext, add Millet's remote repository:
git remote add millet [email protected]:matijapretnar/millet.git
git fetch milletThen, create two branches, one for your main development and one for tracking Millet:
git branch --no-track main millet/main
git branch --track millet millet/main
git checkout mainNow, each time Millet updates, you can run
git checkout millet
git pull
git checkout main
git merge milletto pull latest changes and merge them into your main development.
## Why the name Millet?
Millet uses fine-grain call-by-value core calculus, and there is no finer grain than [millet](https://en.wikipedia.org/wiki/Millet). Plus, the `.mlt` extension fits nicely into the ML family.