![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Utilities for the representation, validation, and generation of state machines using a JSON intermediate representation
This project defines semantics for representation of single level Finite State Machines (FSMs) using JavaScript Object Notation (JSON), as an intermediate language for graphical generation, analysis of FSM execution, and generation of state machines in other languages.
The motivation being that a significant portion of embedded code (read: all) is finite automata of some sort, and the common methods of describing and implementing FSMs in C (and other languages) require an enormous amount of boilerplate code, and result in generally complex and unclear implementations. There has to be a better way.
The goals of this are:
JSON was selected due to it's usability as a human readable format (for ease of writing and editing), and the ease of conversion into JavaScript objects, which should allow (near) direct execution of the JFSM state machine intermediate representation.
Originally this was intended to integrate all the features required to be compliant with UML StateCharts, however this added massive (unnecessary) complexity without a demonstrated need. So, Minimum Viable Project it is.
This was also to provide functionality for wiring of state machines for elegant system level design, however for now it seems that simply generating state machines offers enough utility, and generating state machines with standard interfaces will allow other projects to worry about wiring and models of execution.
It seems better to start by trying to solve a small problem well and moving from there [1]
Only by example (and in this README), see ./examples for example JSON files.
This will be developed as we attempt to actually use the generator and discover issues / annoyances with the spec.
See lib/fsm-validator.js
Fairly complete. Validates Mealy, Moore and Extended state machines.
Needs cleanup for simplification.
See lib/fsm-generator.js
Fairly complete. Generator functionality mostly implemented, generator templates need some work.
Generator uses handlebars style templates with a JSON language specification file, see ./lib/generators/c for an up to date example.
See app/
Barely started. Visualization app could be build using node-webkit with joint.js rendering.
examples/UMLStateMachine.json currently contains some keys for rendering, however this (IMO) makes the state machine less clear, so alternate methods are to be investigated.
Language | Status | Tests |
---|---|---|
c | Supported | TODO |
c# | Needs Updating | TODO |
javascript | Unsupported | TODO |
npm install
.node lib/jfsm.js
npm install -g ./
, then call jfsm
to executemake language-c
. Outputs will be placed in the ./outputs folder. Note that this requires gcc and libreadline (from build-essential and libreadline-dev packages).make language-csharp
. Outputs will be placed in the ./outputs folder. Note that this requires the mcs and mono executables (from mono-devel and mono-mcs packages on linux).jfsm --file [statemachine.json] --lang [language] --output [output directory]
nb. file and language (lang) arguments are required. Output folder defaults to './outputs'.
State machines should be defined as demonstrated in the example files
The onSomething entries (ie. "onEntry":true) inform the state machine generator that a user function should be called in this case. In C this generates an unimplemented function definition in the state machine header for the user to implement, in higher level languages this generates abstract methods that are to be implemented by the user.
An example of these methods can be viewed in outputs/UMLStateMachine.h after running make language-c
If you find a problem, or a need, Issues, Feature Requests or Pull Requests are more than welcome.
FAQs
Utilities for the representation, validation, and generation of state machines using a JSON intermediate representation
The npm package jfsm receives a total of 3 weekly downloads. As such, jfsm popularity was classified as not popular.
We found that jfsm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.