Minimal ML like language written in C11
Go to file
Francesco Magliocca 7dac4b66d3 Fix some parser errors 2022-05-17 21:33:36 +02:00
examples Add an example and the kak script 2022-05-17 21:33:25 +02:00
extra Add an example and the kak script 2022-05-17 21:33:25 +02:00
include Fix some parser errors 2022-05-17 21:33:36 +02:00
ref_parser First commit, with parser 2022-05-17 18:44:40 +02:00
src Fix some parser errors 2022-05-17 21:33:36 +02:00
.gitignore First commit, with parser 2022-05-17 18:44:40 +02:00
Makefile First commit, with parser 2022-05-17 18:44:40 +02:00
README.md Fix some parser errors 2022-05-17 21:33:36 +02:00

README.md

milly

milly is an hobby, and should not be taken seriously.

Interpreter for a Minimal ML-like language whose ideal goal is to be used for bootstrapping compilers and interpreters.

How to build

milly's interpreter is written in portable ISO C11, sources are in src/ and header files are in include/.

If your system happens to have a make implementation compatible with GNU Make, you can just run:

make

Otherwise, something like this should work:

$(CC) -std=c11 -o milly -Iinclude/ src/*.c

The language

milly is a minimal dialect of Standard ML and Haskell, here is a list of the features (or better, limitations) I want to introduce:

  • Keep the implementation <5000 LOC
  • Eager evaluation (call by value)
  • Algebraic Datatypes (pretty useful for representing syntax trees)
  • First class functions
  • Pattern patching (pretty useful for analyzing syntax trees)
  • Integers, booleans, strings
  • Mutable ref cell
  • FFI to C
  • Polymorphic types à la Hindley Milner (probably unfeasible)
  • Automatic currying of functions, with optimised partial evaluation (unfeasible)
  • Delimited continuations (this is an overkill)
  • Easy syntax allowing easy kakoune support

milly's full grammar is specified as a pair of lex and yacc files in ref_parser/.

kakoune plugin for milly is in extra/milly.kak.