No description
  • Rust 99.7%
  • Shell 0.3%
Find a file
Ellie Gummere d90404a24e Emit user's main as C entry point
Add function_attributes, constant_folding and string_builder helpers and
several CodeGen utility methods (get_data_ptr_from_object,
is_at_function_end,
string interning helpers, reachability stubs). Apply optimization
attributes
to generated functions and use the new data-pointer helper for string
literals.
Update example main to return a numeric exit code.
2026-01-18 22:57:54 -05:00
.vscode chore: update dependencies and improve workspace configuration across multiple crates 2025-12-25 18:10:28 -05:00
crates Emit user's main as C entry point 2026-01-18 22:57:54 -05:00
docs refactor(runtime): implement JavaScript Number object functionality 2025-12-25 20:26:58 -05:00
examples Add TypeScript function type examples 2026-01-18 22:57:06 -05:00
scripts chore(scripts): move tmp_ir_dump.rs from root to scripts directory 2025-12-26 16:21:18 -05:00
.gitignore style: reorganize .gitignore with better categorization and remove redundant patterns 2025-12-25 18:18:47 -05:00
.gitlab-ci.yml chore(ci): comment out CI configuration for workspace and variables 2025-12-26 16:28:46 -05:00
AGENTS.md Add AGENTS.md guidelines for agents 2026-01-18 22:57:20 -05:00
Cargo.lock chore(deps): remove unused cargo dev-dependency 2025-12-26 16:27:07 -05:00
Cargo.toml Centralize LocalEntry and LocalsStackLocal 2026-01-18 21:44:34 -05:00
clippy.toml refactor(oatsc): enhance code clarity and performance 2025-12-25 21:35:31 -05:00
LICENSE refactor: enhance documentation across multiple files for clarity and consistency 2025-10-12 16:13:26 -04:00
Oats.toml.example Implement Package-Based Module System for Oats Compiler (#8) 2025-10-18 11:01:23 -04:00
README.md Enforce strict typing and disallow inference 2026-01-18 22:27:28 -05:00

Oats

License Rust LLVM

Compiles TypeScript/JavaScript to native code using LLVM. Still experimental, but it works for basic stuff. Supports multi-file projects, generates standalone executables, and uses reference counting for memory management.

Features

  • Basic types: numbers, booleans, strings, arrays, classes, unions
  • Multi-file compilation with a package system
  • Generics (via monomorphization) and union types
  • Async functions (still in preview, but they work)
  • Reference counting with weak refs and cycle collection
  • Outputs LLVM IR and links to a custom runtime

Getting Started

Prerequisites

You'll need:

  • Rust (install via rustup)
  • LLVM 18 dev headers and tools
  • clang (usually comes with LLVM)

Installing LLVM 18:

Fedora:

sudo dnf install llvm18 llvm18-devel clang18

The easiest way is to use toasty standalone.

Install it:

cargo install --git https://gitlab.com/Chrono-byte/oats toasty

Then compile and run:

# Create a simple program
echo 'export function main(): void { println(5 + 3); }' > add.ts

# Build it
toasty build add.ts

# Or build and run
toasty run add.ts

The runtime gets cached in ~/.oats/runtime/ so subsequent builds are faster.

Environment variables:

  • OATS_RUNTIME_CACHE: Change where the runtime cache goes

Building from Source

If you want to hack on Oats:

git clone https://gitlab.com/Chrono-byte/oats.git
cd oats

# Build everything
cargo build --workspace

# Run an example
cargo run -p toasty --release -- run examples/add.ts

Project Structure

  • crates/oatsc: The actual compiler (parsing, type checking, LLVM IR generation)
  • crates/runtime: Runtime library with ARC, allocators, logging, cycle collector.
  • crates/toasty: CLI tool with build and run commands
  • crates/std: Standard library (console, filesystem, networking, etc.)
  • docs/: Documentation (architecture, dev guides, memory design, roadmap)
  • examples/: Example programs and test suites
  • scripts/: Helper scripts for dev/testing

Check out docs/README.md for more detailed docs.

Contributing

Contributions welcome. Check out docs/ROADMAP.md to see what's planned.

To build and test:

# Build everything
cargo build --workspace

# Run tests
cargo test --workspace

# Run the end-to-end tests
# there is a test suite member called e2e_tests.rs that runs the end-to-end tests

License

Licensed under the zlib/libpng License with Acknowledgement. See the LICENSE file for details.