An experimental language: types have contracts that an SMT solver proves or a fuzzer tests, code is stored as its syntax tree, and every edit is checked before it is stored.

3 points•anonx3247•about 2 hours ago•0 comments•
I've been working a lot with agents as they've become more and more capable over the last year or so and its clear agents have predictable failure modes: they write endless tests that they then update on each PR (thus invalidating our trusts in tests), they waste a considerable amount of resources re-learning the repo on each launch and their lack of continual learning and of session to session context makes if difficult for them to work on large projects without context on why things are as they are, and on ensuring invariants and processes work as we expect them to. More than anything I look at the lines of code less and less, or with a less watchful eye, implementation details never mattered as much as contracts, type relations and models. That is chiefly why we do encapsulation (whether through OOP, Traits, or through Generics doesn't matter here).

For an agent to be able to work effectively I believe we need 3 things: 1. Strong Static Types that are refined enough to cut out a huge amount of errors and useless tests. 2. Proofs within the language for larger over-arching relations of types and to ensure invariants and assumptions are not only written in code (and not in comments), but are validated and compiled. And finally moving away from text as the basis for code, instead working directly with the AST to show progressive detail in a manner more befitting of code than a large amount of `greps` and `Read` calls an agent will inevitably do. Strata tries to explore all three of these ideas by using a mix of static type analysis, SMT solving (with Z3) and its own tactics-based language inspired by Lean for proofs.

I built the first version in about 4 days (full disclosure, I have not read the code, instead I have read the traits, types, and invariants, and did my best to guide the agent, I talk more about this on the `about` page), and have experimented a lot over about a week, now trying to build a new version from a new spec (viewable on the website), based on what I've learned.

The current version is fully self-hosted (first bootstrapped with Rust), through LLVM and has been tested on macOS arm64 and is very much a prototype.

I'd especially like feedback on the design, on the verification system, as I'm by any means not an expert in SMT solvers or Lean, and on working without a text-based code, which is another idea I'm still very much exploring.

0 comments

No comments yet.

Read the full thread on Hacker News →

Related stories