Skip to content

SebastianGuadalupe/orillac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orillac

A compiler for the Orilla programming language, written in Rust. Orillac compiles Orilla source code to native object files using Cranelift for code generation.

Features

  • Lexical Analysis: Token-based lexer for Orilla source code
  • Parsing: AST generation from parsed tokens
  • Type Checking: Static type analysis with error reporting
  • Code Generation: Native object file generation via Cranelift

Language Features

Ola supports modern programming constructs including:

  • Functions with type annotations
  • Pattern matching (match expressions)
  • Option types (Some/None)
  • Conditional expressions
  • Type inference

Building

cargo build --release

Usage

# Compile a .ola file (defaults to test.ola)
cargo run -- test.ola

# Specify a target triple
cargo run -- test.ola --target x86_64-unknown-linux-gnu

The compiler generates an output.o object file that can be linked with GCC:

# Windows
gcc -nostdlib output.o -lgcc -lmsvcrt -o output.exe

# Linux/macOS
gcc output.o -o output

Project Structure

  • src/lexer.rs - Lexical analysis
  • src/parser.rs - Syntax parsing and AST construction
  • src/typecheck.rs - Type checking and validation
  • src/codegen.rs - Code generation using Cranelift
  • src/types.rs - Type system definitions
  • src/error.rs - Error handling and reporting

Testing

cargo test

Dependencies

  • cranelift-codegen - Code generation backend
  • cranelift-frontend - IR construction
  • cranelift-module - Module management
  • cranelift-object - Object file generation
  • target-lexicon - Target triple parsing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages