This is one of the really big deals. This is also one of the things that makes peg so powerful, and what almost got me to leave it for canopy and antlr to get semiportability.
Basically, this is a proper compiler, rather than an inline compiler, whose product is source code rather than a live object. This leaves a whole lot of questions open around hooks #255 and guards #412; still, this is progressively becoming more and more clear as the right next step, rather than another VM for target languages.
Properly, this should compile some intermediary, which in turn gets compiled down by a language driver. C, SQL, JS, and Erlang should be sufficiently different to make that doable.
This is different than Transcompile to other existing state machines #563 because this produces code for a single machine in another language, rather than a datastructure for a generic machine.
[ ] Emit JSSM compiled
[x] Emit DOT #170
[x] Emit SVG #169
[ ] Emit JS
[ ] Emit ES6 module
[ ] Emit ES6 iife
[ ] Emit ES5 CJS
[ ] Emit ES5 iife
[ ] Emit TS #472
[ ] Emit C
[ ] Should there be a specialized C++?
[ ] 🔥 Emit UML state chart
[ ] More modernly, emit the w3c contemporary SCXML, #456
[ ] 😮 Emit Amazon States Language #496
[ ] Emit Python
[ ] Emit Ruby
[ ] Emit Java
[ ] Emit Erlang
[ ] @blackeuler apparently wants Elixir actively
[ ] Emit some awful .NET thing
[ ] Emit some awful AWS thing
[ ] Emit a fully conceived Github Action machine
[ ] Emit PHP
[ ] Emit SQL
[ ] Emit MySQL
[ ] Emit PostgreSQL
[ ] Emit Oracle PL/I
[ ] Emit mssql
[ ] Emit sqlite
[ ] Emit Swift
[ ] Emit Go
[ ] Emit shells
[ ] Emit bash
[ ] Emit batch
[ ] Emit powershell
[ ] Emit dockerfile
[ ] Emit rust
[ ] Emit C#
[ ] Emit some kind of Unity nonsense
[ ] Emit some kind of Unreal3d nonsense
[ ] Emit Haskell, to keep the hipsters happy
[ ] Emit Harel state chart
Who knows? Even Fortran and COBOL would make the case for a legacy path out
Might be smart to target existing state machine libraries...
Lol can you imagine if this emitted assemblies or Verilog or VHDL or whatever
It may be nice for the machines to be in at least some rudimentary sense interoperable, which probably just means taking transitions, actions, and providing end states as strings
This is one of the really big deals. This is also one of the things that makes
peg
so powerful, and what almost got me to leave it forcanopy
andantlr
to get semiportability.Basically, this is a proper compiler, rather than an inline compiler, whose product is source code rather than a live object. This leaves a whole lot of questions open around hooks #255 and guards #412; still, this is progressively becoming more and more clear as the right next step, rather than another VM for target languages.
Properly, this should compile some intermediary, which in turn gets compiled down by a language driver. C, SQL, JS, and Erlang should be sufficiently different to make that doable.
This is different than
Transcompile to other existing state machines
#563 because this produces code for a single machine in another language, rather than a datastructure for a generic machine.Who knows? Even Fortran and COBOL would make the case for a legacy path out
Might be smart to target existing state machine libraries...
Lol can you imagine if this emitted assemblies or Verilog or VHDL or whatever