Custom interpreted language focused on minimal syntax
- interpreted
- statically typed
- supports most common arithmetic and logic operations
- functions and QoL loops
- object-oriented
- inheritance
- minimal syntax
ShortScript.g4
contains the whole grammar of the language.
- ANTLR4
- ANTLR4 for Javascript
- Other packages, listed in package.json
- Toolbar with following options:
Run code
- allows you to run your codeAuto run
- automatically runs the code if you're not typing- Dropdown list allows you select sample programs
- Syntax highlighting for ShortScript
- Error highlighting when running the code
More examples, for both grammar and working programs, can be found in examples
directory
n f fib(n num){
if(num <= 0){
r 0
}
if(num == 1){
r 1
}
r fib(num - 1) + fib(num - 2)
}
print('Result: ' + fib(8))
Result: 21
To build and run the interpreter, you need to have antlr4
installed on your system and present on PATH
. It is advised to follow the official documentation.
For additional features (such us grammar testing), you also need to install antlr4-tools
, using the official documentation.
Application requires NodeJS >=20.9.0
to run smoothly. Running ShortScript on other versions of Node might lead to errors.
- Clone the repository
git clone https://github.com/Spookyless/ShortScript.git
cd ShortScript
- Install dependencies
npm install
- Start the development server
npm run dev
- ...or, build the application and start the production version:
npm build
npm start
New tab in your default browser should open (usually on localhost:3000
). When development server is ready, you'll have a full access to ShortScript IDE.
All tests suites can be launched using a single script:
npm test
If you want more granular control over what tests are run, you can execute specified stages (found in package.json
):
npm run test:grammar
Test cases are located inside examples/grammar
directory.
ShortScript is licensed under MIT License, more information can be found in the LICENSE.md
file