{"id":23435531,"url":"https://github.com/customcommander/xmachina","last_synced_at":"2025-07-31T14:42:07.366Z","repository":{"id":195160978,"uuid":"691795332","full_name":"customcommander/xmachina","owner":"customcommander","description":"A small DSL that compiles to XState.","archived":false,"fork":false,"pushed_at":"2023-11-08T21:49:26.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T17:47:40.035Z","etag":null,"topics":["dsl","finite-state-machine","state-machine","tagged-template","xstate"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/customcommander.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-14T23:00:37.000Z","updated_at":"2023-09-24T15:17:40.000Z","dependencies_parsed_at":"2023-09-22T05:42:47.013Z","dependency_job_id":"11fcc81e-84d9-461b-a127-43c6bdcfec39","html_url":"https://github.com/customcommander/xmachina","commit_stats":{"total_commits":73,"total_committers":1,"mean_commits":73.0,"dds":0.0,"last_synced_commit":"f6f495bf6dfeae68c005f3514c26d4afaf4f5dc0"},"previous_names":["customcommander/xmachina"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/customcommander/xmachina","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customcommander%2Fxmachina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customcommander%2Fxmachina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customcommander%2Fxmachina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customcommander%2Fxmachina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/customcommander","download_url":"https://codeload.github.com/customcommander/xmachina/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/customcommander%2Fxmachina/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268057757,"owners_count":24188623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dsl","finite-state-machine","state-machine","tagged-template","xstate"],"created_at":"2024-12-23T12:51:49.078Z","updated_at":"2025-07-31T14:42:07.289Z","avatar_url":"https://github.com/customcommander.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[[https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg]]\n\n* XMachina\n\nThe goal of this project is to provide a concise yet\ndeclarative language for state machines and to augment\nthe experience of working with [[https://github.com/statelyai/xstate][XState]].\n\nAt this stage this is an educational project only and\nI make no commitments to deliver anything useful\nat any time.\n\n** TL; DR\n\n#+begin_src javascript\nimport {interpret} from 'xstate';\nimport {xmachina} from '@customcommander/xmachina';\n\nconst service =\n  interpret(xmachina`\n    machine question {\n      is_valid = ${(ctx, ev) =\u003e ev.answer === 42}\n\n      initial state searching {\n        [ON_ANSWER]: is_valid? found\n      }\n\n      final state found {}\n    }`);\n\nservice.start();\n\nservice.send({type: 'ON_ANSWER', answer: 10});\n// still searching\n\nservice.send({type: 'ON_ANSWER', answer: 42});\n// found answer!\n\n#+end_src\n\n** Acknowledgment\n\nWhen I initially set out to write this DSL, I didn't look\naround for similar projects. However it didn't take long\nuntil I came across [[https://github.com/lucydsl/liblucy][Lucy]].\n\nI suspect that XMachina will look similar to Lucy in many\nways, but it will also be different as I make my own design\ndecisions.\n\nI should also mention [[https://github.com/StoneCypher/jssm][JSSM]] and [[https://fsl.tools/][FSL]] for completeness \neven though their goals are somewhat different than mine.\n\nNonetheless people will eventually notice the similarities\nand I just wanted to take this opportunity to thank and\ngive credit to the people who were on this journey\nbefore me.\n\nThank you!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomcommander%2Fxmachina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustomcommander%2Fxmachina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustomcommander%2Fxmachina/lists"}