# Programming Languages Used in the Brush Repository: Rust, TypeScript, and Python

> Discover the programming languages powering the Brush repository. Learn how Rust, TypeScript, and Python are used for its core engine, web frontend, and benchmark utilities.

- Repository: [Arthur Brussee/brush](https://github.com/ArthurBrussee/brush)
- Tags: programming-languages
- Published: 2026-05-14

---

**The brush repository is built primarily with Rust for the core rendering engine, TypeScript for the web frontend, and Python for benchmark utilities, organized as a Cargo workspace with supporting HTML and configuration files.**

The **brush** repository is a multi-language codebase implementing 3D Gaussian Splatting tools, where the programming languages used in the brush repository are carefully selected to balance performance-critical rendering with cross-platform accessibility. The project structure reflects a modern polyglot architecture, with systems-level code handling computation and higher-level scripts managing testing workflows.

## Rust: The Core Rendering Engine

The majority of the brush codebase is written in **Rust** and organized as a Cargo workspace under the `crates/` directory. This language choice provides memory safety and performance necessary for real-time rendering operations.

Key Rust components include:
- **Raster-based renderer** in [`crates/brush-render-bwd/src/lib.rs`](https://github.com/ArthurBrussee/brush/blob/main/crates/brush-render-bwd/src/lib.rs)
- **Dataset loading utilities** in [`crates/brush-dataset/src/lib.rs`](https://github.com/ArthurBrussee/brush/blob/main/crates/brush-dataset/src/lib.rs)
- **CLI tools and WASM bindings** for cross-platform deployment

The `Scene::load` method in the dataset crate handles 3D scene ingestion:

```rust
use brush_dataset::scene::Scene;
use std::path::PathBuf;

fn load_scene(path: PathBuf) -> Result<Scene, brush_dataset::Error> {
    // The `Scene::load` implementation lives in the dataset crate
    Scene::load(&path)
}

```

The root [`Cargo.toml`](https://github.com/ArthurBrussee/brush/blob/main/Cargo.toml) defines the workspace structure, linking crates for rendering, dataset handling, and bench testing into a unified build system.

## TypeScript: Web Frontend Implementation

The web interface resides in `apps/brush-js/` and is implemented in **TypeScript**, compiled to JavaScript via Vite for browser deployment. This layer provides the UI and WebGL visualization capabilities.

The [`apps/brush-js/web/src/point_renderer.ts`](https://github.com/ArthurBrussee/brush/blob/main/apps/brush-js/web/src/point_renderer.ts) file contains the WebGL point-rendering logic, while [`apps/brush-js/web/src/main.ts`](https://github.com/ArthurBrussee/brush/blob/main/apps/brush-js/web/src/main.ts) serves as the application bootstrap. Although the bundle includes generated JavaScript, the source is hand-written TypeScript. The [`apps/brush-js/web/index.html`](https://github.com/ArthurBrussee/brush/blob/main/apps/brush-js/web/index.html) file acts as the host container that loads the compiled application.

Example initialization from the frontend:

```typescript
import { PointRenderer } from "./point_renderer";

const canvas = document.getElementById("glCanvas") as HTMLCanvasElement;
const renderer = new PointRenderer(canvas);

function animate() {
  renderer.render();
  requestAnimationFrame(animate);
}
animate();

```

## Python: Benchmark and Test Utilities

**Python** scripts support the testing infrastructure rather than the runtime application. Located primarily in `crates/brush-bench-test/test_cases/`, these utilities generate reference data and validation tensors for the benchmark suite.

The [`generate_reference.py`](https://github.com/ArthurBrussee/brush/blob/main/generate_reference.py) script creates test datasets using standard ML libraries:

```python
import safetensors
import numpy as np

def make_reference():
    data = np.random.rand(100, 3).astype("float32")
    safetensors.save_file({"points": data}, "reference.safetensors")

```

## Supporting Technologies

The repository includes **HTML** markup for the web UI entry point and **TOML** configuration files for build management. The [`Cargo.toml`](https://github.com/ArthurBrussee/brush/blob/main/Cargo.toml) workspace manifest defines dependencies across the Rust crates, while package configuration files support the TypeScript build pipeline.

## Summary

- **Rust** forms the computational core in `crates/`, handling rendering, datasets, and CLI functionality
- **TypeScript** drives the interactive web interface in `apps/brush-js/`, compiled via Vite for browser execution
- **Python** provides auxiliary benchmark utilities in `crates/brush-bench-test/` for test data generation
- **HTML** serves as the container for the web application entry point
- **TOML** configurations manage the Cargo workspace and build dependencies

## Frequently Asked Questions

### Does the brush repository use Python for machine learning?

No, **Python is used exclusively for benchmark utilities** and test data generation, such as in [`crates/brush-bench-test/test_cases/generate_reference.py`](https://github.com/ArthurBrussee/brush/blob/main/crates/brush-bench-test/test_cases/generate_reference.py). The core machine learning operations and rendering algorithms are implemented in Rust for performance optimization.

### What build system manages the Rust code in brush?

The repository uses **Cargo** as the workspace build system, defined by the root [`Cargo.toml`](https://github.com/ArthurBrussee/brush/blob/main/Cargo.toml). This manages dependencies across multiple crates including `brush-render-bwd`, `brush-dataset`, and `brush-bench-test`.

### Is the brush web interface written in JavaScript or TypeScript?

The web interface is written in **TypeScript** and located in `apps/brush-js/web/src/`. The TypeScript source is compiled to JavaScript using Vite during the build process, with the entry point defined in [`main.ts`](https://github.com/ArthurBrussee/brush/blob/main/main.ts) and rendering logic in [`point_renderer.ts`](https://github.com/ArthurBrussee/brush/blob/main/point_renderer.ts).

### What is the primary purpose of the Rust code in this repository?

The **Rust code implements the core rendering engine** including the backward pass rasterizer in [`crates/brush-render-bwd/src/lib.rs`](https://github.com/ArthurBrussee/brush/blob/main/crates/brush-render-bwd/src/lib.rs), dataset loading utilities, and the command-line interface. It compiles to both native binaries and WASM targets for web deployment.