edwadli / note-hashtag

3 stars 0 forks source link

optimize: Add constant folding for literals. #135

Closed kevin1 closed 8 years ago

kevin1 commented 8 years ago

I got bored in class and decided to set up an optimizer.

A side effect is interpret.ml. I realized that what I was writing was basically part of an interpreter, so I moved the interpreter-y bits there. The constant-folding optimizer pass mainly just figures out when it can call the interpreter.

Currently passes all tests.