Joeri Exelmans f169cbe3f4 Fix Python (interpreted) version of digital watch example преди 4 години
..
common 99569186bb Nicer directory layout for digital watch example. преди 4 години
python f169cbe3f4 Fix Python (interpreted) version of digital watch example преди 4 години
webassembly 91a048eedb Declare event parameters for in/out events in statechart interface. Simplify interpreter: Events no longer have integer ID's, use string compare instead. Implemented event parameters in Rust. преди 4 години
README.txt f169cbe3f4 Fix Python (interpreted) version of digital watch example преди 4 години

README.txt

Directory layout
----------------

common/
digitalwatch.xml
The statechart model

python/
run.py
Python script that runs the demo with the statechart interpreter. Run it from the 'python' directory.

webassembly/
index.html
Web page that runs the demo with WebAssembly code, generated from Rust code, in turn generated from the statechart model.

In order to run this demo, start a static HTTP server in the 'digitalwatch' directory:
python -m http.server

Then navigate your browser to http://localhost:8000/webassembly/

Note that this WebAssembly demo is only a proof-of-concept. Currently the package "wasm_bindgen", which generates bindings between WebAssembly and JavaScript, has very limited support for Algebraic Data Types, which we use for our input and output events.

codegen/
Generated code: This is a Rust crate produced by SCCD compiler (module "sccd.test.cmd.to_rust") from 'common/digitalwatch.xml'. Building it with 'cargo' produces a library.

wasm/
Rust crate containing Rust glue code to interact with the generated code in 'codegen' from JavaScript. It should be built with the 'wasm-pack' command, producing JavaScript glue code, and a .wasm-file.

pkg/
Generated code: This directory contains the JavaScript glue code and .wasm-file built from this crate.