跳过导航
don't use loops, design state machines
0:00 / 1:35

don't use loops, design state machines

David

@dzhng1.5万 位关注者

在 X 上查看
1,350 个赞下载原帖

222,122 次观看

don't use loops, design state machines

60 条评论

评论来自 X (Twitter) 上的原帖

  • David 的头像

    @dzhng

    do this today at

    21 个赞

  • David K 🎹 的头像

    @DavidKPiano

    What does the state machine for this example look like?

    18 个赞

  • David 的头像

    @dzhng

    My version actually don't use a full deterministic state machine, I want to keep the flexibility of AI with minimal guardrails:

    3 个赞

  • Ilko Kacharov 的头像

    @kachar136

    Hot take: it's not loops vs state machines, it's both. The state machine defines what "done" looks like; the loop is the engine that grinds until it gets there. No loop = agent stalls mid-task. No state machine = it loops forever toward nothing. Winners design both.

    17 个赞

  • David 的头像

    @dzhng

    Agreed, but that's not catchy and doesn't go viral 😂

    8 个赞

  • Brian Via 的头像

    @BrianVia

    We’re inventing computer science from first principles

    16 个赞

  • David 的头像

    @dzhng

    😂 just slowly moving up the ladder of abstraction

    5 个赞

  • David 的头像

    @dzhng

    A loop is just a state machine with 2 states 😅

    19 个赞

  • David 的头像

    @dzhng

    😂

  • patark 的头像

    @orbofweed

    sir this is a kanban board /s

    2 个赞

  • duet 的头像

    @duetchat

    🪩🪩🪩

    2 个赞

  • Daniel 的头像

    @dcolinmorgan

    🤯🤯🤯this looks insanely powerful! 2026 -- what a year 🚀🚀 reworking stack for 3rd time in 10 days 😵‍💫

    2 个赞

  • David 的头像

    @dzhng

    Give it a try at and tell me how it goes! Happy to give you some free credits :)

    1 个赞

  • Jason Szesze 的头像

    @JasonSzesze

    Sweet @duetchat

    2 个赞

  • David 的头像

    @dzhng

    @duetchat Niceeeee

  • Mustafa Kirac 的头像

    @muskirac

    It's n8n all over again 🤔

    2 个赞

  • David 的头像

    @dzhng

    Na, it's not a workflow engine actually, it's just the bare minimum guardrails. All workflow logic is done by agent / codegen

    1 个赞

  • Sense Noped Out 的头像

    @SenseNopedOut

    this is what he meant. same same

    1 个赞

  • David 的头像

    @dzhng

    yup agreed. just adding a tangible example

    1 个赞

  • Rob Schaper 的头像

    @robschaper

    State machines can be designed to run in a loop, they can also act like a DAG with an outcome certain. For example, you can have four state machines in a loop, made of four DAGs, each run updates an S3 bucket, which has a trigger to run the next state machine, etc... Cheers.

    1 个赞