Skip to content

patternscientist/pl-interpreters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PL Interpreters

Self-directed study in programming language implementation, spanning Haskell, Standard ML, and Scheme.

Projects

appel-straight-line/ — Appel's Modern Compiler Implementation in ML, Chapter 1

  • straightLineLang.sml — Full interpreter for a straight-line programming language: AST definition, maxargs static analysis, and interpStm/interpExp mutually recursive interpreter with mutable environment threading.
  • chap1Exercises.sml — Binary search tree with member, insert, and a valid function implementing "parse, don't validate" via an opaque validTree wrapper type.

haskell-straight-line/ — Same interpreter, ported and extended in Haskell

  • Lib.hs — Port using Control.Monad.State for environment threading + an attoparsec parser for the straight-line language.
  • LibAlt.hs — Refactored version using a modular monad transformer stack (WriterT for print output, StateT for environment, ExceptT for errors).

parser-from-scratch/ — Hand-rolled monadic parser

  • Parser.hsParser newtype with manually derived Functor, Applicative, Monad, and Alternative instances. Basic combinators (char, str, space, digit, etc.).

eopl/Essentials of Programming Languages (Friedman & Wand)

  • eopl.scm — Exercises from the first two chapters in Racket's #lang eopl: recursive data structure manipulation, environment representations, binary tree operations, Church-encoded arithmetic (successor, predecessor, plus, times, factorial), and a stack implementation.

Textbooks

  • Andrew Appel, Modern Compiler Implementation in ML (Ch. 1)
  • Daniel Friedman & Mitchell Wand, Essentials of Programming Languages (Chs. 1–2)

About

Self-study in programming language implementation: interpreters, parsers, and semantics exercises.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors