Back
Leviator
2023
# Languages

Leviator

A custom programming language compiled to WebAssembly bytecode, built in Haskell in under a month.

~/Tags

HaskellBytecodeWasm2023

~/About

Leviator is a school project in which we created a complete programming language from scratch in less than a month using Haskell. The challenge involved three major phases: defining the syntax, compiling to bytecode, and building an executor. What makes this project unique is our decision to target WebAssembly bytecode, allowing our language to run directly in web browsers. The language features opinionated syntax with strong typing, function polymorphism, type aliases, and comments. It supports standard control flow constructs (if/else, while loops), operators, operator precedence, and an export system for public functions. The compiler pipeline transforms source code through lexing, parsing, and code generation phases to produce executable WASM modules, demonstrating the full workflow of language design and implementation.

~/Gallery

Leviator 1
view
Leviator 2
view
Leviator 3
view
Leviator 4
view
Leviator 5
view
Leviator 6
view

~/Key features

VSCode extension for syntax highlighting
Full compiler pipeline: lexer → parser → codegen
Compiles to WebAssembly bytecode
Runs in web browsers and in our executor
Type aliases, operator precedence, function polymorphism
Operators: +, -, %, *, /, ==, !=, <, >, <=, >=
Standard control flow: if/else, while loops
Export system for public functions
Supports comments and whitespace
Functions return values (void or typed)