Hacker Newsnew | past | comments | ask | show | jobs | submit | hvoetsch's commentslogin

Hey HN,

  I've been thinking about why AI agents struggle with code generation — it's not the models, it's the languages. Every
  compiler was designed to output human-readable errors. Agents have to regex-scrape them, which breaks constantly.

  So I built Valea: a minimal systems language where the compiler speaks JSON by default.

  $ valea check program.va --json
  [{"code":"E201","message":"Function 'foo' returns bool but declared int","span":{"start":4,"end":7}}]

  Stable error codes (E201, E202...) mean an agent can branch on the code, not fragile string matching. Canonical
  formatter means two agents generating the same program always produce identical output. Targets C as output.

  The demo shows Claude autonomously:
  - Writing a program → hitting E001 (negative literal not supported) → inventing a workaround within the language
  constraints → emitting valid C
  - Building Fibonacci via pure function chaining (no loops, no recursion)
  - All without human intervention

  https://asciinema.org/a/834560

  Repo: https://github.com/hvoetsch/valea

  Still MVP — only functions, int/bool, addition, and zero-arg calls. But the compiler infrastructure (lexer, parser,
  type checker, C emitter, JSON diagnostics) is solid. Looking for feedback on the design direction before expanding the
   language surface.

  What would you add first: parameters, variables, or conditionals?


Hi HN,

I started experimenting with an idea:

What would a programming language look like if it was designed for autonomous coding agents as well as humans?

Most languages today assume a human is writing the code.

Valea explores:

- structured JSON compiler diagnostics - deterministic formatting - minimal syntax ambiguity - simple ownership rules - tooling designed for agents (AST export, diagnostics APIs)

The goal of the first milestone is simple: show that an AI agent can generate, repair, and compile a Valea program autonomously.

The compiler is still very early, but feedback on the idea and language design would be really helpful.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: