Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jayphelps/jayscript
A very small subset dialect of JavaScript
https://github.com/jayphelps/jayscript
Last synced: 21 days ago
JSON representation
A very small subset dialect of JavaScript
- Host: GitHub
- URL: https://github.com/jayphelps/jayscript
- Owner: jayphelps
- License: mit
- Created: 2020-08-21T23:42:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-22T18:57:33.000Z (about 4 years ago)
- Last Synced: 2024-10-11T04:08:23.406Z (27 days ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JayScript
## Install
```bash
npm install jayscript -g
```## Usage
Currently JayScript only supports function declarations that take no arguments and can only have return statements. The return statement must return either an integer, or a binary expression of addition.
##### example.js
```js
function main() {
return 1 + 2;
}
``````bash
jayscript example.js(module
(type $none_=>_i32 (func (result i32)))
(export "main" (func $0))
(func $0 (result i32)
(return
(i32.add
(i32.const 1)
(i32.const 2)
)
)
)
)```
### Options
If you want to optimize the Wasm output, you can pass the `-Oz` flag:
```bash
jayscript example.js -Oz(module
(type $none_=>_i32 (func (result i32)))
(export "main" (func $0))
(func $0 (result i32)
(i32.const 3)
)
)
```## Notes
[This is just a joke.](https://twitter.com/_jayphelps/status/1296980153294368773) :shipit: