
Making a programming language - BAML. @boundaryml, π¦ aitw podcast: https://www.nitter.cf/t.co/g4CJWgP0gR prev YC, google, msft, deshaw, and other things
Seattle, WA
Joined September 2012
- Tweets1.7K
- Following572
- Followers4K
- Likes1.5K
Vaibhav Gupta retweeted
Everything that you hate about agentic coding in Typescript, Python, Rust or Go, BAML does it well.
That's what BAML is. β at Vigo, Spain
Replying to @Burhann941
its a language designed to provide maximal feedback back to agents.
* type system like rust
* fast compile times
* fast code search
* fast testing
* small binaries
* hyperobervability
* easy concurrency
* supports typesafe eval for safely executing llm generated code at runtime
* runs everywhere (wasm, edge, any os)
* can be incrementally adopted (within an existing code base of python/ts/go/rust/etc) or run standalone
and very soon, a very fast runtime
Vaibhav Gupta retweeted
Hyperobservability is observability that is always on, by default, for everything.
Sub 10 nanosecond overhead per function call π β at Vigo, Spain
existing tracing analytics will not scale for agents. we need hyperobservability and databases built to handle it.
what does a native agent first tracing system look like?
* affordability even when tracing everything
* virtually no latency impact (<10ns)
* allows for dynamically adjusting what is traced
* has to map it to source code
* has to mirror your codebases typesystem in the database
* has to make everything queriable to an agent
* queries have to be fast
boundaryml.com
Vaibhav Gupta retweeted
verification folks we got a good on for ya - had a great yap with @vaibcode and @codeshaunted on deterministic code quality linters like cognitive complexity, npath, traversal depth, etc - super fun
Vaibhav Gupta retweeted
Replying to @vaibcode
Be ambitious with your prompts:
Delete half the code and increase speed 10x
Otherwise you're ngmi
Vaibhav Gupta retweeted
Taking over someone else's unfinished work in 2022:
Open GitHub, there's a PR there.
+673 -241 diff.
Checkout the branch, run tests.
They pass.
Spend 2 hours reading the code to understand it.
There's a weird if statement that you don't understand why it's there.
You ask the coworker who opened the PR.
He says it's because some obscure payload field can be null and now it all makes sense, you understand all the code.
Read the ticket again to see what's missing and write rest of code.
+871 -308 final diff.
Merge PR.
β
Done.
Taking over someone else's work in 2026:
Open GitHub. There's a PR there.
+87341 -32651 diff.
Tell Claude to read the ticket and see what's left.
Claude comes up with 5 bullet points of what's left to do. You understand none of them.
There are 15 markdown files in the PR your coworker's agent dumped for future context.
You open them. 3000 lines each. You understand none of it.
Ask Claude to explain it like you're 5.
Claude outputs words that are coherent but you still understand none of it.
You tell Claude to make diagrams to explain the architecture.
A tiny bit of it starts making sense.
There's some weird service "Transactional Reconciliation Service" you don't understand why it's there. Claude says it shouldn't be there and the markdown files don't specify why it's there.
You ask the coworker about that service.
He has no idea what you're talking about, he needs to ask his agent.
His Claude makes an artifact that explains why that service is slop that was written by the subagent who implemented it and shouldn't be there at all.
The coworker hands that artifact to you. He hasn't read it.
You hand the artifact to your Claude. Your Claude advices to remove the service and proposes 4 different solutions to replace it.
You understand none of the solutions but there is one which seems to make more sense. You ask the coworker if that's a good call.
He has no idea what any of that means, he asks his agent. His agent says it's a good solution but it's missing an important edge case. He copy pastes the agent output in Slack.
You copy paste the Slack message into your Claude. Your Claude says that you're absolutely right, that this is an important edge case that was not handled in the initial solution. Claude proposes a small fix to cover it and asks if it should implement it along with the other 5 bullet points.
You say ok, Claude starts writing code. PR diff grows to +97564 -41698.
You ask Claude if everything in the ticket is implemented. Claude starts reviewing the code.
Claude says that most of it is implemented, but comes up with 5 bullet points of things that are missing.
You are confused, it already came up with 5 bullet points the first time you asked. These seem different bullet points that only came up after reviewing the code though, so you say ok, implement it.
Claude writes code.
PR +102467 -45790 diff.
You ask if now it's all done.
Claude reviews the code. Says it's mostly done but there 3 low priority items that are not yet implemented.
You don't understand any of the items but since they're low priority you figure out they don't matter much, so you click merge.
PR spends 3 hours in the merge queue for CI to go green, then it merges.
Next Monday your coworker asks his agent to deploy to AWS.
Your agent's code now runs in production.
2 hours later the whole backend is down. No one knows why.
Your coworker asks his agent to investigate. After 20 minutes it finds the code that threw an unhandled error when some payload came up with an obscure null field.
Your coworker doesn't recognize any of that code and his agent says it should not be there but you wrote it so your coworker should check with you first.
He asks you about that code.
You've never seen that code in your entire life.
You ask your agent about it.
Your Claude says the error was thrown because the code never expected that obscure field to be null.
The code was in "Transactional Reconciliation Service".
Vaibhav Gupta retweeted
As a programming language nerd that's been working on a programming language for 2+ years, allow me to explain in my own words why "writing a programming language" is not fairly easy.
The first problem that you have to solve is turning the nice highlighted text that you see in the code editor into something that the CPU can actually run.
Programming languages here fall into 3 big categories:
1. Compiled languages.
2. Interpreted languages.
3. A mix of both.
Let's start with compiled languages, which may be the most obvious way of solving this problem for someone who doesn't understand much about how computers work.
The CPU runs something called "machine code", which is basically a sequence of very simple instructions, for example:
1. add two numbers
2. store the result in memory
3. subtract a new number from it
4. compare that number with 10
5. go back to step 1 if they're different
6. read a new number from memory
7. read a second number from memory
8. multiply those two numbers
...
It sounds hard to believe when you don't understand in depth how computers work but these are the instructions behind anything you could imagine: Twitter, GTA VI, Falcon 9, the doom scrolling algorithm on Instagram reels, and the neural network behind ChatgGPT.
These instructions are encoded in a binary format, CPUs only work with ones and zeros.
For example, in x86 machine code, which AMD and Intel use, "add two numbers" would be something like:
01001000 00000001 11011000
In ARM assembly, which smartphones and the new MacBooks from Apple use, it would be:
10001011 00000010 00000000 00100000
Writing binary code is so tedious and error-prone (a single wrong 0 or 1 makes the whole program wrong) that engineers invented "assembly" to make it easier, which is more similar to English. Instructions for adding and subtracting numbers, in ARM, are:
πππ ππ·, ππΈ, ππΉ
πππ ππΉ, [π‘πΉ]
πππ ππΉ, ππΊ, ππΉ
πππ ππΊ, π·0
These are "mnemonics" for add, store, subtract and compare. The "r1, r2, r3" are registers, that is where CPUs can store numbers and you have limited amount of them, for example 16 in AMD/Intel CPUs. And the x3 on the store instruction is a memory location, in memory you can store gigabytes of data but in the CPU you can only work with however many registers you have.
This is important because reading and writing to memory is slow.
Still, as a human, I don't want to be writing "compare this number with 10", I wanna be able to easily express something like "apply a discount if the cart has more than 10 items".
That is what a programming language does for you. You can write something like:
ππ ππππ.ππππ.πππππ.πππππ() > π·0 {
ππππ.ππππ.πππππ’_ππππππππ()
}
Which for any human is orders of magnitude easier to read and reason about than any machine code or assembly code.
Still, that nice if statement right there has to be converted into machine code to run on the CPU. And not only into one machine code, if you want your code to run everywhere, on a Windows PC, on a Mac, on a server... It has to be converted into multiple types of machine code, one for each target.
Now the question becomes "how". How do you go from something that kinda looks like English to ones and zeros?
First step is "parsing". You need to write a program that reads that text, which is a formal grammar with the "100 rules" that you are imagining, and turn it into something that you can later turn into machine code.
Usually it goes through multiple stages, imagine this as a factory where if you want a brick first you need to extract the raw materials, then process them to make a new material that later can be converted into bricks.
Or imagine it like crafting in Minecraft.
The "material" that the parser extracts is an "Abstract Syntax Tree". That is essentially a data structure stored in memory (it's basically organized data in memory instead of text), which makes your program easier to process. π§΅
Vaibhav Gupta retweeted
BAML now goes brrrrr
Damn @HarivanshRathi came here to cook π
BAML compiles to both Rust and its custom BEX VM bytecode.
BAML used to be in the same league as Python when it comes to perf, but it's only a matter of time till it plays in the same league as GoβοΈ
Vaibhav Gupta retweeted
Everyone in AI is building for everyone else in AI.
We're building for your group chat.
Introducing Charming β¨ Personal apps for us normies.
Make an app for your book club, a meal planner for your family, go wild (it's free!)
Build in Claude/ChatGPT, share like a Google Doc
Vaibhav Gupta retweeted
if only someone were building a programming language for this new era
DHH is fundamentally right about Rust. For context, Vercel has been undergoing a Rust-ification (carcinization, technically π¦) for a while.
One of the first projects we migrated was Turborepo, from Go to RustΒΉ. The migration completed, but the RoI was actually quite controversial internally.
While Rust was in our eyes better for low-level OS access, something crucial for a build system like Turbo, the human migration costs were very sustantive.
Go is very fast. It's beautifully designed. It's easy to iterate on. We were very conflicted about the migration, because it was *humans* writing the code, *even if we knew Rust was a better choice*.
The calculus has now changed. What's "best for humans" is no longer necessarily "best for business".
FWIW, it's also quite unlikely that Rust is the end-all-be-all toolchain. I'm quite certain there's greener pasture ahead, because Rust itself was designed before the 'supersonic tsunami' of agents hit.
ΒΉ httpsβ://vercel.com/blog/how-turborepo-is-porting-from-go-to-rust
Vaibhav Gupta retweeted
Super fun chatting with @vaibcode @dex about how we replaced BI with AI Agents we built in GrowthOS at Rippling
youtu.be/bGMiRmXbRUs?is=ukicβ¦
Vaibhav Gupta retweeted
Replying to @HanchungLee @snellingio
schema-constrainted generation has/had downsides.
@boundaryML's take from last year:
boundaryml.com/blog/structurβ¦
@vaibcode, founder + team have worked on just this problem, 99% OSS, just added Veb support.
@HanchungLee thoughts?
Vaibhav Gupta retweeted
Had great fun talking with @vaibcode and Kai from BAML about how performance engineering is total kryptonite for freestyle coding agents!
youtube.com/watch?v=WHLXRZi8β¦
Vaibhav Gupta retweeted
If you didn't know, this is the ultimate win.
Jev is a fantastic model for a number of use-cases.
BAML is agentic programming superpowers
Together they will be MAGIC!
we're also fans! jev as an AI function coming to BAML in tonights release!
github.com/BoundaryML/baml/pβ¦
Vaibhav Gupta retweeted
I messed up.
I accidentally deleted our launch X post for Kitaru that went viral last week.
Hope this answers the question for some of you wondering. It was just a silly mistake, nothing deeper :D.
20K views, 100s of bookmarks, 400 likes, all gone in a moment of madness tbh. Oh well it lives on on LinkedIn!
But you know what I learned? Sometimes, your biggest mistakes can be opportunities hidden in disguise.
So I'll take this opportunity to reintroduce Kitaru again π
If anything, hopefully it gets people to check out our latest releases: We're even better today then we were last week on our mission from creating a self improving loop from your existing agent traces.
Ingest traces from langfuse, braintrust, arize etc, get interviewed by Kitaru with targetted annotations, and get evaluator functions individualized for you. Replay against baselines of what happened in prod. Export to harbor datasets when you're ready to go beyond the harness layer and finetune/RL your OSS models for your agent.
Try it now, free and OSS: kitaru.ai/
Vaibhav Gupta retweeted
Replying to @mattpocockuk
@boundaryML invented a language for agents, called BAML. It's awesome and I love using it so far
You should talk to @vaibcode
Vaibhav Gupta retweeted
One of the best features of Rust which I wish every other language had is match.
When we designed BAML, we wanted the syntax to be as similar as possible to TypeScript, so instead of enums that carry values like in Rust we went with union types.
I think I like this even more than enums with values, for example now I don't even have to name variants when not needed. What in Rust would be:
enum Parse { String(String), Int(i64), Bool(bool) }
in Baml becomes simply:
type Parse = string | int | bool
and you can match directly on the types.
Destructuring is just as powerful as Rust, you can get nested values out and bind them to different variables, bind individual elements of lists... And all of this is exhaustive and the compiler complains about unhandled cases.
I think we cooked with this one ππ₯

























