Note that there are some explanatory texts on larger screens.

plurals
  1. POA proposal to add statemachine support to C++-like language
    primarykey
    data
    text
    <p>Lately as part of my day job I've been learning IBM Rhapsody and using it to generate code in C++ from the UML.</p> <p>Yesterday it struck me that it might be cool to think about adding state machine support to my C++ compiler, so I jotted a few notes here: <a href="http://ellcc.org/wiki/index.php/State_machines_and_Active_Classes" rel="nofollow noreferrer">http://ellcc.org/wiki/index.php/State_machines_and_Active_Classes</a></p> <p>My motivations for doing this are:</p> <ol> <li>It seems like a cool idea.</li> <li>The compiler could do much better semantic checking (with better error checking) than the current Rhapsody/normal C++ compiler.</li> <li>There are many optimization possibilities available when the compiler itself understands the state machine structure.</li> </ol> <p>I may try to extend my grammar to except something like the proposal to see how well it works.</p> <p>What is your opinion of the proposal? Does it seem readable? Does it seem worthwhile? <hr/> Edit:</p> <p>Thanks for the answers recommending specific libraries to do state machines, but that wasn't my question. I've implemented many state machines using both libraries and code that I've written.</p> <p>I was really looking for ideas, criticism, etc. about the design of a state machine extension to a C++-like language, not whether this change would be appropriate for addition to standard C++. Think of it as a domain specific extension, where my my domain is real-time control applications.</p> <p>I've started implementation of the extension in my compiler as described here: <a href="http://ellcc.org/wiki/index.php/State%5Fmachines%5Fand%5FActive%5FClasses" rel="nofollow noreferrer">http://ellcc.org/wiki/index.php/State%5Fmachines%5Fand%5FActive%5FClasses</a></p> <p>So far the concept hasn't had to change much going from proposal to implementation but there have been a few changes in details and I'm refining my understanding of the semantics of the problem.</p> <p>Time will tell whether the whole concept has any value, however. ;-)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload