Menu

oviev: Building a Compiler in Ovie The Self-Hosting Journey
📰

oviev: Building a Compiler in Ovie The Self-Hosting Journey

DEV Community: rust·Ovie lang·about 13 hours ago
#PvDKwieL
#devtorust#devto#dev#oviev#ovie
Reading 0:00
15s threshold

One of the milestones of any programming language is when it can compile itself. Ovie Lang 1.0 ships oviev the Ovie compiler written entirely in Ovie (.ov files).

Two Compilers, One Language

Compiler Language Status

oviec Rust Stable use for everything today

oviev Ovie (.ov) Stage 1 self-hosted, help test it

Both run the same .ov programs:

oviec run hello.ov # stable Rust compiler

oviev run hello.ov # Ovie self-hosted compiler

The File Map

Every file in oviec/src/*.rs has a mirror .ov file in oviev/src/:

Rust (oviec/src/) Ovie (oviev/src/) Purpose

lexer.rs lexer.ov Tokenizer

parser.rs parser.ov Token -> AST

ast.rs ast.ov AST node definitions

hir.rs hir.ov High-level IR

mir.rs mir.ov Mid-level IR

ir.rs ir.ov IR shared types

interpreter.rs interpreter.ov Runtime

semantic.rs semantic.ov Type checking

error.rs error.ov Error types

main.rs main.ov Entry point + CLI

codegen/llvm.rs backend/llvm.ov LLVM backend

codegen/wasm.rs backend/wasm.ov WASM backend

Run oviev

oviev…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.