Modified language grammar
Tests' description and known bugs
- Function calls should be Ocaml-like. [Work in progress.]
- Expressions with infix operators always have to be enclosed in brackets.
- Static-typing with type signatures.
- Static bindings.
- #enable statements which modify the behaviour of the interpreter.
- C++ style garbage collector based on shared pointers.
- eval* functions evaluate expressions.
- apply* functions apply functions to elements and returns the result.
- trans* functions modify the environment.
- to*From* functions perform casting.
- type* functions are connected with type evaluation.
- trace* functions print to stdout.
- make* functions generate code.
- fv* functions are connected with static binding.
- set* functions modify the scope properties.
- mem* functions are responsible for memory management.
make build_docker
If you want to start the container and you have not already created it use:
make run_docker
Otherwise attach to the container:
make start_docker
If you want to delete the container run:
docker container rm ocamlhi
make build
make test
python3 unittests.py [--print_failed]
./ocamlhi tests/good/01_Constants.ml
./ocamlhi -s tests/good/99_Tree.ml # TODO(?)
./test_style.sh
make test_style
Use printing functions inside the code:
pushToOstream "Checkpoint"
traceEnvironment;
Alternatively, you can change defaultFlags
in Flags.hs
.
If you need to update the grammar you can:
- Modify the ocaml.fc file.
- Run
make bnfc
- Resolve changes manually.
If the output is "Killed" you probably have exceeded timeout (tests, timeout = 1s).
You may try to run the test manually.
- OCaml language description
- OCaml BNF syntax
- OCamli - Ocaml interpreter in Ocaml (BSD)
- BNF converter (GPL)
- Happy - Parser generator (BSD)
- Alex - Lexical analyser generator (BSD)
- Haskell documentation - Profiling
- Stack Overflow - Why is impredicative polymorphism allowed only for functions in Haskell?
- TH - Template Haskell tutorial by Mark Karpov
- PathDB
- ruslanspivak.com - Algorithm for nesting scopes in Python
- unification-fd example
- Monadic Compilers for Programming Languages
- Polymorphism in Ocaml - Ad-hoc, parametric, inclusion/subtyping
- Dezani, Mariangiola & Giannini, Paola & Zucca, Elena. (2009). The essence of static and dynamic bindings. 99-106.
- Erkok (2002). Value Recursion in Monadic Computations
- Sunil Kothari and James L. Caldwell (2007). Type Reconstruction Algorithms: A Survey
- Vytiniotis, Peyton Jones, Schrijvers, Sulzmann (2010). OutsideIn(X) Modular type inference with local assumptions
- Mark P. Jones (2000). Typing Haskell in Haskell
- Xavier Leroy (1992). Polymorphic typing of an algorithmic language
- David J. King, John Launchbury (1998). Lazy Depth-First Search and Linear Graph Algorithms in Haskell.