Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p7g/js-bytecode-vm
A little bytecode VM implemented in JS
https://github.com/p7g/js-bytecode-vm
Last synced: about 1 month ago
JSON representation
A little bytecode VM implemented in JS
- Host: GitHub
- URL: https://github.com/p7g/js-bytecode-vm
- Owner: p7g
- Created: 2019-08-02T05:12:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T11:10:25.000Z (almost 3 years ago)
- Last Synced: 2023-03-10T20:41:56.380Z (almost 2 years ago)
- Language: JavaScript
- Size: 191 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A small bytecode VM in javascript
This is a pretty simple bytecode VM implemented in javascript. I have also
written a little language to go with it and to try stuff out, though the
semantics of that language are mostly defined by the abstract syntax tree, and
the VM can be made to work very differently.## How to
1. Compile the grammar by running `make`
1. Check out the sweet railroad diagrams generated at `grammar/grammar.html`
1. Write a cool script in a file (good luck figuring out how the language works)
1. Run it `npm run start -- mycoolscript.jsbcvm`Here's a snippet of the language:
```js
function multiplier(a) {
return b => a * b;
}var times2 = multiplier(2);
print(times2(4));
```## Next steps
- other datatypes (hashmap)
- modules
- There is currently support for `include`-style imports, but that kinda
sucks