PLJun 16

Behind Python: The Languages That Power AI

arXiv:2606.181410.9
Predicted impact top 95% in PL · last 90 daysOriginality Synthesis-oriented
AI Analysis

For AI developers needing to implement algorithms without existing libraries, this provides concrete, per-workload performance and memory guidance for language selection.

This paper empirically compares Python, C, C++, Rust, Go, and Julia for implementing five AI algorithms from scratch, finding that C and C++ are fastest, Rust trails by 9%, Julia is 3.3x slower, Go 5.0x slower, and Python 315x slower, with memory footprints varying significantly.

Python dominates AI development, yet the numerical work behind frameworks like PyTorch and NumPy is executed in C, C++, or Rust. When a developer must implement an algorithm without such libraries -- because none exists, the target is resource-constrained, or a new system is being built -- which language should they choose? This paper answers that question empirically. Five algorithms covering data mining (k-means), machine learning (k-NN), neural networks (MLP with backpropagation), computational intelligence (genetic algorithm), and fuzzy systems (Mamdani inference) are implemented from scratch in Python, C, C++, Rust, Go, and Julia. All implementations share a common pseudo-random generator, consume identical inputs, and produce bit-identical outputs, so every measured difference reflects the language rather than the computation. Three performance tiers emerge: C and C++ are effectively tied; Rust trails them by 9% (geometric mean); Julia runs 3.3x slower than C and Go 5.0x; Python sits at 315x. Memory tells a different story -- Julia's JIT runtime carries a fixed ~224 MiB footprint regardless of workload, while C, C++, and Rust stay below 6 MiB. Crucially, rankings are not stable: Go's slowdown swings from 2.6x on k-NN to 8.0x on k-means, showing that workload characteristics can shift a language's position by a full tier. The results provide concrete, per-workload guidance for choosing an implementation language in AI systems.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes