I forked the "Roy" project because the original dev gave up and I would like to use it as a hands on learning tool for learning type inference and structural typing. I also would like to use it to learn how does a language like ocaml combine imperative concepts (Such as loops and references) while still being a functional language.
- No
doblock/Monads - Function currying (Default lazy evaluation)
- Structural typing
- Cli Improvements
- Modules (Not as code blocks but as Files, like in ecmascript6+)
- Proper error messages
- Formatter/Pretty printer (WIP)
- Include files
- Pattern matching
- Typed external functions
- Annotations
- Operator overloading
- Mutability (Using References)
- Custom stdlib
- Build binaries (Using QuickJS as the runtime)
- Let in expression
open Std.Printf
open Std.List ((:), map, filter)
open Std.Pipe ((|>))
let main () =
1:2:3:4:5:[]
|> map (\x -> x * 2)
|> filter (\x -> x > 2)
|> Printf.printlnIn the project to compile and run without issues please make sure the following are installed and available on your path.
- NodeJS
- QuickJS
Run the following steps in sequence
$ git clone https://github.com/hexaredecimal/Llaml.git
$ cd Llaml
$ npm install
$ make || make clean && make dist
$ ./llml helpContributions are welcome and be mindful that this is a fork of project that is greater than 12 years. The JS standard is so 2013 (using var, instead of let and const).
Archived Roy - This repository was archived by the owner on Nov 23, 2017. It is now read-only.
Imperative to Functional Programming Succinctly
Functional Programming in OCaml
Learning F# by Designing Your Own Language by Oleksii Holub | JetBrains