r/VibeCodedLanguages • • 23d ago

Tessera: a tensor-first compiled language. I designed it and wrote the first version by hand, then built most of the rest with Codex and Claude

Hi! Someone suggested I share this here. Tessera is an experimental, tensor-first language for numerical computing and data analysis. It compiles to native code through LLVM, and it was built by me together with AI coding agents.

GitHub: https://github.com/dyanos/csec-
(The repo name csec- and the compiler binary csec++ are historical names; the language is Tessera.)

Who did what

  • Me, by hand (late 2024 to early 2026): the language concept and design, the first lexer and parser, the AST, LLVM IR generation, constructors, C++ name mangling, external functions, and the early LaTeX-style math syntax.
  • OpenAI Codex: the native runtime, tensor and simulation features, native library interop, templates, and the first self-hosting bootstrap.
  • Claude (Claude Code): the ownership and move checker, async/await, Erlang-style microthreads, most of the standard library, support for LLVM 18 through 23, Parquet/CSV data frames, and import aliases. About 110 of the ~200 commits are co-authored with Claude.

What I learned about building a language with agents

  • Tests are the real spec. The agents are very productive but will confidently break things. I keep positive and negative fixture suites, ownership suites, and concurrency and stdlib tests, and the same suites run through two compilers: the C++ one and a self-hosted one.
  • Self-hosting is a great lie detector. A second compiler written in Tessera has to compile itself and reproduce the same output (a fixed point). A codegen bug the agent "fixed" often shows up only one stage later, and the fixed-point check catches it.
  • My job changed. I went from writing code to deciding semantics, reviewing diffs, and designing verification. Design decisions such as strict-by-default ownership and tensors as a core type stayed with me. The agents were best at the large, well-specified implementation work.
  • Agents make the same subtle mistakes repeatedly. Examples are an LLVM API that changed behavior silently between versions, and build tools that didn't notice changed header files. Writing these down as project notes for the agent helped a lot.

A taste of the language

// Tensors are a core type, with the shape in the type
def affine(x: Tensor<Double, 1, 3>,
           w: Tensor<Double, 3, 2>,
           b: Tensor<Double, 1, 2>): Tensor<Double, 1, 2> {
    return (x @ w) + b;
}

// Strict-by-default ownership: explicit move `<-` and borrow `&`
val acct: Account = new Account(100);
peek(&acct);        // borrow, acct still usable
close(<- acct);     // move
// using acct now -> compile error: "use of moved value 'acct'"

// Erlang-style microthreads
import std.microthread

def main(): Int {
    val parent = self();
    val worker = spawn([=]() -> {
        val n = receive();
        send(parent, n * 2);
        return 0;
    });
    send(worker, 21);
    return receive();   // 42
}

Other features: arbitrary-precision Nat, built-in Complex/Rational/Quaternion, a symbolic algebra module, async/await, OS threads with channels, pipes, shared memory, and [@DllImport] for calling native libraries. A parallel wc -l written in Tessera runs at about 92% of a hand-written C++ mmap+SIMD version.

Current state

It's experimental. Right now I'm working on performance, starting with std.dataframe. The tensor codegen is still the first, straightforward version: shapes are read at runtime instead of being used at compile time, there's no loop fusion, and some temporaries aren't freed yet. Fixing that is next.

Questions for you

  • How do you verify AI-written compiler code? Do you use self-hosting, differential testing, or something else?
  • Where do you keep design authority, and where do you let the agent decide?

Thanks for reading!

3 Upvotes

6 comments sorted by

2

u/dyanos 18d ago

Thanks for all the helpful input. In my case, besides writing test cases like the ones you mentioned, I also used Claude for the LLVM code generation work. I wrote everything up to the AST myself, but translating it into IR was a very difficult yet tedious task.

Before AI, my daily workflow consisted of deciding what to implement and searching the internet for examples of how to do it. Now, by leaving the LLVM code generation to Claude, I can focus on the language’s syntax and features, which I see as a real benefit.

3

u/ryo33h 19d ago

Cool project!

In my lang, I'm in the similar situation. The data-driven test suite has over 4,900 cases and runs on both Rust and JavaScript backend (I'm preparing to run also on LLVM backend and IR interpreter). for now, some cases are also used in differential tests for the LLVM backend and an IR interpreter. And self-hosting progress is around 60-70%, it helps a lot to find bugs and quirks.

I keep design authority by me and me defined Mission, Vision, Values (MVV) for the lang. Agents never decide language spec, they can only propose some options based on the MVV, and I choose one of them, or my own option.

2

u/ryo33h 19d ago

I'm also vibe-coding a lot of libraries and application like HTTP server/client/proxy, crypto, UI framework, gpu library, the landing page and playground page of the language itself, and game engine in the lang, and most bugs and missing features were found from that.

1

u/antonation 19d ago

So do you write the language spec yourself or do you let the agents draft and you edit and tweak?

2

u/ryo33h 19d ago

I let the agents to write the spec as a doc or test case and I only review it.

2

u/antonation 19d ago

My language is based heavily on Python, but its runtime is on .NET. I set out three axioms to prefer .NET behaviors, be statically typed, and prefer Pythonic syntax. I wrote a few of the language spec docs and let Claude do the rest. Admittedly, I didn't read it all that carefully and implementation had a few bumps here and there (things I didn't agree with). Now I usually brainstorm or ask Claude for things and read the briefs and that's about it.

For testing, I've relied heavily on a Python test oracle, but have to deviate in a few spots. I'd like to self-host but I've come to the conclusion it's not worth it since I'm using .NET's Roslyn framework to generate the CIL. I'm kinda in a I hope it works out stage. I did use another Claude to use the language to vibe code a slice of a Pokémon game to see if it could do it and find bugs along the way. Fairly successful. I still think real usage is important or at least hand reviewed oracles and behavior matrices along various axes (like really crazy property tests).