The need for a formally verifiable mainstream programming language (opens external site)
View full thread · View on Hacker News
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
View full thread · View on Hacker News
I started Zena from wanting a TypeScript-like syntax that compiled to very efficient WebAssembly GC, and AssemblyScript had issues...
The motivation for targeting Wasm was as a good sandboxing and orchestration unit for AI-generated code. So, out of both general PL curiosity and enthusiasm, and an attempt to make a language that's good for AI generation, I started adding what I thought were the best features from other languages with a lot of focus on correctness, structure, and optimizability: pattern matching with exhaustiveness checking, ADTs and sum types via sealed classes, value types, async cancelation / structured concurrency, ownership and borrow checking for resources, unicode safe strings, and recently I added runtime contracts and I'll start on refinement types and some kind of proof system soon.
The idea is exactly to take a mainstream and familiar-looking language and add more cutting-edge and academic features that help with software correctness.
I wrote about some of this here, though not the formal methods parts: https://zena-lang.dev/blog/2026/09/languages-for-the-ai-era/
Replies (4)
edit: I looked at the features on the website, I don't see anything about multi-threading, is it supported? And how about interoperability with native libraries like SQLite/QT/etc?
Replies (1)
WebAssembly is pretty core to my main goals with Zena though: being able to run plugins, generated code, on-demand loaded apps, and other untrusted code is the whole reason why I use Wasm, and wanting a great language for Wasm is the whole reason I'm making Zena. Compiling to native would leave a lot of that out.
There's no multi-threading or any parallelism yet. Wasm GC doesn't support threads yet, and that's a while out if it ever lands, so we'll need some kind of worker/actor system. I don't just want to copy JS workers though, since those are so difficult to use. I'm much more interested in the type system encoding whether data is parallel-safe so I've been working on ownership/borrowing, value types, and immutable types to hopefully come together to form a one-writer / multi-reader, or shared immutable data, worker API, enforced by the type and borrow checker.
[1]: https://www.wingolog.org/archives/2025/10/30/wastrel-a-profl...
Replies (1)
Embarrassingly parallel?
Replies (1)
Replies (1)
Preserving that is one reason Zena has a very explicit import syntax and uses `this.x` like JavaScript: you have to name every symbol you import, and dereference all class members explicitly, precisely so you don't need other files to know if an identifier is valid.
In a non-shared-heap language like Zena (because of Wasm GC), the question then becomes if the serialization cost of collecting those results into the checker thread pays for parallel parsing. So far it doesn't, so I haven't built workers for Zena just yet. That'll probably happen when I make the checker parallel.
Replies (1)
This is the language I've wanted to make for many years, but it wasn't really tractable without a full team. This project would not be possible for me without LLMs.
Also, if we're talking about making a language that's better for AI-generation, it seems extremely reasonable that such a language might be built with AI, no? I would be surprised to find someone who wanted a great language to use with AI, but was a stickler about the language itself not being built with AI.
Replies (1)
As far as mainstream, I've usually taken that to mean in the same vein as mainstream languages, ie C++, Java, JavaScript, Python, Ruby, Rust, Swift, etc. Generally imperative, ALGO-style syntax, usually OOP + more and more functional, etc.
I'm designing Zena to be as mainstream and familiar as possible in that sense of the word. Obviously a new language isn't mainstream in terms of usage yet.
It's like a new band playing mainstream music. The band isn't itself "mainstream" at the beginning.