Files
metabuilder/mojo/samples/examples
johndoe6345789 5aabff44cd refactor(fakemui): flatten QML components directory structure and update documentation
Directory Restructuring:
- qml/qml-components/qml-components/* → qml/components/ (flattens nesting)
- All 104 QML files moved with git history preserved
- Eliminates redundant qml-components nesting

Documentation Updates:
- ARCHITECTURE.md: Updated qml/components references (2 locations)
- GETTING_STARTED.md: Updated qml/components path (1 location, end of file)
- README.md: Updated qml/components references (3 locations)
- CODE_REVIEW.md: Updated qml/components file paths (4 locations)
- docs/ARCHITECTURE.md: Complete refactor with qml/components paths

Verification:
-  No remaining qml-components/ references in documentation
-  All 104 QML files present in flattened structure
-  Directory structure verified (12 component categories)
-  First-class directory naming convention

Structure Post-Refactor:
qml/
├── components/
│   ├── atoms/ (16 files)
│   ├── core/ (11 files)
│   ├── data-display/ (10 files)
│   ├── feedback/ (11 files)
│   ├── form/ (19 files)
│   ├── lab/ (11 files)
│   ├── layout/ (12 files)
│   ├── navigation/ (12 files)
│   ├── surfaces/ (7 files)
│   ├── theming/ (4 files)
│   └── utils/ (13 files)
├── hybrid/
└── widgets/

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 19:54:21 +00:00
..

Mojo code examples

This directory contains a collection of sample programs written in the Mojo programming language.

Getting started

You can use git to clone the repository containing all of these sample programs:

git clone https://github.com/modular/modular.git

For the most reliable experience building and running these examples, we recommend using Pixi. It's both a package manager and virtual environment manager—which alone makes development a lot easier—but it's also fast, language agnostic, and provides lock files for package dependencies. For more help with it, see our Pixi basics guide.

Each subdirectory of this directory is a self-contained project that demonstrates features of the Mojo programming language and its standard library. Each contains a README.md file and a pixi.toml file that specifies the required dependencies. Simply follow the instructions in each README.md file to use pixi to download and install the dependencies for the project and to build and run the examples.

For more information on system requirements, installing Mojo and the Mojo extension for VS Code, and getting started with Mojo programming, see the Install Mojo section of the Mojo Manual.

Example subdirectories

  • life/: The Get started with Mojo tutorial solution. A complete implementation of Conway's Game of Life cellular automaton, demonstrating Mojo basics including structs, modules, and Python interoperability.

  • gpu-intro/: The Get started with GPU programming tutorial solution. An introduction to GPU programming in Mojo with a simple vector addition kernel.

  • gpu-functions/: GPU kernel implementations including vector addition, grayscale conversion, matrix multiplication, Mandelbrot set calculation, and reduction operations.

  • gpu-block-and-warp/: Advanced GPU programming demonstrating block-level and warp-level synchronization and operations.

  • python-interop/: Calling Mojo functions from Python code, enabling progressive migration of Python hotspots to Mojo.

  • layouts/: Using Mojo's layout package for working with dense multidimensional arrays.

  • layout_tensor/: Companion code for Using LayoutTensor

  • operators/: Implementing operators for a custom Mojo type.

  • testing/: Writing and running unit tests using the Mojo testing framework.

License

The Mojo examples in this repository are licensed under the Apache License v2.0 with LLVM Exceptions (see the LLVM License).

Contributing

As a contributor, your efforts and expertise are invaluable in driving the evolution of the Mojo programming language. The Mojo contributor guide provides all the information necessary to make meaningful contributions—from understanding the submission process to adhering to best practices.