Skip to content

A Primitive Compiler from λ-calculus + α in Haskell

License

Notifications You must be signed in to change notification settings

Ailrun/lambdacomp

Repository files navigation

$\lambda$-Compiler

A Primitive Compiler from $\lambda$-calculus + $\alpha$ (e.g. primitive operations, recursion, and effects) to C, based on Call-By-Push-Value (CBPV)

Usage

$ lambdacomp [EXAMPLE_ID] [(-c|--direct-c) (-o|--output OUTPUT_FILE) | [--am]]

For details of each option, please check lambdacomp --help.

Autocompletion

$\lambda$-compiler supports bash, zsh, and fish completion provided by optparse-applicative. To use that, users can check their documentation about autocompletion.

Current Status

Currently, this repository implements a primitive compiler from Call-By-Value $\lambda$-calculus to C based on Call-By-Push-Value (CBPV) and a primitive compiler from CBV $\lambda$-calculus to abstract machine (AM) for CBPV. This repository also comes with an interpreter for AM.

  • Frontend Parser for $\lambda$-calculus
  • Simple bidirectional type-checker for $\lambda$-calculus
  • Constraint-based bidirectional type checker for $\lambda$-calculus
  • Call-By-Value $\lambda$-calculus-To-CBPV pass
  • Call-By-Name $\lambda$-calculus-To-CBPV pass
  • Call-By-Need $\lambda$-calculus-To-CBPV pass
  • Simple bidirectional type-checker for CBPV
  • Constraint-based bidirectional type checker for CBPV
  • Simple CBPV optimization pass
  • Tail call optimization pass (or lowering pass)
  • CBPV interpreter
  • CBPV-to-C pass without GC
  • CBPV-to-AM pass without GC
  • AM interpreter
  • AM-to-C pass without GC
  • GC instruction for AM
  • GC for CBPV-to-C
  • GC for CBPV-to-AM
  • GC for AM-to-C
  • PrintInt effect
  • PrintString effect
  • Read effect
  • Exception-handling effects
  • General I/O effect

About

A Primitive Compiler from λ-calculus + α in Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published