Apollo is a powerful compiler that transforms Racket code into Luau, enabling Roblox game development with the elegance and power of Racket's functional programming paradigm.
- Full Racket Language Support: Compile most Racket language features to Luau
- Optimized Code Generation: Produces efficient Luau code with caching and fast paths
- Module System: Support for Racket's module system with proper namespace handling
- CTFE (Compile-Time Function Evaluation): Evaluate expressions at compile time
- Pattern Matching: Convert Racket's pattern matching to efficient Luau code
- Type Safety: Maintain type safety through the compilation process
- Racket 8.0 or later
- Roblox Studio (for testing compiled code)
-
Clone the repository:
git clone https://github.com/yourusername/apollo.git cd apollo -
Install dependencies:
raco pkg install
-
Build the compiler:
raco make src/apollo/main.rkt
-
Create a new Racket file (e.g.,
game.rkt):#lang racket/base (define (create-player name) (let ([player (game:create-player name)]) (set-player-speed! player 16) player)) (define (main) (let ([player (create-player "Hero")]) (displayln "Game started!")))
-
Compile to Luau:
raco apollo game.rkt -o game.luau
-
Use in Roblox Studio:
- Create a new Script in Roblox Studio
- Copy the contents of
game.luauinto the script - Run the game to test
Visit our documentation website for detailed guides and API references.
- Install Hugo
- Run the documentation server:
cd docs-hugo hugo server - Open
http://localhost:1313in your browser
Generate local API documentation:
raco docs apolloapollo/
├── src/
│ └── apollo/
│ ├── compiler/ # Core compiler components
│ │ ├── ir.rkt # Intermediate Representation
│ │ ├── parser.rkt # Racket parser
│ │ └── codegen.rkt # Luau code generator
│ └── main.rkt # Entry point
├── tests/ # Test suite
├── examples/ # Example projects
└── docs-hugo/ # Documentation
We welcome contributions! Please see our Contributing Guide for details on:
- Setting up a development environment
- Submitting pull requests
- Reporting issues
- Code style guidelines
This project is licensed under the MIT License - see the LICENSE file for details.
- The Racket team for creating such a powerful language
- The Roblox team for Luau and the Roblox platform
- All contributors who have helped make Apollo better
- GitHub Issues for bug reports and feature requests
- Discord Server for community support
- Documentation for detailed guides
t