A statically-typed compiled language defined by a simple grammar
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
spec
src
.gitignore
Cargo.lock
Cargo.toml
LICENSE.md
README.md
STRUCTURE.md
requirements.txt
specs.py
tasks.py

README.md

Ullage

Ullage started as an attempt to implement a top-down operator precedence parser in Rust. It has since started developing into a small language. Feel free to have a poke around but don't expect much to work at the moment.

Current Status

It is now possible to write simple programs. The following program computes 9 factorial:

fn fact(n: Number): Number
    var acc = 1
    var i = 1
    while i < n
        acc = acc * i
        i = i + 1
    end
    acc
end

print fact(9) # => 362880

License

Ullage is open source, under the MIT License.

Features and Progress

  • Custom data structures
  • Pattern matching
  • First-class functions

Lexer

  • Recognise words, numbers, comments, operators and whitespace
  • Position information on each token
  • Interpolated strings
  • Expose whitespace to the parser

Parser

  • Parse base constructs
  • For loops and iterators
  • Traditional if blocks
  • Keep track of all underlying tokens
  • Expose position & span information
  • Round-trippable/pretty-printable

Code Generation / Lowering

  • Create LLVM module and lower basic constructs
  • Array indexing
  • Arbitrary types for local variables
  • Lowering of String type
  • Library output typess
  • Control of target machine & features
  • Stop shelling out for linking on supported platforms (lld or similar)