# What Programming Languages Are Used in Marin? A Polyglot Codebase Analysis

> Explore the Marin repository's polyglot codebase. Discover how Python, Rust, JavaScript, and Shell scripts power its machine learning, services, documentation, and automation.

- Repository: [The Marin Project/marin](https://github.com/marin-community/marin)
- Tags: code-analysis
- Published: 2026-08-27

---

**The Marin repository combines Python for machine learning pipelines, Rust for high-performance services, JavaScript for documentation tooling, and Shell scripts for infrastructure automation.**

The marin-community/marin repository adopts a polyglot architecture to balance developer ergonomics with systems performance. Understanding what programming languages are used in Marin provides insight into how the project manages distributed training workloads across TPU and GPU clusters while maintaining safe, concurrent data storage.

## Python: The Core ML Programming Language

Python serves as the primary programming language for the Marin codebase, driving the bulk of the machine learning infrastructure including the Marin core, Iris telemetry, Levanter training framework, and Zephyr data-processing engine. The high-level API allows researchers to define experiments while the framework handles distributed execution.

In [`lib/zephyr/src/zephyr/worker.py`](https://github.com/marin-community/marin/blob/main/lib/zephyr/src/zephyr/worker.py), the core worker logic for the Zephyr data-processing engine demonstrates how Python orchestrates parallel data loading and preprocessing:

```python
def run_experiment(cfg: Dict[str, Any]) -> None:
    """Run a training experiment using the Marin pipeline."""
    from lib.marin import pipeline
    pipeline.run(cfg)

```

## Rust: Systems Programming for Performance

Rust powers performance-sensitive components such as the Finelog store and Iris services, providing memory safety and zero-cost abstractions for concurrent I/O operations. This systems programming language handles low-level storage mechanics while exposing safe interfaces to the Python runtime.

The entry point for the Iris Rust crate resides in [`lib/iris/rust/src/lib.rs`](https://github.com/marin-community/marin/blob/main/lib/iris/rust/src/lib.rs), which exposes telemetry and metric collection services to the broader Marin architecture:

```rust
pub fn open_store(path: &Path) -> Result<Store, StoreError> {
    let mut store = Store::new(path)?;
    store.load_metadata()?;
    Ok(store)
}

```

## JavaScript: Frontend Documentation Tooling

JavaScript supports frontend concerns within the Marin repository, specifically for rendering mathematical notation in documentation and powering Grafana dashboard panels used for monitoring training jobs. These components integrate with the project's documentation site and observability stack.

The file [`lib/levanter/docs/javascripts/mathjax.js`](https://github.com/marin-community/marin/blob/main/lib/levanter/docs/javascripts/mathjax.js) initializes MathJax for equation rendering in the Levanter documentation:

```javascript
document.addEventListener('DOMContentLoaded', () => {
  MathJax.typesetPromise();
});

```

## Shell: DevOps and Infrastructure Automation

Bash scripts automate provisioning, testing, and CI/CD workflows for TPU, GPU, and cloud environments. These programs handle environment setup, dependency installation, and test orchestration that sits outside the main application runtime.

The [`scripts/speedrun/onboarding_setup.sh`](https://github.com/marin-community/marin/blob/main/scripts/speedrun/onboarding_setup.sh) script orchestrates the developer onboarding environment, installing necessary dependencies for distributed training workflows:

```bash
#!/usr/bin/env bash
set -e
uv run lib/levanter/scripts/launch_gpt2_small_fast_tpu.sh

```

## Summary

- **Python** handles the majority of ML pipeline orchestration, data processing (Zephyr), and training infrastructure (Levanter) in files like [`lib/zephyr/src/zephyr/worker.py`](https://github.com/marin-community/marin/blob/main/lib/zephyr/src/zephyr/worker.py).
- **Rust** provides safe concurrency for the Finelog store and Iris telemetry services via [`lib/iris/rust/src/lib.rs`](https://github.com/marin-community/marin/blob/main/lib/iris/rust/src/lib.rs).
- **JavaScript** supports documentation rendering and monitoring dashboards, particularly in [`lib/levanter/docs/javascripts/mathjax.js`](https://github.com/marin-community/marin/blob/main/lib/levanter/docs/javascripts/mathjax.js).
- **Shell scripts** manage cloud provisioning and CI/CD automation through utilities like [`scripts/speedrun/onboarding_setup.sh`](https://github.com/marin-community/marin/blob/main/scripts/speedrun/onboarding_setup.sh).

## Frequently Asked Questions

### Is Marin primarily a Python project?

While Python handles the majority of the machine learning pipeline and user-facing APIs, Marin is fundamentally a multi-language project. According to the marin-community/marin source code, Rust manages performance-critical storage in the Finelog store, making the repository a true polyglot codebase rather than a pure Python application.

### Why does Marin use Rust alongside Python?

Rust provides safe concurrency and low-level I/O performance for components like the Iris telemetry service and Finelog storage backend. As implemented in [`lib/iris/rust/src/lib.rs`](https://github.com/marin-community/marin/blob/main/lib/iris/rust/src/lib.rs), Rust handles memory-intensive operations that would be less efficient in Python, while maintaining interoperability with the high-level ML orchestration layer.

### What are the main architectural components of Marin?

The repository comprises several integrated systems: Marin (core orchestration), Levanter (training infrastructure), Zephyr (data processing), Iris (metrics and telemetry), and Finelog (storage services). Each component leverages specific programming languages based on performance requirements, with Python dominating the ML layers and Rust handling systems programming tasks.

### Where are the primary entry points for contributors?

Python contributors should examine [`lib/zephyr/src/zephyr/worker.py`](https://github.com/marin-community/marin/blob/main/lib/zephyr/src/zephyr/worker.py) for data-processing logic, while systems engineers can start with [`lib/iris/rust/src/lib.rs`](https://github.com/marin-community/marin/blob/main/lib/iris/rust/src/lib.rs) for the Rust telemetry crate. Infrastructure automation resides in [`scripts/speedrun/onboarding_setup.sh`](https://github.com/marin-community/marin/blob/main/scripts/speedrun/onboarding_setup.sh), and documentation tooling is located in `lib/levanter/docs/javascripts/`.