How the AI-Engineering Curriculum Supports Multiple Programming Languages: Python, TypeScript, Rust, and Julia
The curriculum uses a language-agnostic lesson contract with parallel code folders and front-matter declarations to support Python, TypeScript, Rust, and Julia implementations of the same algorithms.
The rohitg00/ai-engineering-from-scratch repository teaches AI engineering concepts through a unique multi-language approach that lets learners compare implementations across runtimes. By standardizing how lessons declare and organize their code, the curriculum ensures that the same algorithmic ideas can be expressed in Python, TypeScript, Rust, or Julia without duplicating the underlying lesson structure.
Language-Agnostic Lesson Structure
At the heart of the multi-language support is a strict contract defined in LESSON_TEMPLATE.md. Every lesson must include a code/ directory that houses language-specific implementations using standardized filenames: main.py, main.ts, main.rs, and main.jl【LESSON_TEMPLATE.md†L12-L31】.
This convention allows the curriculum to maintain a single lesson narrative while providing runnable examples in each supported language. When a lesson covers algorithms like linear algebra operations, the corresponding source files appear side-by-side in the same directory. For instance, the "Linear Algebra – Intuition" lesson contains both vectors.py and vectors.jl in its code/ folder【glob result†L1-L2】.
Explicit Language Declaration
Language support is not merely implicit in the file structure; it is formally declared in each lesson's documentation. The docs/en.md file for every lesson includes a front-matter field labeled **Languages:** that enumerates which implementations are available【grep result 1†L6-L7】.
According to AGENTS.md, this field must match the actual main.* files present in the code/ directory, and this rule is enforced by the repository's audit tooling【AGENTS.md†L73-L81】. This ensures consistency between what the documentation promises and what the code delivers.
Cross-Language Implementation Example
The dot-product implementation demonstrates how the same algorithm translates across languages. Both versions live side-by-side in the lesson directory and produce identical results.
Python (vectors.py):
def dot(a, b):
"""Return the dot product of two equal-length vectors."""
return sum(x * y for x, y in zip(a, b))
print(dot([1, 2, 3], [4, 5, 6])) # → 32
Julia (vectors.jl):
dot(a, b) = sum(x * y for (x, y) in zip(a, b))
println(dot([1, 2, 3], [4, 5, 6])) # → 32
Both files reside in phases/01-math-foundations/01-linear-algebra-intuition/code/, and the lesson's front-matter lists Python, Julia as the supported languages【grep result 2†L6-L7】. TypeScript and Rust implementations follow the same side-by-side pattern where available.
Dependency and Standard Library Policy
To ensure algorithms can be written from first principles across all runtimes, the curriculum enforces a strict dependency policy. As specified in AGENTS.md, each language is limited to its standard library (in the case of Rust) or a small whitelist of approved packages (for Python, TypeScript, and Julia)【AGENTS.md†L56-L61】.
This constraint prevents language-specific framework dependencies from complicating cross-language comparisons. Learners can focus on core algorithmic differences rather than external library syntax.
Development Environment Setup
The curriculum provides explicit tooling guidance to ensure learners can run code in any of the supported languages. The "Dev-environment" lesson in phases/00-setup-and-tooling/01-dev-environment/docs/en.md walks through installing Python 3.11+, Node 20+ (for TypeScript), Rust, and Julia【README.md†L22-L23】【README.md†L39-L41】.
This comprehensive setup guide ensures that the multi-language support is practical, not just theoretical. Learners can execute main.ts files alongside main.rs files without switching contexts or repositories.
Summary
- Standardized file structure: The
code/folder in each lesson containsmain.py,main.ts,main.rs, andmain.jlfiles according toLESSON_TEMPLATE.md. - Front-matter validation: The
**Languages:**field indocs/en.mdexplicitly declares which languages are implemented, enforced by audit tooling perAGENTS.md. - Side-by-side comparisons: Algorithms like the dot-product appear in multiple languages within the same lesson directory, enabling direct comparison of idioms and performance.
- Standard library focus: A strict dependency policy limits each language to core capabilities, ensuring first-principles implementations.
- Unified setup: The dev-environment lesson configures Python, TypeScript (Node), Rust, and Julia runtimes in a single workflow.
Frequently Asked Questions
How does the curriculum ensure consistency across language implementations?
The repository uses automated validation rules defined in AGENTS.md that require the **Languages:** front-matter field to match the actual main.* files present in the lesson's code/ directory【AGENTS.md†L73-L81】. This audit tooling prevents documentation from claiming support for a language that lacks a corresponding implementation file.
Can I complete the curriculum using only one programming language?
Yes, each lesson is self-contained within its language-specific files. While the curriculum supports multiple programming languages to facilitate comparison, you can focus exclusively on the main.py, main.rs, main.jl, or main.ts files without requiring knowledge of the other languages【LESSON_TEMPLATE.md†L12-L31】.
What version requirements exist for the supported languages?
The dev-environment lesson specifies Python 3.11+, Node 20+ (for TypeScript), Rust, and Julia as the required runtime versions【README.md†L22-L23】【README.md†L39-L41】. These versions ensure compatibility with the standard library features used in the curriculum's dependency-free approach.
Why does the curriculum restrict external dependencies?
According to AGENTS.md, limiting each language to its standard library (or a minimal whitelist) ensures that the same algorithm can be implemented from first principles across all runtimes【AGENTS.md†L56-L61】. This policy eliminates framework-specific complexity and keeps the focus on language syntax and performance characteristics rather than third-party library differences.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →