# AI Engineering from Scratch Programming Languages: Python, TypeScript, Rust, and Julia

> Explore AI Engineering from Scratch using Python, TypeScript, Rust, and Julia. Learn with a standard-library first approach in this comprehensive curriculum.

- Repository: [Rohit Ghumare/ai-engineering-from-scratch](https://github.com/rohitg00/ai-engineering-from-scratch)
- Tags: getting-started
- Published: 2026-07-27

---

**The AI Engineering from Scratch curriculum supports exactly four programming languages: Python, TypeScript, Rust, and Julia, each with strictly controlled standard-library-first dependencies.**

The open-source curriculum maintained in the `rohitg00/ai-engineering-from-scratch` repository adopts a **stdlib-first** philosophy to keep all 435 lessons focused on AI fundamentals rather than framework fragmentation. According to the repository's [`AGENTS.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/AGENTS.md) file, only these four languages are permitted, and each carries specific restrictions on third-party dependencies to ensure portability and conceptual clarity.

## Supported Programming Languages and Dependencies

The curriculum enforces a strict dependency policy through its [`AGENTS.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/AGENTS.md) configuration. Every lesson's `**Languages:**` metadata must correspond to a `main.*` file in its `code/` directory, and only the following languages and libraries are allowed:

| Language | Allowed Third-Party Dependencies |
|----------|----------------------------------|
| **Python** | `numpy`, `torch`, `h5py`, `zstandard`, `safetensors` |
| **TypeScript** | `hono`, `zod`, `ws` (WebSockets only), `@hono/node-server` |
| **Rust** | Standard library only (single-file `rustc --edition 2021`) |
| **Julia** | `Random`, `Statistics`, `LinearAlgebra`, `Printf` (stdlib modules) |

### Python

**Python** serves as the primary teaching language for machine learning concepts. While the standard library forms the base, the curriculum permits essential numerical and deep learning libraries including `numpy` for tensor operations and `torch` for neural network implementations. All Python lessons follow the `phases/<phase-id>/<lesson-slug>/code/main.py` file structure.

### TypeScript

**TypeScript** handles deployment and inference serving scenarios. The allowed dependencies reflect this focus: `hono` for lightweight HTTP servers, `zod` for runtime type validation, and `ws` for WebSocket communication. Lessons requiring Node.js 20+ standard library features must use the `@hono/node-server` adapter for compatibility.

### Rust

**Rust** appears in systems-level lessons emphasizing performance and memory safety. The curriculum restricts Rust to the standard library only, compiling single files with `rustc --edition 2021`. This constraint teaches manual memory management and zero-cost abstractions without external crate complexity.

### Julia

**Julia** supports numerical computing lessons requiring high-performance linear algebra. Rather than external packages, the curriculum utilizes Julia's built-in standard library modules: `Random` for stochastic processes, `Statistics` for descriptive metrics, `LinearAlgebra` for matrix operations, and `Printf` for formatted output.

## Code Execution Examples

Each supported language follows a consistent `main.*` entry point pattern within lesson directories. Below are minimal "Hello, AI!" implementations mirroring the typical `code/main.<ext>` layout used throughout the 435 lessons.

### Python Implementation

```python

# hello.py – minimal Python lesson demo

def main():
    print("Hello, AI Engineering from Scratch!")

if __name__ == "__main__":
    main()

```

Execute with: `python3 main.py`

### TypeScript Implementation

```typescript
// hello.ts – minimal TypeScript lesson demo
function main(): void {
  console.log("Hello, AI Engineering from Scratch!");
}

main();

```

Execute with: `npx tsx main.ts`

### Rust Implementation

```rust
// hello.rs – minimal Rust lesson demo
fn main() {
    println!("Hello, AI Engineering from Scratch!");
}

```

Execute with: `rustc main.rs && ./main`

### Julia Implementation

```julia

# hello.jl – minimal Julia lesson demo

println("Hello, AI Engineering from Scratch!")

```

Execute with: `julia main.jl`

## Language Compliance Enforcement

The repository maintains strict language consistency through automated validation and build processes. These key files enforce the four-language policy:

- **[`AGENTS.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/AGENTS.md)** — Defines the canonical language policy and permitted dependency matrix that all contributors must follow.

- **[`scripts/audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_lessons.py)** — Validates that every lesson's `**Languages:**` metadata field matches an existing [`main.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/main.py), [`main.ts`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/main.ts), [`main.rs`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/main.rs), or `main.jl` file in the lesson's `code/` directory.

- **[`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js)** — Generates the curriculum website's navigation and lesson data from metadata, ensuring language links remain consistent across all 435 lessons.

This enforcement guarantees that students encounter only the approved language stack, preventing dependency drift and maintaining the curriculum's pedagogical integrity.

## Summary

- The AI Engineering from Scratch curriculum supports **four languages only**: Python, TypeScript, Rust, and Julia.
- **Python** allows ML-focused libraries (`numpy`, `torch`, `h5py`, `zstandard`, `safetensors`) alongside the standard library.
- **TypeScript** permits web-serving dependencies (`hono`, `zod`, `ws`, `@hono/node-server`) for Node.js 20+ environments.
- **Rust** is restricted to the standard library only, using single-file compilation with `rustc --edition 2021`.
- **Julia** utilizes standard library modules (`Random`, `Statistics`, `LinearAlgebra`, `Printf`) without external packages.
- Compliance is enforced via [`scripts/audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_lessons.py) and documented in [`AGENTS.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/AGENTS.md).

## Frequently Asked Questions

### Does the curriculum support languages like Go or C++?

No. The `rohitg00/ai-engineering-from-scratch` repository explicitly limits implementations to Python, TypeScript, Rust, and Julia as defined in [`AGENTS.md`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/AGENTS.md). The [`scripts/audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_lessons.py) validation script will reject lessons containing [`main.go`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/main.go), [`main.cpp`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/main.cpp), or other non-approved entry points.

### Can I use additional Python packages beyond the allowed list?

No. The curriculum maintains a strict stdlib-first policy. Only `numpy`, `torch`, `h5py`, `zstandard`, and `safetensors` are permitted alongside Python's standard library. This restriction ensures lessons remain focused on fundamental AI engineering concepts rather than framework-specific abstractions.

### Why is Rust limited to the standard library only?

The Rust constraint enforces systems programming fundamentals. By restricting lessons to `rustc --edition 2021` with zero external crates, the curriculum teaches manual memory management, borrowing concepts, and zero-cost abstractions without the complexity of Cargo-based dependency resolution.

### How are the language restrictions enforced across 435 lessons?

The repository uses [`scripts/audit_lessons.py`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/scripts/audit_lessons.py) to validate that every lesson's metadata matches its `code/` directory contents. Additionally, [`site/build.js`](https://github.com/rohitg00/ai-engineering-from-scratch/blob/main/site/build.js) generates the published site from these validated sources, ensuring the four-language policy remains consistent throughout the entire curriculum.