This is a Norma-Machine simulator and visualizer designed to make easier learning about this Machine and Register Machine em general.
Norma Machine is a register machine proposed by Richard Bird in his book Programs and Machines: An Introduction to the Theory of Computation in 1976, this machine was disseminated in the study of theory of computation and is currently widely used by Brazilian universities for the study of this content. This machine works by manipulating the values stored in the registers through commands to increment or decrement the value and also allows making conditional flow deviation according to the registers.
Suggestions and bug reports are welcomed in issue.
For more info on the machine, please see the manual.
- Clone the repo.
cd
into repo- Install nvm, close and reopen terminal after install.
- Run
nvm install --lts
- To verify install run
node -v
// should output something similar to
v16.13.0
- This monorepo uses yarn workspaces under the hood. Install
yarn
by running
npm i -g yarn
- Install rustup + rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
// follow installation prompts, close and reopen terminal after install.
- Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- If in Ubuntu or similar, you need to install a CC linker (you might already have it if you've run sudo apt-get update before), run
sudo apt-get update
sudo apt install build-essential
- Yarn needs rust to be built at least once so it can cross reference dependencies in the monorepo. Run in the
packages/rust
directory
cd packages/rust
# build WebAssembly and Javascript wrappers using wasm-pack
# don't panic, this might take a few seconds
wasm-pack build --target web
# Then initialize yarn in the rust directory
yarn
# go back to the monorepo root directory
cd ../..
- Install node dependencies, run
yarn
- Install cargo watch
cargo install cargo-watch
- To start the development server, run
yarn dev