Extracted from modular repo and reorganized: Compiler Implementation: - 21 compiler source files (frontend, semantic, IR, codegen, runtime) - 15 comprehensive test files (lexer, parser, type checker, backend, etc.) - 9 compiler usage example programs Architecture (5 phases): - Frontend: Lexer, parser, AST generation (lexer.mojo, parser.mojo, ast.mojo) - Semantic: Type system, checking, symbol resolution (3 files) - IR: MLIR code generation (mlir_gen.mojo, mojo_dialect.mojo) - Codegen: LLVM backend, optimization passes (llvm_backend.mojo, optimizer.mojo) - Runtime: Memory mgmt, reflection, async support (3 files) File Organization: - mojo/compiler/src/: Compiler implementation (21 files, 952K) - mojo/compiler/tests/: Test suite (15 files) - mojo/compiler/examples/: Usage examples (9 files) - mojo/samples/: Mojo language examples (37 files, moved from examples/) Documentation: - mojo/CLAUDE.md: Project-level guide - mojo/compiler/CLAUDE.md: Detailed architecture documentation - mojo/compiler/README.md: Quick start guide - mojo/samples/README.md: Example programs guide Status: - Compiler architecture complete (Phase 4) - Full test coverage included - Ready for continued development and integration Files tracked: - 45 new compiler files (21 src + 15 tests + 9 examples) - 1 moved existing directory (examples → samples) - 3 documentation files created - 1 root CLAUDE.md updated Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Get started with GPU programming tutorial solution
This directory contains a complete solution for the Get started with GPU programming tutorial project, which is an implementation of a simple vector addition GPU kernel using Mojo. Please refer to the tutorial for an explanation of the code and concepts.
This example requires a supported GPU to run the kernel. If your system doesn't have a supported GPU, you can compile the program but the only output you'll see when you run it is:
No compatible GPU found
Files
This directory contains the following files:
-
vector_addition.mojois the only source file for the tutorial solution, containing the kernel function and the main program. -
pixi.tomlis a Pixi project file containing the project dependencies and task definitions.
Run the code
If you have Pixi installed, you can execute the example by running the following command:
pixi run mojo vector_addition.mojo