Skip to main content

Elara Roadmap

This roadmap outlines planned features and improvements for the Elara programming language. Elara is under active development, and priorities may shift based on community feedback and technical constraints.
Elara is not yet ready for production use. The language specification and compiler implementation are still evolving rapidly.

Current Status (v0.1.x)

Elara currently supports: ✅ Hindley-Milner type inference with let-polymorphism
✅ Algebraic data types (sum and product types)
✅ Pattern matching with exhaustiveness checking
✅ First-class functions and closures
✅ JVM bytecode compilation
✅ Lightweight (indentation-based) syntax
✅ Module system with imports
✅ Type aliases (including recursive)
✅ Tuple types
✅ Basic IO monad
✅ Primitive operations (arithmetic, string manipulation)

Short Term (Next 3-6 Months)

Type Classes

Implement a type class system for ad-hoc polymorphism:
type class Eq a where
  (==) : a -> a -> Bool
  (/=) : a -> a -> Bool
  
  -- Default implementation
  let x /= y = not (x == y)

instance Eq Int where
  let (==) = primIntEq

instance Eq a => Eq (List a) where
  let [] == [] = True
  let (x::xs) == (y::ys) = x == y && xs == ys
  let _ == _ = False
Challenges:
  • Dictionary passing for type class methods
  • Superclasses and default methods
  • Coherence (no overlapping instances)

Standard Library Expansion

Expand the Elara standard library with commonly-used modules:
  • Data.List - List operations (map, filter, fold, etc.)
  • Data.Map - Associative maps
  • Data.Set - Sets
  • Data.String - String manipulation
  • System.IO - File I/O operations
  • System.Environment - Environment variables, command-line args
Progress:
  • ✅ Basic list operations (map, filter, foldl, foldr)
  • ✅ String operations (cons, head, tail, isEmpty)
  • 🔄 Result type for error handling
  • 🔄 Tuple utilities
  • ❌ Map/Set implementations
  • ❌ File I/O

Error Message Improvements

Continuously improve compiler error messages:Recent improvements:
  • ✅ Better type mismatch errors with inference context
  • ✅ Constructor arity mismatch errors
  • ✅ Clearer pattern match errors
Planned:
  • More helpful “did you mean?” suggestions
  • Show type variable constraints in errors
  • Better error spans (highlight exact problem location)
  • Suggest imports when name is not in scope

Medium Term (6-12 Months)

Tail Call Optimization

Eliminate tail calls to prevent stack overflow in recursive functions:
-- Currently causes stack overflow for large n
let factorial n acc = 
  if n == 0 
    then acc 
    else factorial (n - 1) (n * acc)
Approach:
  • Detect tail-recursive functions
  • Transform to while loops in JVM bytecode
  • Support mutual tail recursion

Language Server Protocol (LSP)

Implement an LSP server for IDE integration:Features:
  • Syntax highlighting
  • Autocomplete
  • Go to definition
  • Find references
  • Inline type information
  • Error diagnostics
  • Code actions (e.g., “add import”)
Target IDEs:
  • VS Code (priority)
  • IntelliJ IDEA
  • Vim/Neovim
  • Emacs

Module System Enhancements

Improve the module system:Planned features:
  • Re-exports: module X (module Y) exports everything from Y
  • Qualified re-exports: module X (Y.foo)
  • Module signatures (for separate compilation)
  • Private declarations (internal to module)
Under consideration:
  • First-class modules (ML-style)
  • Module functors (parameterized modules)

Performance Optimizations

Optimize generated JVM bytecode:Completed:
  • ✅ Type inference performance (300% speedup)
  • ✅ Closure lifting
Planned:
  • Inline small functions
  • Specialize polymorphic functions at call sites
  • Unbox primitive types (avoid Integer wrapper)
  • Optimize pattern matching (decision trees)
  • Dead code elimination (more aggressive)
  • Constant folding

Long Term (12+ Months)

Higher-Rank Types

Full support for rank-n types:
-- Rank-2 type: forall is not at the top level
let runST : (forall s. ST s a) -> a

-- Can't escape with the 's' type variable
let example = runST (\s -> newRef s 42)
Challenges:
  • Bidirectional type checking
  • Type inference with higher-rank types
  • Integration with existing inference engine

Dependent Types (Experimental)

Explore limited dependent types:
-- Length-indexed vectors
type Vec : Nat -> Type -> Type

def head : forall n a. Vec (S n) a -> a

def safeHead : Vec n a -> Option a
let safeHead v = 
  match v with
    Nil -> None
    Cons x _ -> Some x
Challenges:
  • Type-level computation
  • Proof irrelevance
  • Runtime type erasure vs. type information preservation
  • JVM target limitations
Dependent types are a long-term research goal and may not be feasible given JVM constraints.

Native Java Interop

Direct interoperability with Java libraries:
import java Java.Util.ArrayList as ArrayList

let createList : IO (ArrayList Int)
let createList = do
  list <- ArrayList.new
  list.add 1
  list.add 2
  pure list
Challenges:
  • FFI syntax design
  • Type mapping (Java generics ↔ Elara polymorphism)
  • Null safety
  • Exception handling
  • Mutable state in pure language

Package Manager

Development of a package manager for Elara:Features:
  • Package registry (similar to Hackage, npm)
  • Dependency resolution
  • Version management
  • Build tool integration
  • Private packages
Design:
  • Packages defined by elara.json
  • Semantic versioning
  • Lock files for reproducible builds

Effect System

Explore algebraic effects and handlers:
effect State s where
  get : s
  put : s -> ()

let counter : Int
let counter = 
  handle
    let x = get
    put (x + 1)
    get
  with
    get -> \k -> \s -> k s s
    put s' -> \k -> \_ -> k () s'
  with 0
Benefits:
  • More flexible than monads
  • Composable effects
  • Efficient implementation
Challenges:
  • Type inference
  • JVM implementation (continuation passing?)
  • Effect polymorphism

Alternative Backends

Explore additional compilation targets:Potential targets:
  • Native code (via LLVM)
    • Better performance
    • No JVM dependency
    • Smaller binaries
  • JavaScript (via Node.js or browser)
    • Web development
    • Isomorphic applications
  • WebAssembly
    • Browser and server
    • Near-native performance
The JVM backend will remain the primary target for the foreseeable future.

Recent Milestones (Completed)

2024

  • ✅ Query system integration (Rock) - Enables incremental compilation
  • ✅ Closure lifting - Proper lambda lifting with environment capture
  • ✅ ANF conversion - A-Normal Form for optimization
  • ✅ Tuple types - First-class tuples with pattern matching
  • ✅ Type aliases - Including recursive type aliases
  • ✅ Module system - Hierarchical modules with imports
  • ✅ Qualified imports - Import specific names from modules
  • ✅ Improved pattern matching - Better compilation and exhaustiveness
  • ✅ Core type checking - Verify correctness of Core IR
  • ✅ JVM IR - High-level intermediate representation
  • ✅ Lightweight syntax - Indentation-based layout
  • ✅ Better error messages - Context-aware type errors

2023

  • ✅ Initial compiler implementation
  • ✅ Hindley-Milner type inference
  • ✅ JVM bytecode generation
  • ✅ Basic standard library
  • ✅ Pattern matching
  • ✅ Algebraic data types

Community Requests

Features requested by the community (not yet prioritized):
  • Do notation for monads
  • List comprehensions
  • Record updates ({ person | age = 30 })
  • Operator sections ((+ 1), (1 +))
  • Anonymous records/extensible records
  • Type-directed name resolution
  • Derive clauses (auto-generate type class instances)
  • Partial application syntax sugar
Have a feature request? Open a GitHub Discussion or chat on Discord!

Contributing to the Roadmap

Interested in helping implement these features?
  1. Check the contributing guide
  2. Look for issues tagged with the feature name
  3. Join the Discord to discuss implementation
  4. Open a PR with your changes!

Changelog

For a detailed history of completed changes, see the CHANGELOG.md in the repository.

Build docs developers (and LLMs) love