Skip to main content
Engineering Case Study

Vela Programming Language

A Rust compiler project with C11 output and an in-repository WebAssembly IDE

systemsScope L4

1. At a glance

Vela is a programming-language compiler project written in Rust. Its public repository contains compiler code, C11 output support, and a WebAssembly IDE that is included in the repository (not yet hosted publicly). Test totals remain omitted until confirmed against a reproducible repository snapshot.

2. Why it existed

The project explores how to build a complete compiler pipeline end-to-end—using C11 as a portable compilation target—while keeping compilation interactive inside a browser-based WASM IDE.

3. Contribution

Designed and authored the Rust compiler frontend (lexer, recursive-descent parser, AST, and semantic checks), the C11 code emitter, and the in-repository WebAssembly playground wrapper.

4. System Shape & Architecture

System Architecture SchematicVELA // SVG
1. LexerToken Spans2. ParserPratt AST3. Type CheckRegions & Check4. Emit IRPortable C115. TargetNative / WASM
Compiler pipeline from source text through parsing and semantic analysis to generated C11.

5. The project story

Vela began as a deep exploration into building a clean, predictable systems language where compiled artifacts stay transparent enough to inspect directly in standard C11 toolchains—and interactive enough to experiment with inside the browser.

01

Designing explicit syntax and diagnostics

The project opened by shaping a lexer, recursive-descent parser, and structured AST with exact source spans so syntax mistakes produce immediate, actionable error messages instead of cryptic downstream failures.

02

Enforcing scopes and static semantics

Lexical symbol tables and static type checks were layered over the AST to catch invalid bindings, mismatched signatures, and unreachable constructs prior to code emission.

03

Targeting portable C11

Rather than tying programs to a single opaque VM bytecode, the backend lowers verified Vela programs into idiomatic C11—making generated control flow inspectable and compilable via standard GCC/Clang toolchains.

04

Bringing compilation into the browser

To shorten the feedback loop when testing language ideas, the core compiler pipeline was packaged into WebAssembly so users can write Vela code and inspect diagnostics and emitted C side by side without local installation.

6. Technical Decisions & Tradeoffs

Using C11 as an output target makes the generated program inspectable and delegates native optimization to mature C compilers. The tradeoff is keeping Vela’s type and control-flow semantics disciplined enough to lower cleanly without hiding excessive runtime scaffolding.

7. Challenges & how I solved them

Target lowering

Preserving readable C11 output across nested blocks

Naively emitting C statements from nested expressions quickly creates shadowed variable names, fragile statement ordering, and unreadable generated files.

How I Solved It
Introduced structured lowering helpers with deterministic scope prefixes and separated expression temporary emission from block serialization so generated C11 stays easy to trace and compile cleanly.

Dual targets

Keeping CLI diagnostics and WASM IDE output identical

Compiler messages rendered for terminal sessions rely on ANSI/filesystem assumptions that break when compiled into a browser WebAssembly sandbox.

How I Solved It
Decoupled source loading and diagnostic formatting from core compiler crates behind structured diagnostic records so both CLI and browser bindings consume the same source spans.

8. Verification & Security

The project includes tests in its public repository. A numeric total is not published here because the exact count and suite boundaries have not been confirmed.

9. Outcome & Metrics

The repository demonstrates a working compiler project and an in-repository WebAssembly interface. The IDE is not hosted publicly, and no test-count claim is made on this page.

10. Reflection & Lessons Learned

Building a compiler makes language semantics concrete: every syntax choice eventually becomes a parser rule, a type rule, and a code-generation decision. Keeping the target representation simple helps make each stage easier to inspect.

11. Explore Source & Artifacts