All Projects → smudgelang → Smudge

smudgelang / Smudge

Licence: other
A domain-specific language for state machines.

Programming Languages

haskell
3896 projects
language
365 projects

Projects that are alternatives of or similar to Smudge

Finity
A finite state machine library for Node.js and the browser with a friendly configuration DSL.
Stars: ✭ 88 (-30.16%)
Mutual labels:  state-machine
Qpn
QP-nano real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 107 (-15.08%)
Mutual labels:  state-machine
Core
UI-Router Core: Framework agnostic, State-based routing for JavaScript Single Page Apps
Stars: ✭ 112 (-11.11%)
Mutual labels:  state-machine
Makina
A simple hierarchical state machine compiler that generates C.
Stars: ✭ 93 (-26.19%)
Mutual labels:  state-machine
Library
Collection of papers in the field of distributed systems, game theory, cryptography, cryptoeconomics, zero knowledge
Stars: ✭ 100 (-20.63%)
Mutual labels:  state-machine
Ws Machine
WS-Machine is a websocket finite state machine for client websocket connections (Go)
Stars: ✭ 110 (-12.7%)
Mutual labels:  state-machine
Statemachineone
State Machine library for PHP
Stars: ✭ 84 (-33.33%)
Mutual labels:  state-machine
Workflowserver
Workflow Server is a ready-to-use Workflow Engine-based application that you can deploy into your infrastructure. It can be integrated with NodeJS, PHP, Ruby, .NET, or Java applications via a REST API. Workflow Server is a key component for managing the lifecycle of business objects within your enterprise.
Stars: ✭ 124 (-1.59%)
Mutual labels:  state-machine
Hsm
Finite state machine library based on the boost hana meta programming library. It follows the principles of the boost msm and boost sml libraries, but tries to reduce own complex meta programming code to a minimum.
Stars: ✭ 106 (-15.87%)
Mutual labels:  state-machine
Rafcon
RAFCON (RMC advanced flow control) uses hierarchical state machines, featuring concurrent state execution, to represent robot programs. It ships with a graphical user interface supporting the creation of state machines and contains IDE like debugging mechanisms. Alternatively, state machines can programmatically be generated using RAFCON's API.
Stars: ✭ 112 (-11.11%)
Mutual labels:  state-machine
Workflow Swift
A Swift and Kotlin library for making composable state machines, and UIs driven by those state machines.
Stars: ✭ 92 (-26.98%)
Mutual labels:  state-machine
Statemachine
Statemachine in PHP 5.6 / PHP 7
Stars: ✭ 99 (-21.43%)
Mutual labels:  state-machine
When Ts
When: recombinant design pattern for state machines based on gene expression with a temporal model
Stars: ✭ 112 (-11.11%)
Mutual labels:  state-machine
React Automata
A state machine abstraction for React
Stars: ✭ 1,316 (+944.44%)
Mutual labels:  state-machine
Afsm
C++14 Finite State Machine library
Stars: ✭ 113 (-10.32%)
Mutual labels:  state-machine
Jstate
Advanced state machines in Java.
Stars: ✭ 84 (-33.33%)
Mutual labels:  state-machine
Jungle
An embedded key-value store library specialized for building state machine and log store
Stars: ✭ 110 (-12.7%)
Mutual labels:  state-machine
Qpcpp
QP/C++ real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 124 (-1.59%)
Mutual labels:  state-machine
Kdstatemachineeditor
A framework for creating Qt State Machine metacode using a graphical user interface
Stars: ✭ 121 (-3.97%)
Mutual labels:  state-machine
Zproc
Process on steroids
Stars: ✭ 112 (-11.11%)
Mutual labels:  state-machine

Linux Build Status Windows Build Status

The Smudge Programming Language

Smudge is a domain specific language for implementing state machines. The compiler generates standard C code as well as graphical state diagrams. Its output is optimized for use on very limited embedded systems, but designed to be used anywhere state machines are appropriate. Here's a simple example to show you what the language looks like:

first.smudge

SM_NAME
{
    *FIRST_STATE (@enterFirst)
    [
        event --> SECOND_STATE,
        altEvent -(@sideEffect)-,
        reenter --> FIRST_STATE
    ] (@exitFirst),

    SECOND_STATE
    [
        _ -(@sideEffect)-> FIRST_STATE
    ]
}

Getting Smudge

Splat

Instead of installing Smudge by itself, most people will want to install Splat, the Smudge Platform, which bundles together everything you need to use Smudge. To download, go to the Splat releases page for the latest platform release.

Debian

Users of Debian and derivatives can add the Smudge package repository and keep Smudge installations current by following these directions. There is a package for Smudge by itself, called smudge, but also a package for all of Splat, called smudge-platform.

Binaries

If you really want to install the Smudge compiler by itself, there are binary releases available for Windows and Linux available on the Smudge releases page. The latest release includes a pdf of the tutorial, which is a great place to start learning Smudge.

Building From Source

First, make sure you have ghc installed, along with haskell-stack. In order to build the documentation, you'll also need rst2pdf and pdflatex.

Then, in your shell of choice, run:

$ make

The first time you build, it might tell you to run

$ stack setup

This may take a bit, as stack will have to download and configure the build environment.

This should work on Windows under Cygwin, as well as reasonably recent versions of Debian (with issues) and Ubuntu. It has worked on other distros and MacOS, and if you have trouble getting it to build we encourage you to ask for help on gitter. It generates an executable called smudge (or smudge.exe on Windows) that you can use to compile Smudge code by running stack exec smudge.

How to Use Smudge

Once you have Smudge installed, either because you built it from source or downloaded a release, the best way to learn how to use it is to look at the tutorial. It's in the release tarball and it's built as part of the normal build process in docs/tutorial/tutorial.pdf. Here's the quick version for the impatient though.

Prerequisites

First, make sure you have graphviz installed. It should be available through your package manager on Linux, through homebrew on MacOS, or within cygwin on Windows. If you're running on Windows, we strongly suggest that you use Cygwin.

Running

$ smudge --dot-fmt=Svg first.smudge
Wrote file "first.svg"
Wrote file "first.h"
Wrote file "first.c"
Wrote file "first_ext.h"

This generates 4 files. The .svg file is just an image with a diagram of your state machine. The .h file is the interface to the code generated by Smudge, and the _ext.h file contains generated prototypes for functions you must provide.

There's more!

Further example state machines can be found in the examples directory. In particular, first.smudge is the state machine shown above but with extensive comments to describe what it's doing.

There's also a gitter if you need help or want to communicate with the contributors.

License

Smudge is released under a standard BSD 3-clause license, found in LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].