Skip to content

TODO #9

@glaebhoerl

Description

@glaebhoerl
  • Docs
  • Tests

Features

  • Implement functions
    • Parsing
    • Pretty-printing
    • Name resolution
    • Typechecking
    • IR
    • LLVM
  • Need to enforce that functions actually return something!! :(
  • Implement a string type
  • Better error reporting
    • Source location tracking
      • Token
      • AST
      • Name.Error
      • Type.Error
    • <?> or whatever in AST parser
    • Store source Text in metadata?
    • instance Render Token.Error
    • instance Render AST..Error
    • instance Render Name.Error
    • instance Render Type.Error
    • Anything else....?
  • Pretty printing of AST
  • More analyses / transformations in IR?

Odds and ends

  • Re-add validation for Type
  • Validation of IR should validate Functions
  • Make validation failures print the thing that failed to validate
  • Bikeshedding and other cleanup of Pretty
  • instance Render IR.Function
  • nicer pretty-printing of types
  • AST could store full Expressions (or other nodes) instead of just names in some places for finer-grained location metadata

Bugs

  • Less hacky newline handling
  • Properly handle exceptions in Main
  • Fix - parsing ambiguity (unary vs. binary vs. literal)
  • Fix Tardis-related laziness hacks in IR
  • Fix dead-code-related bugs in IR generation
  • Refactor handling of precedence in AST (and fix for &&, ||)?
  • Improve handling of operations in LLVM to avoid UB on overflow/div-by-zero/etc.
  • function isBuzz(number: Int) returns isBuzz validation error
  • IR validation error due to function w/ if { return x } else { return x } and implicitly inserted unit return
  • Name doesn't record metadata/location for function arguments/returns (and maybe others)

Facultative

  • Implement break
  • anonymous scopes
  • unify say() and write()? ask() for strings?
  • make comparison operators polymorphic?
  • Either -> Validation?
  • Bool literals
  • Unit in AST
  • function types in syntax, C-level HOFs?
  • type annotations on lets
  • type annotations in expressions
  • add more pretty-printing styles (e.g. name-based, scope-based, type-based semantic highlighting); allow selecting w/ command-line flag?
  • add continue

Refactor

  • Update to GHC 8.6, LLVM 7
  • enable StrictData?
  • check assignments in Name, get rid of NameWith? would invalidate Name.validate
  • rename repo
  • use unused instead of _ <-
  • make use of modifyM variants directly returning the modified state, where appropriate
  • text-path-utf8?
  • safe-exceptions?
  • organize Token
  • try DeriveAny again?
  • can we use DerivingVia? or QuantifiedConstraints?
  • BlockArguments!!
  • our own Loc type?
  • make the error-type in Main be a Doc rather than Text?
  • some kind of multiplatey abstraction?
  • add a method in Render to customize how lists of the type are rendered, get rid of the flexible list instances?
    • instance Render a => Render (Maybe a)?
  • style consistency: where always trailing
  • style: always require newline after ->/=...?
  • do something about all the warnings
  • keep a stack of metadata instead of a scalar for better robustness?
  • factor out a MonadMetadata or something?
  • generalize the parser itself over arbitrary Monoid metadata?
  • collapse LLVM.FirstState and SecondState, with just the instances differing?
  • DisambiguateRecordFields?
  • StateT -> ReaderT
  • explore https://github.com/lamdu/syntax-tree ?

FUTURE

  • IRBuilder?
  • SSA?
  • Change IR to graph-based Thorin-style
  • Expression language
  • Bidirectional typechecking
  • Unification
  • Nonlocal breaks, breaks returning values
  • Struct types
  • Sum types, simple switches
  • Stack closures
  • Stack references (lifetime checking?)
  • Arrays, stack slices
  • Heap allocation, reference counting, heap-allocated strings, arrays, closures

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions