Skip to content

Latest commit

 

History

History
74 lines (51 loc) · 1021 Bytes

README.md

File metadata and controls

74 lines (51 loc) · 1021 Bytes

gScript

A new programming language built on TypeScript ✨

Note: This is the interpreter/"compiler" lib, the CLI tool is used in the given examples.

IN EARLY DEVELOPMENT STAGES

Install

Prerequisites:

  • Node JS
  • NPM

Using NPM

npm install gscript-cli -g

Using Yarn

yarn global add gscript-cli

Running A File

gs run ./path/to/file.gs
or

gscript run ./path/to/file.gs

Syntax

At the moment, there are only two keywords, def, and log.
def defines a variable and it's corresponding value.
log logs something in the console
// at the start of a line means that it is a comment.

Examples:

def HW = "Hello World"
log HW
// returns Hello World

def MyArr = ["MyArray"]
log MyArr
// returns ["MyArray"]

// log a string
log "This is a string"
// returns This is a string

// split a string and log it.
log "This is a string".split(" ")
// returns ["This", "is", "a", "string"]