# What Is the Primary Programming Language of the macro-inc/macro Repository?

> Discover the primary programming language of the macro-inc/macro repository. Explore the Rust codebase, organized as a Cargo workspace with numerous internal crates and async services.

- Repository: [Macro/macro](https://github.com/macro-inc/macro)
- Tags: faq
- Published: 2026-08-15

---

**The macro-inc/macro codebase is written primarily in Rust, organized as a Cargo workspace containing dozens of internal crates and async services.**

The macro-inc/macro project relies on Rust as its principal programming language to deliver high-performance, type-safe infrastructure. In the repository's root [`Cargo.toml`](https://github.com/macro-inc/macro/blob/main/Cargo.toml), the codebase declares a Cargo workspace—a Rust-specific build system—that manages dependencies across the entire project. This architecture spans thousands of `*.rs` source files organized under `crates/` and `services/` directories, demonstrating a comprehensive commitment to the Rust ecosystem.

## Evidence from the Workspace Configuration

The primary indicator of Rust's dominance appears in the repository's build configuration. The root **[`Cargo.toml`](https://github.com/macro-inc/macro/blob/main/Cargo.toml)** defines a Cargo workspace that lists numerous internal crates and service binaries, establishing Rust as the sole language for compilation and dependency management. Unlike polyglot repositories that mix build systems, macro-inc/macro relies exclusively on Cargo for building, testing, and packaging.

Within this workspace, the source tree organizes Rust modules hierarchically. For example, [`crates/agent/src/lib.rs`](https://github.com/macro-inc/macro/blob/main/crates/agent/src/lib.rs) exposes core Agent APIs using standard Rust module patterns, while [`services/email_service/src/main.rs`](https://github.com/macro-inc/macro/blob/main/services/email_service/src/main.rs) implements async HTTP servers. All third-party dependencies—including `axum`, `tokio`, and `sqlx`—are standard Rust crates referenced in the workspace's dependency table.

## Key Architectural Components

The repository leverages Rust's async/await capabilities and type system across several architectural layers. The codebase splits functionality between reusable library crates and standalone service binaries, all written in Rust.

### Async Runtime and Web Frameworks

Services in the macro-inc/macro repository typically use **Tokio** for asynchronous runtime capabilities and **Axum** for HTTP handling. The `email_service` demonstrates this pattern by binding an Axum router to a TCP listener:

```rust
// main.rs – entry point for the email service
use axum::{Router, routing::post};
use macro_email_service::handlers::send_email;

#[tokio::main]
async fn main() {
    // Build the Axum router
    let app = Router::new().route("/send", post(send_email));

    // Run the server (listening on 0.0.0.0:8080)
    axum::Server::bind(&"0.0.0.0:8080".parse().unwrap())
        .serve(app.into_make_service())
        .await
        .unwrap();
}

```

This implementation, located in [`services/email_service/src/main.rs`](https://github.com/macro-inc/macro/blob/main/services/email_service/src/main.rs) according to the macro-inc/macro source code, showcases the standard Rust pattern for building high-concurrency network services.

### Database Integration with SQLx

Data persistence layers utilize **SQLx** for type-safe SQL queries. The `comms_db_client` crate defines models using derive macros that map Rust structs to database tables:

```rust
use sqlx::FromRow;

#[derive(Debug, FromRow)]
pub struct User {
    pub id: uuid::Uuid,
    pub email: String,
    pub created_at: chrono::DateTime<chrono::Utc>,
}

```

You can find similar struct definitions in [`crates/comms_db_client/src/models.rs`](https://github.com/macro-inc/macro/blob/main/crates/comms_db_client/src/models.rs), illustrating how the repository uses Rust's type system to enforce database schema contracts at compile time.

### Observability and Tracing Libraries

The project implements distributed tracing through custom Rust crates like `worker-rs-otel`. Located in [`crates/worker-rs-otel/src/lib.rs`](https://github.com/macro-inc/macro/blob/main/crates/worker-rs-otel/src/lib.rs), this library provides OpenTelemetry integration:

```rust
use worker_rs_otel::layer::OtelLayer;
use tracing_subscriber::{registry::Registry, prelude::*};

fn init_tracing() {
    let otel = OtelLayer::new();
    Registry::default()
        .with(otel)
        .with(tracing_subscriber::fmt::layer())
        .init();
}

```

This pattern extends the Rust `tracing` ecosystem to support cloud-native observability requirements across all services. Additional utility crates like [`crates/webhook/src/lib.rs`](https://github.com/macro-inc/macro/blob/main/crates/webhook/src/lib.rs) provide HTTP client functionality using pure Rust networking libraries.

## Summary

- **Rust is the sole primary language** in the macro-inc/macro repository, with all source code residing in `.rs` files managed by Cargo.
- The **Cargo workspace** declared in the root [`Cargo.toml`](https://github.com/macro-inc/macro/blob/main/Cargo.toml) organizes dozens of internal crates under `crates/` and service binaries under `services/`.
- The codebase leverages **async Rust** with Tokio and Axum for HTTP services, SQLx for database connectivity, and custom crates for OpenTelemetry tracing.
- Key implementation files include [`crates/agent/src/lib.rs`](https://github.com/macro-inc/macro/blob/main/crates/agent/src/lib.rs) for core APIs and [`services/email_service/src/main.rs`](https://github.com/macro-inc/macro/blob/main/services/email_service/src/main.rs) for service entry points.

## Frequently Asked Questions

### Is the macro-inc/macro repository written entirely in Rust?

Yes, according to the source code analysis, the macro-inc/macro repository uses Rust as its exclusive programming language for all business logic, services, and tooling. The presence of a root [`Cargo.toml`](https://github.com/macro-inc/macro/blob/main/Cargo.toml) workspace file and the absence of other language build systems confirm that Rust drives the entire architecture.

### What Rust web framework does macro-inc/macro use?

The repository primarily uses **Axum** for HTTP service implementation, paired with the **Tokio** async runtime. You can see this combination in [`services/email_service/src/main.rs`](https://github.com/macro-inc/macro/blob/main/services/email_service/src/main.rs), where `#[tokio::main]` initializes the runtime and `axum::Server` binds the application router to network sockets.

### How is the macro-inc/macro repository structured?

The repository follows a Cargo workspace pattern with two main directories: `crates/` containing reusable library code (such as `agent`, `webhook`, and `worker-rs-otel`) and `services/` containing standalone binary applications (such as `email_service`). This structure allows shared logic to reside in library crates while service-specific code handles deployment boundaries.

### Does the project use Rust's async/await features?

Yes, the codebase extensively uses Rust's async/await syntax for handling concurrent operations. Services leverage `#[tokio::main]` entry points and async function signatures throughout, particularly visible in network service implementations and database clients that require non-blocking I/O operations.