https://github.com/GiavaScript/GiavaScript
GiavaScript JavaScript runtime ✨💎🚀✨
https://github.com/GiavaScript/GiavaScript
giavascript gs javascript js linux macos mit runtime windows
Last synced: 18 days ago
JSON representation
GiavaScript JavaScript runtime ✨💎🚀✨
- Host: GitHub
- URL: https://github.com/GiavaScript/GiavaScript
- Owner: GiavaScript
- License: mit
- Created: 2026-01-03T02:49:03.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-06-15T01:41:26.000Z (21 days ago)
- Last Synced: 2026-06-15T03:20:44.805Z (21 days ago)
- Topics: giavascript, gs, javascript, js, linux, macos, mit, runtime, windows
- Language: Crystal
- Homepage:
- Size: 383 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
- awesome-crystal - GiavaScript - Open-source, cross-platform JavaScript runtime (Implementations/Compilers)
README
GiavaScript
GiavaScript is an open-source, cross-platform JavaScript runtime implemented in Crystal.
It intentionally does not aim for full ECMAScript compliance. Check the reference docs before relying on specific language features.
## Quick start
### Prerequisites
- [Crystal](https://crystal-lang.org/) 1.19.1 or later
- Python 3 (only needed to regenerate `reference/REFERENCE.md`)
### Install the CLI
```bash
git clone https://github.com/memburg/GiavaScript.git
cd GiavaScript
./install.sh
```
This installs the `giavascript` binary to `/usr/local/bin` by default.
Install to a user-local path instead of `/usr/local/bin`:
```bash
INSTALL_DIR="$HOME/.local/bin" ./install.sh
```
Make sure your install directory is on `PATH`.
## CLI usage
### Start the REPL
```bash
giavascript
```
REPL commands:
- `:quit` exits the REPL.
### Run a file
```bash
giavascript path/to/program.js
```
Behavior to expect:
- Empty files return an error.
- If a runtime error occurs, messages are written to standard error.
- Process exit code is `1` when any `Error:` message is produced; otherwise `0`.
### Run without installing
```bash
crystal run src/giavascript_cli.cr -- examples/templateLiterals.js
```
## Development workflow
Install dependencies and run tests:
```bash
shards install
crystal spec
```
Regenerate consolidated reference docs after editing files under `reference/`:
```bash
python3 scripts/generate_reference.py
```
CI verifies that `reference/REFERENCE.md` matches generated output.
## JavaScript feature reference
- [Consolidated reference](reference/REFERENCE.md)
- [Language features](reference/Language.md)
- [Type methods and properties](reference/Types.md)
- [Math](reference/Math.md)
- [JSON](reference/JSON.md)
## Examples
Sample programs are in `examples/`:
- `examples/templateLiterals.js` - string interpolation and expression formatting
- `examples/arrayFlatFlatMapSplice.js` - array manipulation methods
- `examples/dateBasics.js` - Date object usage
- `examples/functionExpressionsAndOperators.js` - function expressions and operators
- `examples/multilineMethodChaining.js` - method chaining patterns
- `examples/objectKeysValuesEntries.js` - Object.keys, values, entries
- `examples/random.js` - random number generation
- `examples/tryCatchFinally.js` - error handling with try/catch/finally
Run any example with:
```bash
giavascript examples/templateLiterals.js
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, test, and documentation update guidelines.