https://www.boundaryml.com logo
Orchestration Solution (after 6+ months
# general
b
Orchestration Solution (after 6+ months of analysis paralysis) Wrote a declarative graph executor DSL in TS that generates DOT diagrams and compiles into Restate durable workflows Green:
BAML
functions etc. (running in Restate service handlers) Orange: Restate Virtual Object (Representing the conversation,
appendTokens
while streaming,
commitMessage
for when a generation completes,
getState
FSM in a union) Cyan: Durable Restate Promises https://cdn.discordapp.com/attachments/1119375594984050779/1497675982293827694/image.png?ex=69ee62f3&is=69ed1173&hm=a9fd0261180890c66dd02d2ad4bcac3a25ddee9d9b267e68804c4d69d9faff4d&
v
I originally started using restate in the project after seeing your considerations
b
Wait really? Like long ago when I wrote something about it in here?
v
Yes, at the time I was considering Vercel's workflow and Restate
After using Restate, I found that this architecture seems a bit too heavy (which also has to do with the fact that I haven’t yet clearly defined the actual use case), compared to a simple implementation like Claude Code.
b
That's why I ended up designing this "DSL". I realized the biggest blocker for me often was about being able to clearly define use-cases, and how systems depend on each other etc. I used Claude Code to design the API, it basically broke down Restate into a more simplified higher-level API (also less capable), but I've been surprised with how well Claude seems to understand Restate and how things should compose etc. My plan now is to define as many systems I can using that DSL, then when I hit limitations where I need imperative Restate code, I'll try making Claude do it for me... Damn I'm such a weak dev 😭
Kinda ironic what I wrote about in #1119375594984050779 of using "battle tested platforms", then in the end I'm going to use a hand-rolled slop-coded DSL engine in front of Restate... Probably contains a shit load of bugs RIP
v
After you shared your design, I immediately asked Codex GPT-5.5 to analyze its strengths and the complexity of my own implementation to see whether there was anything worth improving. Codex said your design is relatively clear, but much of my current implementation still can’t be directly integrated.
BAML gives us tremendous flexibility, but as a rookie developer, I’m still not able to create a very mature architectural design.
b
Yeah, Claude also need a little bit of whipping to realize how to use the DSL to convert natural language into programs... hehe Spent a long time on my docs to make it work well! And when I hit limitations.. guess what I'll do. That's right. I'll ask Claude to expand the feature set of the DSL. Nothing could go wrong, right?
v
I remember when I was writing the design document for restate + BAML, I spent a week on it before I dared to start coding、
b
What are you building? Just out of curiosity
Yeah spending time in spec mode when vibe coding has paid off more than one time for me! Do you know anything about 3D modelling by chance? Usually the workflow there is to start very lowpoly to define the big shapes, then once you are happy with it, you can increase the poly-count to add details. Vibe coding is an inherently destructive forwards-editing-only process, so getting the "big shapes" right in the spec phase has been crucial for me
v
I shared it in the community; here’s the link https://discord.com/channels/1119368998161752075/1253172394345107466/1462994235203522723 https://discord.com/channels/1119368998161752075/1463061149070393505/1463062812199882794 Overall, it is a general-purpose orchestration agent, plus Bash tools
b
Interesting, so you're just testing stuff out and learning?
v
It’s not just for testing—it’s already been applied in my product, even though the product isn’t great and not many people use it. BAML’s philosophy has always appealed to me, but BAML’s new features have indeed taken far too long.
b
What is your product? 👀
v
An AI assistant for the automotive industry
b
This is how my DSL would implement a map reducer btw:
Copy code
typescript
const carry = flow.pointer()

const mapper = flow.add('Mapper', mapperDef)
  .dependsOn(carry)
  .if('Has Carry', r => r.resolved(carry))
  .else(flow.input)

const reduce = flow.maps(mapper).via('Reduce', reducerDef, 'reduce')

const flatMap = flow.add('FlatMap', flatMapDef).dependsOn(reduce)
  .loop(carry)
  .if('Iterate', pred)
flow.maps(listProducer).via(callback)
is the fanout mechanism, representing "Spawning N dynamic nodes to process a list" (it's all separate Restate invocations) Of course if you don't want separate Restate invocations, you could just implement it internally of a service handler that accept a list as it's input... But that would be if it's not a semantic concern of "orchestration logic" and strictly belongs to business logic
4-line map reducer is insane, I read in some forum somewhere about prolog that declarative languages tends to break down because they need exeedingly clever compilers in order to be so elegant and declarative
Surely this whole thing is a footgun waiting to blow up, and I'll eventually just use LangGraph and stfu
v
Another brand-new concept—let me first have codex explain it to me
b
Yeah the elegance is tempting right
Real tempting shooting yourself in the foot
the DOT rendering is so sick though... Restate or BoundaryML should hire me to write edgy schizo blog posts and turn this into an interactive Cytoscape editor
Although it is just a very seasoned general distributed computing technique... which was the point of everything I wrote in #1119375594984050779 few days ago
Ofc the internals of how that
mapper
node works is what's the most interesting part about this, type
1
chat if you want me to release this open source
New LangChain framework dropped! 😭 💀
Would be sick though. LangGraph but with a visual node editor + declarative DSL orchestration code that compiles to both Restate and Temporal (e.g. NOT trying to re-solve durable exeuction from scratch! It's already solved.. nothing new under the sun.. yada yada yada) I think "AI orchestration" shouldn't be treated differently than general orchestration and distributed computing. So why not make something that compiles down to lower-level durable exeuction, but is defined with syntactic sugar specifically for AI orchestration?
E.g. I'm saying "AI orchestration is not that different" so if we should have anything AI-specific, I'd rather see it as a thin syntax layer (DSL) that builds on top of hardcore battle-tested distriuted computing models etc.
broken💎yapper
Hire me @baml-sam
This is your wedge to dominate LangGraph: we package nice syntax and observability convinience but integrate more widely with existing technologies rather than trying to re-solve what has already been solved (e.g. distributed computing, durable execution etc)
The cool thing here is rather than trying to replace Restate, Temporal etc. with a hand-rolled Rust thing, BoundaryML could just be a provider of nice UI. We could vibe-code the whole thing: it doesn't need to be that stable, i mean we might compile down to wrong Restate code - but it's still Restate code, and we can iron those bugs out. The point is to limit the scope of what we actually need to build, while providing a way stronger product
I'm so turned off by LangGraph don't get me started. "N8N but for real engineers (and AI i guess, also; download BAML)" is a better position
2 Views