The NG Programming Language

NG Language Semantics

Object System

Type Definition

type TypeName {
    property propName;
    property propName2;

    fun methodName(param1, param2) {
        // method body
        return expression;
    }
}

Object Creation

val obj = new TypeName {
    propName: value,
    propName2: value2
};

String Operations

Concatenation

"Hello" + " " + "World"  // "Hello World"

Methods

"text".size()  // returns length
"text".charAt(index)  // returns character at position

Modules

Import/Export

import { name1, name2 } from "module";
import * as alias from "module";

export name1, name2;
export *;

Built-in Functions

print(expr1, expr2, ...)  // prints values to stdout
assert(condition)  // raises error if condition is false

Expression Evaluation