Skip to content

thunderseethe/making-a-language

Repository files navigation

Making a Language

Implementation code for: https://thunderseethe.dev/series/making-a-language/.

This project is divided up into a crate for each "stage" of the compiler. Each crate has at least one associated article in the making a language series (some crates have multiple articles associated with them). The stages in the compiler:

  • types - Type inference and checking
    • base - The initial base type checker.
    • rows - Extends base with support for datatypes via row types.
    • items - Extends rows with support for checking top level functions.
  • lowering - Lowering into our intermediate representation (IR)
    • base - Lowering the AST of our base type checker.
    • rows - Lowering our rows type checker using evidence passing.
    • items - Lowering top level items into our IR.
  • simplify - Simplify our IR to improve its performance.
    • base - Simplifying our base IR.
  • monomorph - Monomorphization removes polymorphism from our IR.
    • base - Monomorphizing our base IR.
  • closure_convert - Closure conversion removes functions from our IR.
    • base - Closure convert our base IR.
  • emit - Code emission targeting WebAssembly
    • base - Emit Wasm for our closure-converted base IR.
  • parser - Parsing syntax
    • base - Parser for the base language
  • desugar - Desugaring our CST into an AST
    • base - Desugaring for the base language
  • name_resolution - Name resolution
    • base - Name resolution for the base language
  • lsp - Language Server Protocol
    • base - Implement a language server for the base language

About

Full Source Code for Making a Language series

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors