Skip to content

Latest commit

 

History

History
60 lines (50 loc) · 1 KB

README.md

File metadata and controls

60 lines (50 loc) · 1 KB

Gor Language

Gor is interpreted programming langauge made with Golang. It has similar syntax to that of JavaScript.

Data types:

  • Language has 5 datatypes: number, string, null, object, array.

Variable declaration (static and non-static):

let a = 10
const b = ""

Print statement:

print(a)

Arithmetic operators & logical operators:

+, - , *, / , &, |

Comparison operators:

==, <=, >=, !=, &&, ||

Array and object declaration:

let a = [10, 2]
print(a[0])

const b = {
    hi: 10
}
print(b.hi)

Function declaration:

  • Functions can be declared using fn keyword
fn myFunc(a, b) {
    return a + b
}
myFunc(10, 20)

Loops:

  • Currently, the only loop Gor supports is the for loop.
for (let i = 0; i < 10; i = i + 1) {
    print(i)
}

Future Updates:

  • While loop
  • Unary operators (--, ++)
  • Multithreading