MIRROR: javascript for 🐜's, a tiny runtime with big ambitions
Contributing to Ant#
Thank you for your interest in contributing to Ant! This document provides guidelines for contributing.
Getting Started#
For the full list of prerequisites and platform-specific setup instructions,
see BUILDING.md.
Building from Source#
git clone https://github.com/theMackabu/ant.git && cd ant
meson subprojects download
meson setup build
meson compile -C build
For detailed build instructions including debug builds, ASan builds,
ccache setup, and Windows/Linux/macOS specifics, see BUILDING.md.
Repository Knowledge#
Ant keeps agent-facing repository context in versioned markdown so future changes do not depend on chat history or tribal knowledge.
- Start with AGENTS.md for the quick repository map
- Use ARCHITECTURE.md for subsystem boundaries
- Use docs/repo/index.md for durable workflow docs
- Use docs/exec-plans/index.md for multi-step work
- Run
maid knowledgeafter updating these docs - Run
maid structureto catch generated-path and scratch-doc violations - Run
maid validate_changesto see the recommended validation set for the current diff
How to Contribute#
Reporting Bugs#
- Check existing issues first
- Include reproduction steps
- Provide system info (OS, compiler version)
- Include relevant error messages
Suggesting Features#
- Open an issue with the
enhancementlabel - Describe the use case
- Provide examples if possible
Pull Requests#
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes
- Ensure tests pass
- Submit a pull request
Code Style#
- C code: GNU23 standard, 2-space indent, no trailing whitespace
- Naming:
snake_casefor functions,UPPERCASEfor macros - Headers: Local includes (
"...") before system includes (<...>) - Comments: Avoid unless code is complex
Project Structure#
src/
├── cli/ # Command line interface helpers
├── core/ # Bundled snapshot code
├── esm/ # ES module system (loader, resolver, cache)
├── highlight/ # Syntax highlighting (emit, iterators)
├── modules/ # Built-in JS modules (fs, path, shell, etc.)
├── pkg/ # Zig-based package manager
├── silver/ # Silver bytecode compiler and VM
│ └── ops/ # Bytecode operation definitions
├── strip/ # Rust-based type stripping (oxc)
├── tools/ # Code generation scripts (snapshot gen)
├── types/ # TypeScript type declarations
include/ # C header files
tests/ # JavaScript test files
vendor/ # External dependencies
For more information about Ant's internal structure, read the Ant DeepWiki.
Testing#
- Add tests for new features in
tests/ - Run specific tests:
./build/ant tests/test_<name>.js - Run
./build/ant examples/spec/run.jsto ensure nothing else broke