Back to browse
GitHub Repository

A programming language for tensor computations with Einstein notation.

10 starsPython

Einlang, a math-intuitive language with lots of good stuff

by amazing42·Apr 20, 2026·4 points·0 comments

AI Analysis

●●SolidBig BrainNiche Gem

Einstein notation with @loss/@x autodiff syntax beats switching to separate JAX APIs.

Strengths
  • Compile-time shape and index structure checking catches tensor bugs before runtime.
  • Autodiff lives in the language itself instead of requiring separate gradient APIs.
  • Recurrence and ODE support extends beyond basic tensor operations.
Weaknesses
  • Very early stage with only 7 stars and 60 commits on GitHub.
  • Python-based interpreter limits performance compared to compiled alternatives like Taichi.
Target Audience

ML researchers, numerical computing developers, scientists writing tensor code

Similar To

JAX · Taichi · PyTorch

Post Description

With Einlang, you can write codes as

let x = [

[[1.0, 2.0], [3.0, 4.0]],

[[5.0, 6.0], [7.0, 8.0]]

];

let row_sums[..batch, i] = sum[j](x[..batch, i, j]);

let loss = sum[..batch, i](row_sums[..batch, i] * row_sums[..batch, i]);

let dloss_dx = @loss / @x;

Einlang also supports recurrence. You can write codes like

let alpha = 0.25;

let x[0] = 8.0;

let x[k in 1..6] = {

let prev = x[k - 1];

let loss = prev * prev;

let g = @loss / @prev;

prev - alpha * g

};

Similar Projects

Sapphire – A portable language with native UI and 3D vectors

Yet another systems language competing with Zig, Odin, and V in an extremely crowded space.

CozyNiche Gem
foxz
302mo ago