https://github.com/okkindel/geckojs
An interpreted, object-oriented and statically typed programming language inspired by TypeScript, Java and Scala written in JavaScript. I will continue it as I will have more time.
https://github.com/okkindel/geckojs
gecko language programming-language
Last synced: 11 months ago
JSON representation
An interpreted, object-oriented and statically typed programming language inspired by TypeScript, Java and Scala written in JavaScript. I will continue it as I will have more time.
- Host: GitHub
- URL: https://github.com/okkindel/geckojs
- Owner: okkindel
- Archived: true
- Created: 2018-08-19T14:06:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-20T07:55:07.000Z (over 7 years ago)
- Last Synced: 2025-02-27T23:38:07.902Z (about 1 year ago)
- Topics: gecko, language, programming-language
- Language: JavaScript
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GeckoJS
### An interpreted, object-oriented and statically typed programming language inspired by TypeScript, Java and Scala written in JavaScript.
### How to setup
GeckoJS is implemented in [ES6](https://en.wikipedia.org/wiki/ECMAScript#ES6) and the interpreter requires [Node.js](https://nodejs.org/en/) >= 4.2.2 to run.
With Node.js installed, type the following commands in a prompt to setup GeckoJS.
1. ```$ git clone https://github.com/okkindel/GeckoJS.git```
2. ```$ cd GeckoJS```
3. ```$ npm install```
### How to build
Run ```npm run build``` to build.
### How to run
Run ```npm run gecko``` to start an shell for writing GeckoJS programs.
## Language Documentation:
### Data types:
Gecko supports values of types like `Int`, `Double`, `String`, `Bool` and `Void`. All types in Gecko inherit from a supertype `Object`.
### Comments:
Anything from the `//` to the end of line will be ignored by the interpreter.
```
// This is a comment.
```
### Conditions:
Conditions are expressed using an if-else expression.
```
if (condition) {
(do something)
} else {
(do something)
}
```
### Functions:
Functions are defined using the `funcion` keyword. Parameters are separated by `,` and enclosed in parenthesis `(a: Int, b: Int)`. A parameter is followed whith `:` by its type function languages way.
```
funcion sum(a: Int, b: Int): Int = {
a + b
}
```