This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-15
Channels
- # admin-announcements (1)
- # announcements (11)
- # asami (6)
- # aws (26)
- # babashka (17)
- # beginners (119)
- # bristol-clojurians (7)
- # chlorine-clover (2)
- # cider (3)
- # circleci (1)
- # clj-kondo (10)
- # clojure (127)
- # clojure-australia (3)
- # clojure-dusseldorf (5)
- # clojure-europe (135)
- # clojure-france (5)
- # clojure-nl (8)
- # clojure-uk (6)
- # clojurescript (103)
- # clojurewerkz (1)
- # css (2)
- # cursive (5)
- # datalog (5)
- # datomic (36)
- # emacs (3)
- # events (2)
- # figwheel-main (3)
- # fulcro (1)
- # graalvm (3)
- # helix (31)
- # jobs-discuss (4)
- # leiningen (1)
- # london-clojurians (1)
- # malli (17)
- # off-topic (2)
- # parinfer (10)
- # portal (1)
- # re-frame (48)
- # reitit (2)
- # reveal (12)
- # shadow-cljs (3)
- # sql (3)
- # tools-deps (4)
- # vim (4)
- # xtdb (22)
I’ve just released a functional statecharts library for Clojure and ClojureScript. Documentation is missing at the moment, but there are over 100 tests you can consult to check the functionality. Semantics are based on the SCXML standard https://github.com/retro/state-machete
What's your major use case for inventing this lib? I've also created a clj/cljs statecharts library for better state management in re-frame apps and some custom script https://github.com/lucywang000/clj-statecharts
@UP90Q48J3 I didn’t know about your lib, I’ll definitely check your implementation! As for the usecase, I’ve started working on it last year as part of the research for https://github.com/keechma/keechma-next (In the end I’ve went with a different approach for keechma/next), but I’ve never finished it. I’m starting some work on a backend system that needs to have a pretty flexible business logic, so I’m planning to use statecharts + https://github.com/agentbellnorm/dativity (or an approach similar to it) to implement it.
I wanted to implement statecharts as a pure function without internal state to ensure I can use it in any context I need (and provide my own persistence on top of it). This was inspired by the https://github.com/cark/cark.behavior-tree library
Cool. You could also take a look the most popular js statecharts lib xstate (if not yet) https://github.com/davidkpiano/xstate , my lib borrowed most of the design from it.
Yeah, I’ve used XState previously and it’s a great library, but in the end I went with an implementation that’s closer to the SCXML standard because SCION project has a great test suite (https://gitlab.com/scion-scxml/test-framework) which I was able to port, and it ensured that the algorithm is correct for more complex transitions
Great to know these projects like dativity, lots of food for thought! > implementation that’s closer to the SCXML standard because SCION project has a great test suite XState doesn't use scxml-like syntax but this doesn't prevent it to https://github.com/davidkpiano/xstate/blob/3dcf91861964f0e3c581b08fcb3357f658b75bea/packages/core/test/scxml.test.ts. My lib doesn't put conforming to SCXML as a top priority, but focus mostly on what I need in real world projects. For example I need delayed transitions, eventless transitions (transient states), first-class re-frame integration, so I implemented these features. OTOH so far I don't see any need for history states, so I just leave it out.
The re-frame integration looks really interesting, especially the epoch support. Thanks!
Clojure tools 1.10.1.716 is now available: • Make edn reading tolerant of unknown tagged literals • Update to latest dependencies for maven-resolver and aws-api