Re:Show HN: The Milho Language
by celso_ on Tuesday October 19, 2021 @12:46PM
(#28920233)
Thank you! It's being quite a fun experience for me!
Most of the features are inspired by racket (we've never used a LISP before starting the project, and a friend of mine suggested to use it). Right now we have:
- Numbers (rationals) and arithmetic operations
- Strings and some basic operations like split and concatenation
- Error raising/handling via the raise and call-with-error-handler special forms
- Anonymous (via fn) and named (via defn) functions, both single-arity, variadic, and multi-arity
- Definitions via the def special form (replaces the whole reference in the variable table)
- Local definitions via the let special form
- Mutation via the set! special form (gets the reference, replaces its value)
- Local state mutation via a combination of let + set!
- A simple macro system that only handles basic variable replacing and spreading of lists
- cons/car/cdr as it's a LISP after all
- Boolean operators and a `if` special form
- A simple import system that we're working on right now
There are some examples of functions built with the language inside the `std/` folder, I've created `map`, `filter`, `foldl`, `foldr`, and a mutable list using the functions, and `or`, `and` and `guard` macros using the macro system.
Most of the features are inspired by racket (we've never used a LISP before starting the project, and a friend of mine suggested to use it). Right now we have: - Numbers (rationals) and arithmetic operations - Strings and some basic operations like split and concatenation - Error raising/handling via the raise and call-with-error-handler special forms - Anonymous (via fn) and named (via defn) functions, both single-arity, variadic, and multi-arity - Definitions via the def special form (replaces the whole reference in the variable table) - Local definitions via the let special form - Mutation via the set! special form (gets the reference, replaces its value) - Local state mutation via a combination of let + set! - A simple macro system that only handles basic variable replacing and spreading of lists - cons/car/cdr as it's a LISP after all - Boolean operators and a `if` special form - A simple import system that we're working on right now
There are some examples of functions built with the language inside the `std/` folder, I've created `map`, `filter`, `foldl`, `foldr`, and a mutable list using the functions, and `or`, `and` and `guard` macros using the macro system.