Skip to content

MtScience/HLox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HLox

Overview

This is my implementation of bytecode VM for Lox language in Haskell. It can be thought of as a follow-up to my PyLox project. There are two things I wanted to achieve with this project:

  1. Get some practice with Haskell, which I like a lot, and
  2. Build a bytecode VM for Lox in Haskell (since the other four Haskell implementations all seem to be tree-walking interpreters).

Current state of the project

Section 22.4.1 is completed. Meaning, we have locals, but not the weird edge case with var a = a. To-do list:

  • Complete code translation from C to Haskell
  • Replace the String type with strict Text where necessary
  • Simplify structures and functions where possible (including removing IO)
  • Decide whether to use Vectors or Arrays
  • Switch to lenses instead of manually changing structures
  • Refactor the Compiler module to be less imperative
  • Clean up imports and code style in general
  • Optimize for speed and memory (to the best of my ability)
  • Resolve other TODO markings
  • If there are problems with strings: take additional measures regarding unsafeIORef
  • Optionally, annotate what is going on and which function in my code is analogous to which in the original clox (to add a bit of educational value)

About

A Haskell implementation of bytecode VM for Lox language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors