Course:Cpsc312:/langlang

From UBC Wiki

Authors: Kiana Rashidi, Chester Gould, Oussama Saoudi

🐑 Lang (Lamb-lang)

What is the problem?

We aim to explore the feasibility of implementing pure functional languages in Haskell. To this aim, we will implement a version of interpreted simply-typed lambda calculus. Inspired by Haskell’s IO monad, we will replicate a similar feature in our language to allow IO interaction in a pure and similar manner to Haskell’s “do” blocks.


It's like making meth math. The purer the better 🧪


What is the something extra?

We will provide a type checker for our language and explore topics in lambda calculus. We dub it 🐑-duh calculus.

What did we learn from doing this?

What is the bottom-line? Is functional programming suitable for (part-of) the task?

  1. Functional programming enabled us to use parser combinators, which allowed for a smaller parsing library and easier and more readable parsing
  2. Debugging non-terminating processes was painful and infeasible in the parser, and led to us switching some design decisions
  3. Haskell's Either monad enabled us to more easily throw errors in all parts of the project
  4. Haskell's pattern matching was quite helpful in writing the evaluator and the type-checker, and made it easier than imperative languages to implement
  5. Haskell's white-space sensitivity made it harder to implement the parser (in comparison to other s-expression based functional languages)
  6. Haskell's algebraic data types made it easier to define valid expressions and types in our language and typecheck and evaluate them

Work division

LambLang is made up of 3 major components: The parser, type checker, and the evaluator. We chose to divide the work along these lines, assigning each major component to one person, while all communicating and brainstorming about all three components and their interactions.

How was the workload divided? Who did what? (This can be in a private communication to the TA if you do not want it to be public).

Links to code etc.

https://github.com/x-kiana/LambLang