Project Update

May 12, 2022

Implementing MiniML

Using the skills of design, abstraction, testing, and debugging learnt in CS51, I implemented a subset of an OCaml-like language.

Project Dates: May 2022

Built with: Ocaml

As a final project for CS51: Abstraction and Design in Computation, I implemented MiniML, a small subset of an OCaml-like language. After implementing a substitution and an environment semantics for MiniML, I extended the language in a few ways (see the Resources section for the project code).

Implementing additional expression types

First, because the distribution code focused on integers and booleans, I incorporated more of the common data types found in OCaml. I implemented the float type as an expression type, and further operations, as described below.

Implementing additional unop and binop operation types

To complement the distributed unop and binop operation types, I added the following binop operation types: over (division), DNE (does not equal), less than, and their float counterparts. I also included the negate counterparts of booleans and floats for greater compatibility across data types. This addition should add to the usability of MiniML.

Implementing lexically scoped environment semantics

Finally, and most importantly, I implemented a lexically scoped environment semantics. This is where I spent most of my time, trying to combine the functionality of dynamically and lexically scoped environment semantics. In the end, I combined most functions into a single call for both scopes, with a few functions, like let rec having different calls because of the different scoping mechanisms. Both scoped environment semantics support all operations and types described above or in the distribution code.

Resources

Github repository

Github repository

View

View

©2024 Evangelos Kassos

©2024 Evangelos Kassos