Roadmap

2022-06-25

Ante’s compiler has recently finished a complete rewrite and is now incremental, concurrent, and fault-tolerant - although general performance still has much room for improvement.

This page is for an in-depth roadmap of ante to show which features are currently implemented in the compiler.

All designs in the ideas page are not implemented as their design is still non-final and may not be selected at all.

Key:

  • Implemented
  • [~] Partially implemented
  • Not implemented

Note that since the compiler is still immature, a feature marked as implemented may not be completely bug-free or may have some unimplemented corner cases. These are not expected however, and users encountering any bugs with these features should create an issue on github.


Literals

  • Polymorphic integers (defaulting to I32)
  • Polymorphic floats (defaulting to F64)
  • Unit literal ()
  • Bool literals true and false
  • Strings
  • [~] Char - implemented but is 1 byte rather than 4. There is an open design question of whether ante should use rust’s model for chars (4 bytes), Swift’s model (variable bytes), or something else. These also use a temporary c"_" syntax currently.
  • Array literals

Operators

  • Basic arithmetic, +, -, *, /, comparisons, etc.
  • Pipeline operators |> and <|
  • Assignment :=
  • Compound assignment operators +=, -=, *=, /=, %=
  • . Field access
  • . Method calls
  • <- Wrapping the rest of the block in a function (often for applying effect handlers)
  • is operator for pattern matching without match

Functions and Control Flow

  • Free functions
  • Closures
  • Explicit currying via _
  • if
  • match and pattern matching
    • Variable/match-all patterns
    • Constructor patterns
    • Integer literal patterns
    • Completeness & Redundancy checking
    • ‘Or’ clause in pattern matching, combining patterns via |
    • Pattern guards: | pattern if expr -> ...
    • is keyword for matching within expressions
  • loop sugar
  • for loops
  • while loops
  • break/continue
  • extern

Types

  • Global type inference (HM)
  • Product and sum (struct and enum) type definitions
  • Type aliases
  • Type annotations
  • Implicits
    • implicit local variables
    • implicit parameters
    • Querying implicit values required for a function call
    • Calling implicit functions in scope for their return value (required for traits)
      • Check to ensure only pure implicit functions can be called
  • Trait sugar to create a dictionary type of the required functions
  • Trait impl sugar for implicit values which is an instantiation of the trait type
  • Row polymorphic struct types

Modules

  • Basic module hierarchy
  • import one or more symbols from a module
  • export only a subset of symbols from a module
  • Renaming imports
  • Re-exports
  • import implicit for introducing implicit values. Currently these use a normal import statement.

Stdlib

All APIs are non-final.

  • Prelude module auto-imported into each file
    • Opt out of importing prelude into a given file or project
  • C module in stdlib for C interop
  • Vec: Mutable, growable vectors
  • HashMap
  • Seq: Persistent vector with O(1) pop, get, and clone, and amortized O(1) push.
  • Rc
  • [~] String: Methods lack any kind of UTF-8 verification
  • [~] IO: Existing module is extremely bare bones.
  • Stream: The Emit effect and Stream trait for push-based streams.
  • Fail: Effects for generic failure & throwing a specific value
  • Others: Help wanted! Designing which modules the stdlib should include

Compiler-specific

  • LLVM backend
  • Cranelift backend
  • Existentialization option for lowering generics in debug mode (making monomorphization optional)
  • Compiler option to write inferred types into the file
  • Formatter
  • Language server.
    • Display errors in file
    • Hover
    • Display documentation on hover
    • Go to definition
    • Go to type
    • Rename
    • Import symbol
    • Fill in match arms
    • Vim plugin
    • VS-Code plugin: One exists but it is not hooked up to the language server and its syntax is out of date
  • Recoverable on error
  • Compiler only rechecks changed code in incremental mode
    • Disabled by default since it requires storing metadata for the project, enabled for the language server
  • Concurrent

Ownership & Mutation

  • var for local mutable variables
  • Mutating owned values and mutable references to values.
  • Move tracking
  • Drop called after a variable’s last non-move use
    • Drop-unwinding for uncalled resumes when handling effects.
  • Copy exempting variables from moves
  • Borrowing
    • ref, mut, imm, and uniq references exist
    • imm and uniq cannot coexist with ref and mut to the same value
    • uniq cannot coexist with any other reference to the same value
    • Moves are prevented while any reference to the same value is alive
    • Lifetimes are checked
  • shared modifier on types

Effects

  • Type checking
  • Runtime
    • Handlers
      • Handlers for a single effect
      • Handlers for multiple effects
      • Handlers for multiple instances of the same effect (e.g. Emit a, Emit b)
    • resume
      • Single resumptions
      • 0 resumptions
    • Capabilities
      • Capabilities are second-class