VSCXML: Definitive Feature Matrix
Purpose: Authoritative reference for all targets, execution modes, datamodels, and features.
Last Updated: 2026-02-09
Test Verification Date: 2026-02-09 (all numbers verified by actual test execution)
| Target |
Generator Class |
Output Language |
Status |
| Java |
TranspilerCodeGenerator |
Java (extends TranspiledStateMachine) |
✅ Active |
| JavaScript |
JavaScriptCodeGenerator |
ES6+ JavaScript |
✅ Active |
| C# |
CSharpCodeGenerator |
C# (extends TranspiledStateMachine) |
✅ Active |
| C |
CTargetEmitter |
C (uses scxml-runtime-c) |
✅ Active |
| Python |
PythonCodeGenerator |
Python 3.10+ (extends TranspiledStateMachine) |
✅ Active |
| Go |
GoCodeGenerator |
Go 1.21+ (extends TranspiledStateMachine) |
✅ Active |
| Structured Text |
StructuredTextCodeGenerator |
IEC 61131-3 ST (FUNCTION_BLOCK) |
⚠️ Experimental |
2. EXECUTION MODES#
| Mode |
Description |
Java |
JavaScript |
C# |
C |
Python |
Go |
ST |
| Runtime |
Interprets SCXML at runtime |
RuntimeStateMachine |
RuntimeInterpreter |
N/A |
N/A |
N/A |
N/A |
N/A |
| Transpiled |
Generates unrolled code |
TranspiledStateMachine |
Generated JS class |
TranspiledStateMachine |
Generated C code |
TranspiledStateMachine |
TranspiledStateMachine |
Generated FUNCTION_BLOCK |
3. DATAMODELS#
3.1 Datamodel Enum Values#
Source: DataModelType.java
| Enum |
SCXML Value |
Description |
ECMASCRIPT |
ecmascript |
ECMAScript via Rhino (Java default) |
GRAALJS |
N/A (alternative engine) |
ECMAScript via GraalJS (native-image compatible) |
JINT |
N/A (C# engine) |
ECMAScript via Jint (C# target) |
XPATH |
xpath |
XPath 2.0 expressions, XML DOM storage |
NULL |
null |
No data storage, only In() predicate |
NATIVE_JAVA |
native-java |
Compile-time Java typed fields |
NATIVE_JS |
native-js |
Direct JavaScript expressions (transpiled) |
NATIVE_CSHARP |
native-csharp |
Compile-time C# typed fields |
NATIVE_PYTHON |
native-python |
Compile-time Python typed fields |
NATIVE_GO |
native-go |
Compile-time Go typed fields |
NATIVE_ST |
native-st |
Compile-time IEC 61131-3 ST typed fields |
SIMPLE |
simple |
Basic map-based (legacy) |
3.2 Datamodel Support Matrix (Verified Test Results)#
| Datamodel |
Java Runtime |
Java Transpiled |
JS Runtime |
JS Transpiled |
C# Transpiled |
C |
Python Transpiled |
Go Transpiled |
ST Transpiled |
| ECMAScript (Rhino) |
100% (183/183) |
100% (183/183) |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
| ECMAScript (GraalJS) |
100% (386/386) |
100% (183/183) |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
| ECMAScript (Jint) |
N/A |
N/A |
N/A |
N/A |
100% (183/183) |
N/A |
N/A |
N/A |
N/A |
| ECMAScript (dukpy) |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
100% (188/188) |
N/A |
N/A |
| ECMAScript (Goja) |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
100% (183/183) |
N/A |
| ECMAScript |
N/A |
N/A |
100% (179/179) |
100% (208/208) |
N/A |
N/A |
N/A |
N/A |
N/A |
| XPath |
89.1% (179/201) |
Not supported |
Not supported |
Not supported |
Not supported |
No |
Not supported |
Not supported |
N/A |
| Null |
100% (5/5) |
100% (5/5) |
100% (5/5) |
100% |
100% (6/6) |
Yes |
100% (6/6) |
100% (6/6) |
100% (7/7) |
| native-java |
N/A |
100% (20/20) |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
| native-js |
N/A |
N/A |
100% (21/21) |
100% |
N/A |
N/A |
N/A |
N/A |
N/A |
| native-csharp |
N/A |
N/A |
N/A |
N/A |
100% (11/11) |
N/A |
N/A |
N/A |
N/A |
| native-python |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
100% (23/23) |
N/A |
N/A |
| native-go |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
100% (20/20) |
N/A |
| native-st |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
100% (30/30) |
| native-st (iec-strict) |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
Yes (portable) |
3.3 ECMAScript Engine Support#
| Engine |
Platform |
Runtime |
Transpiled |
Native-Image |
Notes |
| Rhino |
Java |
100% (183/183) |
100% (183/183) |
No |
Default, mature |
| GraalJS |
Java |
100% (386/386) |
100% (183/183) |
Yes |
Native-image compatible |
| Jint |
C# |
N/A |
100% (183/183) |
Yes |
.NET, cross-platform |
| JerryScript |
C |
N/A |
100% (188/188) |
Yes |
Embedded, ~200KB |
| dukpy |
Python |
N/A |
100% (188/188) |
N/A |
pip install, ~2MB |
| Goja |
Go |
N/A |
100% (183/183) |
Yes |
Pure Go, ES5.1+ |
4. VERIFIED TEST RESULTS#
4.1 Java Test Summary#
| Test Suite |
Engine/Mode |
Total |
Passed |
Failed |
Pass Rate |
| TranspilerW3cTestSuite |
V3 Rhino |
183 |
183 |
0 |
100% |
| NativeDataModelTest |
V3 native-java |
20 |
20 |
0 |
100% |
| Null Datamodel Tests |
V3 Null |
5 |
5 |
0 |
100% |
| GraalJS Datamodel Tests |
V3 GraalJS |
183 |
183 |
0 |
100% |
| GraalJS Runtime Tests |
Runtime GraalJS |
386 |
386 |
0 |
100% |
| Runtime ECMAScript (Rhino) |
Runtime Rhino |
183 |
183 |
0 |
100% |
| Runtime Null Tests |
Runtime Null |
5 |
5 |
0 |
100% |
| Runtime XPath Tests |
Runtime XPath |
201 |
179 |
22 |
89.1% |
| XPath Datamodel Tests |
V1 XPath |
201 |
174 |
27 |
86.6% |
4.2 JavaScript Test Summary#
| Test Suite |
Datamodel |
Total |
Passed |
Skipped |
Pass Rate |
| Runtime (all) |
Mixed |
208 |
204 |
4 |
100% |
| - ECMAScript |
ecmascript |
179 |
179 |
0 |
100% |
| - Null |
null |
5 |
5 |
0 |
100% |
| - native-js |
native-js |
20 |
20 |
0 |
100% |
| Transpiled (all) |
Mixed |
208 |
208 |
0 |
100% |
4.3 C# Test Summary#
| Test Suite |
Datamodel |
Total |
Passed |
Failed |
Pass Rate |
| Transpiled (all) |
Mixed |
200 |
200 |
0 |
100% |
| - ECMAScript (Jint) |
ecmascript |
183 |
183 |
0 |
100% |
| - Null |
null |
6 |
6 |
0 |
100% |
| - native-csharp |
native-csharp |
11 |
11 |
0 |
100% |
4.4 Go Test Summary#
| Test Suite |
Datamodel |
Total |
Passed |
Failed |
Pass Rate |
| Transpiled (all) |
Mixed |
209 |
209 |
0 |
100% |
| - ECMAScript (Goja) |
ecmascript |
183 |
183 |
0 |
100% |
| - Null |
null |
6 |
6 |
0 |
100% |
| - native-go |
native-go |
20 |
20 |
0 |
100% |
4.5 Structured Text Test Summary#
note
: The Structured Text target is under active development and is not yet recommended for production use. APIs and generated output may change between releases.
| Test Suite |
Datamodel |
Total |
Passed |
Failed |
Pass Rate |
| ST Transpiled (null) |
null |
7 |
7 |
0 |
100% |
| ST Transpiled (native-st) |
native-go (→ ST) |
30 |
30 |
0 |
100% |
note
: Native-go test sources are used for native-st tests since the ST generator accepts native-go SCXML with expression transformation. 9 native-go tests are skipped (Go/Java/JS-specific). 1 null test is skipped (invoke bundling). Includes delayed send (<send delay>) and cancel (<cancel>) test coverage. CODESYS V3.5 simulation is required for full test execution; --generate-only mode verifies code generation without CODESYS.
Verified: 2026-02-09 via generate-only mode (code generation verified for all tests).
5. FEATURE SUPPORT#
5.1 SCXML Core Features#
| Feature |
Java Runtime |
Java Transpiled |
JS Runtime |
JS Transpiled |
C# Transpiled |
Python Transpiled |
Go Transpiled |
ST Transpiled |
| States (atomic, compound, parallel) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
| Transitions (events, conditions) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
| History states (shallow, deep) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
| Final states + donedata |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
| Actions (assign, raise, log, send) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
| Control flow (if/elseif/else, foreach) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
| Script element |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes (inline ST) |
| Invoke |
Yes |
Yes |
Yes |
No (requires runtime) |
Yes |
Yes |
Yes |
Yes (static FBs) |
| System vars (_event, _sessionid, _name) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
No |
| In() predicate |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
| Early/Late binding |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Early only |
| Feature |
Java Runtime |
Java Transpiled |
JS Runtime |
JS Transpiled |
C# Transpiled |
Python Transpiled |
Go Transpiled |
ST Transpiled |
| Tracing (TraceListener) |
Yes |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
No |
| DebuggableStateMachine interface |
Yes |
Yes |
N/A |
N/A |
Yes |
N/A |
N/A |
N/A |
| Embedded SCXML (ScxmlProvider) |
N/A |
Yes |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
| Embedded Debug Server |
N/A |
Yes |
N/A |
N/A |
N/A |
N/A |
N/A |
N/A |
| Variable inspection |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Via PLC IDE |
| State inspection |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
Via VAR_OUTPUT |
5.3 Runtime APIs (Trace & Executor)#
Cross-target APIs for professional state machine integration.
Trace System#
| Feature |
Java |
JavaScript |
C# |
C |
Python |
Go |
ST |
| TraceListener Interface |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
❌ |
| InvokeAwareTraceListener |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
❌ |
| JsonlTraceWriter |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
❌ |
| TraceRecorder |
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
| TraceReader (Playback) |
✅ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
| ConsoleTraceListener |
✅ |
✅ |
❌ |
❌ |
❌ |
✅ |
❌ |
| Timestamp Precision |
μs |
ms |
μs |
μs |
μs |
μs |
N/A |
All targets produce identical JSONL format for trace interoperability:
{"timestamp":0,"type":"session_start","session_id":"abc123","scxml_name":"TrafficLight","datamodel":"ecmascript"}
{"timestamp":1234,"type":"state_enter","state_id":"red"}
{"timestamp":2345,"type":"transition","from":"red","to":"green","event":"timer"}
{"timestamp":3456,"type":"state_exit","state_id":"green","invoke_id":"childMachine"}
Executor System#
| Feature |
Java |
JavaScript |
C# |
C |
Python |
Go |
ST |
| StateMachineExecutor Interface |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
N/A |
| ContinuousExecutor |
✅ |
✅ |
✅ |
✅ (platform) |
✅ |
✅ |
PLC scan cycle |
| RunToCompletionExecutor |
✅ |
✅ |
✅ |
via registry |
✅ |
✅ |
Built-in |
| Async Event Firing |
✅ CompletableFuture |
✅ Promise |
✅ Task |
❌ |
✅ Future |
✅ goroutine |
VAR_INPUT |
| Thread-Safe Queue |
✅ |
N/A (single-threaded) |
✅ |
✅ (mutex) |
✅ |
✅ (mutex) |
N/A (single-task) |
| Delayed Event Processing |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ (TON timers) |
5.4 Event Introspection API#
Every generated state machine exposes which events it can process and which are currently enabled.
| Method |
Java |
JS |
C# |
C |
Python |
Go |
ST |
getAllEvents() |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
DWORD bitmask |
getEnabledEvents() |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
DWORD bitmask |
getEventsForState(id) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
DWORD bitmask |
getEnabledEventsForState(id) |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
DWORD bitmask |
| Guard evaluation |
In() + ECMAScript + Native + XPath |
In() + ECMAScript + Native |
In() + ECMAScript + Native |
In() + ECMAScript + Native |
In() + ECMAScript + Native |
In() + ECMAScript + Native |
In() + Native |
getEnabledEvents() and getEnabledEventsForState(id) evaluate guard conditions at query time. In() predicates compile to O(1) bitset checks, native expressions evaluate directly, and ECMAScript guards use the datamodel engine. The getAllEvents() and getEventsForState(id) methods are static lookups that do not evaluate guards.
5.5 Simulator Support#
| Feature |
Implementation |
Datamodels Supported |
REPL (scxml-simulator repl) |
RuntimeStateMachine |
ECMAScript, GraalJS, XPath, Null |
| SimulationSession |
DebuggableStateMachine interface |
Works with Runtime and Transpiled |
| WebSocket Server |
RuntimeStateMachine |
All runtime-supported |
6. KEY FILES#
Java Generators#
TranspilerCodeGenerator.java - Java transpiler
Java Runtime Base Classes#
TranspiledStateMachine.java - Base class for transpiled machines
RuntimeStateMachine.java - SCXML interpreter
JavaScript#
JavaScriptCodeGenerator.java - JS transpiler
RuntimeInterpreter.js - JS runtime
CSharpCodeGenerator.java - C# transpiler
scxml-csharp/src/ScxmlGen.Runtime/ - C# runtime base classes
scxml-csharp/src/ScxmlGen.Runtime/Datamodel/JintDataModel.cs - ECMAScript via Jint
Python#
PythonCodeGenerator.java - Python transpiler
scxml-python/src/scxmlgen/ - Python runtime base classes
scxml-python/src/scxmlgen/datamodel/ecmascript_datamodel.py - ECMAScript via dukpy
GoCodeGenerator.java - Go transpiler
scxml-go/scxmlgen/ - Go runtime base package
scxml-go/scxmlgen/datamodel_ecmascript.go - ECMAScript via Goja
scxml-go/scxmlgen/transpiled_state_machine.go - Base struct for transpiled machines
C Target#
CTargetEmitter.java - C code generator
Structured Text#
StructuredTextCodeGenerator.java - IEC 61131-3 ST code generator (FUNCTION_BLOCK output)
Datamodels (Java)#
RhinoDataModel.java - ECMAScript via Rhino
GraalJsDataModel.java - ECMAScript via GraalJS
XPathDataModel.java - XPath 2.0 (Runtime only)
NullDataModel.java - Null datamodel
NativeDataModel.java - Native Java (V3 transpiled only)
7. ARCHITECTURE#
Active Components#
| Component |
Purpose |
RuntimeStateMachine |
Simulation, XPath support, debugging, 100% GraalJS |
TranspiledStateMachine + TranspilerCodeGenerator |
High-performance production, 100% compliance |
JavaScriptCodeGenerator |
JS target transpilation, 100% compliance |
RuntimeInterpreter (JS) |
JS runtime + invoke support, 100% compliance |
CSharpCodeGenerator |
C# target transpilation, 100% compliance |
CTargetEmitter |
C target |
PythonCodeGenerator |
Python target transpilation, 100% compliance |
GoCodeGenerator |
Go target transpilation, 100% compliance |
StructuredTextCodeGenerator |
IEC 61131-3 ST target, FUNCTION_BLOCK output for PLCs |
XPath Support#
XPath is ONLY supported in Java Runtime (RuntimeStateMachine).
- XPath support: 89.1% compliance (179/201 tests)
- Users needing XPath use the simulator/runtime interpreter
- Transpiled mode does NOT need XPath - this is acceptable
- XPath tests are tracked but don't block the CI build
8. CLI#
The CLI (ScxmlGeneratorCli.java) uses TranspilerCodeGenerator for Java target generation.
9. TEST INFRASTRUCTURE#
| Test Class |
Description |
Category |
TranspilerW3cTestSuite |
ECMAScript (Rhino) Transpiled |
Essential |
GraalJsW3cTestRunner |
ECMAScript (GraalJS) Transpiled |
Essential |
NullW3cTestRunner |
Null datamodel |
Essential |
NativeDataModelTest |
native-java datamodel |
Essential |
RuntimeTestRunner |
Runtime interpreter (Rhino) |
Essential |
GraalJsRuntimeTestRunner |
Runtime interpreter (GraalJS) |
Essential |
W3cJupiterTestSuite |
Meta-suite for all tests |
Essential |
| XPath tests |
XPath datamodel tests |
Optional (tracked) |
10. KEY INSIGHTS FROM TEST VERIFICATION#
- All ECMAScript combinations achieve 100% compliance (Rhino, GraalJS, Jint, JerryScript, dukpy, Goja)
- All Null datamodel combinations achieve 100% compliance (Runtime and Transpiled)
- All native datamodels achieve 100% compliance (native-java, native-js, native-csharp, native-c, native-python, native-go)
- JavaScript achieves 100% compliance in both Runtime and Transpiled modes
- C# achieves 100% compliance with Jint ECMAScript engine (200/200 tests)
- Python achieves 100% compliance with dukpy ECMAScript engine (188/188 tests)
- Go achieves 100% compliance with Goja ECMAScript engine (209/209 tests)
- XPath has lower compliance (~89%) but is only needed for Runtime/simulation use cases
- Structured Text target generates IEC 61131-3 FUNCTION_BLOCK output for CODESYS/TwinCAT PLCs with null and native-st datamodels
- V1 Compiled can be safely removed - V3 Transpiled is strictly better
11. TEST COMMAND REFERENCE#
Java Tests#
./gradlew test --tests "TranspilerW3cTestSuite"
./gradlew test --tests "W3cJupiterTestSuite.graalJsTests"
./gradlew test --tests "W3cJupiterTestSuite.nullTranspiledTests"
./gradlew test --tests "NativeDataModelTest"
./gradlew test --tests "W3cJupiterTestSuite.runtimeEcmascriptTests"
./gradlew test --tests "W3cJupiterTestSuite.graalJsRuntimeTests"
./gradlew test --tests "W3cJupiterTestSuite.runtimeXpathTests"
./gradlew test --tests "W3cJupiterTestSuite.runtimeNullTests"
./gradlew :scxml-core:test
JavaScript Tests#
cd scxml-js
node test/run-runtime-tests.js
node test/run-tests.cjs
C# Tests#
cd scxml-csharp
dotnet test
Python Tests#
cd scxml-python/tests
python run_tests.py --datamodel ecmascript
python run_tests.py --datamodel null
python run_tests.py --datamodel ecmascript --filter test144 --verbose
Go Tests#
cd scxml-go/tests
go run . -datamodel ecmascript
go run . -datamodel null
go run . -datamodel native-go
go run . -datamodel ecmascript -filter test144 -verbose
Structured Text Tests#
cd scxml-st/test
python run_tests.py --datamodel null --verbose
python run_tests.py --datamodel native-st --verbose
python run_tests.py --datamodel null --generate-only --output-dir ./st-output
python run_tests.py --datamodel null --filter test_null_basic --verbose
docs/DATAMODELS.md - User documentation for datamodel selection