Effective state machines for complex logic by David Khourshid (Effect Days 2024)

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 มิ.ย. 2024
  • Get Effect support from the community: / discord
    David Khourshid discusses the use of state machines and the Effect library for handling complex logic in applications. He explains how state machines help make edge cases and use cases explicit and how the Effect library can be used for declaratively representing effects in state machines.
    Highlights:
    → The benefits of using state machines for handling complex workflows; different types of effects in state machines, including actions and actors.
    → The importance of declarative representation and how it can be converted into diagrams.
    → The actor model and its role in state machines.
    Slides: slides.com/davidkhourshid/eff...
    _____________________________________
    David Khourshid is the author of XState and founder of Stately.ai, a visual software modeling platform for app logic and workflows.
    Learn more about and follow David:
    X: / davidkpiano
    Github: github.com/davidkpiano
    _____________________________________
    Effect is an ecosystem of tools to build better applications and libraries in TypeScript.
    Website: effect.website/
    Community: / discord
    X (Twitter): / effectts_
    Github: github.com/Effect-TS
    _____________________________________
    #Effect #TypeScript #XState #StateMachines #EffectDays #EffectDays2024
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 6

  • @Danielo515
    @Danielo515 25 วันที่ผ่านมา +3

    Effect video , instant like

  • @ApprendreSansNecessite
    @ApprendreSansNecessite 25 วันที่ผ่านมา +8

    This video is really explaining in a nutshell what a state machine and the actor model are. It is not very clear how Effect could be used in the context of XState and what it would change to the dev experience.
    It looks like Sandro Maglione is the person to look up for answers.

    • @seannewell397
      @seannewell397 25 วันที่ผ่านมา +1

      Thanks for the heads up

    • @nickr753
      @nickr753 24 วันที่ผ่านมา +1

      I think the idea is that both tools are good at modeling different things which happen to be complementary. i.e. if you use XState to model your state machine, you could still make use of something to model computation, or if you use Effect to model computation, you might still want something to help you model a state machine. To use them together, XState is tasked with guaranteeing that the state of your machine is always valid, and Effect is tasked with running the side-effects that occur as a result of transitioning between states. To elaborate on the slide at 27:11 illustrated by an architecture I’ve been hacking on, I’m using Effect-cli as the top-level framework for a CLI tool, and inside certain subcommands, I want to model their logic as a state machine to guarantee a certain dependency graph between different actions. Those actions are then implemented as Effects. The benefit of using XState is that you can visually model these statecharts instead of defining them strictly in code.

    • @ApprendreSansNecessite
      @ApprendreSansNecessite 24 วันที่ผ่านมา

      @@nickr753 I guess I am used to the idea of having one entry point which is an effect and which is composed of effects, all the way down, but this setup is probably an exception rather than a rule. It just feels natural to me that an effects system is the framework.