Show HN: Sigil – A new programming language for AI agents

I've been working on a new programming language for AI agents. I would love your input on what makes programming languages good for AI agents, especially syntax, compiler, and tooling that could help AI agents write code.

What makes Sigil good for coding agents?

I've turned conventions into compiler rules whenever possible. The compiler owns the canonical printer and every AST has one accepted textual representation. For almost every syntax feature I tried to save tokens.

Order and naming conventions are enforced. No more "I think this argument is important so it should come first." Most things are alphabetical. Declarations are categorized and ordered alphabetically; parameters, effects, and record fields are alphabetical too. Types are UpperCamelCase. Everything else is lowerCamelCase, including file names.

No nulls. No undefined. Bidirectional type checking. No shadowing. Fat stdlib (still in progress). `sigil debug` supports replay, stepping, watches, and breakpoints. `sigil inspect` lets coding agents query the compiler directly, including proof surfaces.

Solver-backed refinements and contracts. Different languages already choose different numeric surfaces: byte, short, smallint, unsigned integers, etc. Sigil pushes that one step further: domain constraints can also define types. `where` lets a named type carry a predicate, and `requires` / `ensures` let functions carry proof obligations across call boundaries.

Here is a contrived example from the roguelite:

  t InventoryCount=Int where value≥0

  λspendArrow(arrows:InventoryCount)=>InventoryCount
  requires arrows>0
  ensures result≥0
  =arrows-1
Under the hood this is backed by Z3: https://github.com/z3prover/z3 But the surface stays ordinary Sigil syntax. There are no proof scripts and no user-facing SMT language.

No imports, rooted references only. In some languages you can import code and have name clashes, so there are many ways to specify imports. Sigil eliminates all of that by only using rooted references. I think this reduces agent churn because when the model sees a line, it does not have to go hunt for an import statement.

Service dependencies are declared in `src/topology.lib.sigil`, and environment bindings live in `config/<env>.lib.sigil`.

The language has special syntax for tests and they are run in parallel. Every project `src/*.lib.sigil` function must be tested, and if a function can return multiple cases, tests should exercise all of them. "World" is Sigil's model for effects. That is how mocks work: swap one effect for another and make assertions without exercising real external systems.

The compiler toolchain is written in Rust, and Sigil outputs to TypeScript, with a Foreign Function Interface to Node.js. See some small projects here https://inerte.github.io/sigil/projects/ - the Flashcards is useful to learn about Sigil features https://inerte.github.io/sigil/projects/sigil-flashcards/dem...

Caveat: I did NOT type a single line of code for the compiler toolchain. It was all generated with Claude Code and Codex. I run both with permissions dangerously skipped. This actual post I hand crafted every word.

There is also a toy roguelite written in Sigil. It is a work in progress, but it is proof that Sigil can support nontrivial project code. You can play with `pnpm sigil:run:roguelike`.

Repository: https://github.com/inerte/sigil

Website: https://inerte.github.io/sigil/

And I would love if you can find ways to lock down LLM / user programs even more. In Sigil, there should be only one way to do anything.

2 points | by inerte 1 hour ago

0 comments