mental32/monty

Support for data structures

mental32 opened this issue · 1 comments

Currently we only support integers and boolean as legal types, this is fun and all but we should be able to express more complex structures i.e. (C-like?) strings and tuples.

  • Strings (#3)
  • Tuples
  • Lists
  • Sets
  • Dicts

Triage: strings, integers, floats, booleans and of course None are already OK for typechecking and MIR-gen (except for strings) additionally classes and tuples are inbound!

Types like List[T], Set[T], Dict[K, V] are going to require more work because:

  • Generics aren't supported (yet)
  • Memory APIs are required e.g. to heap allocate (which doesn't exist... yet)
  • Escape/Reference analysis is needed in case we need ref-counting semantics (this ends up implicitly wrapping the type in a Rust-like Rc[T])

(Say a compromise here would be to just support them for inference + checking but not for mirgen, generics would still be required.)