Skip to content

cyberglot/locm-proto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

locm-proto

locm-proto is a prototype of a simple imperative programming language, Lang, and its compiler to a stack-based VM. It also includes a static single assignment optimization and a typechecker.

Lang comprises the following abstract syntax:

data Lang
  = Int Int
  | Double Double
  | Bool Bool
  | String String
  | IfElse Lang Lang Lang
  | Assign Lang Lang
  | Var String
  | Print Lang
  | Skip
  | Seq [Lang]
  | Add Lang Lang
  | Sub Lang Lang
  | Mul Lang Lang
  | Div Lang Lang
  | Mod Lang Lang
  | Eq Lang Lang
  | Neq Lang
  | Lt Lang Lang
  | Gt Lang Lang

locm-proto is written in simple Haskell and is accessible to any programmer familiar with pattern matching and recursion. All recursive functions are explicit except when fold can use an already existing function either directly or by flipping its arguments.

running the project

cabal build
cabal test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published