novi-language
v0.1.1
Published
Novi Programming Language — an early developer preview by Glydex Studio.
Maintainers
Readme
Novi Programming Language
Novi is an independent programming language created by Glydex Studio. It is an early developer preview (v0.1.x) focused on a clean language pipeline and a small, understandable core.
Novi is not a clone of Python, JavaScript, TypeScript, C, Java, Rust, or another existing language. The project has its own lexer, parser, abstract syntax tree, runtime values, environments, interpreter, diagnostics, and command-line interface.
Philosophy
Novi starts small on purpose:
- readable syntax with
;terminated statements and{ }blocks; - explicit language constructs such as
say,check, andeach; - a real source-to-AST-to-runtime pipeline;
- clear runtime and parser errors with source positions;
- an implementation that can evolve without replacing the interpreter with generated JavaScript.
Current features
Novi v0.1.0 currently implements:
- dynamically typed variables;
- strings, numbers, booleans (
yes/no) andnone; sayoutput;- arithmetic and operator precedence;
- string concatenation;
- functions with parameters and
return; check/otherwiseconditions;eachloops over arrays;- arrays and indexing;
- objects with Novi-native properties;
- property access and
.lengthfor arrays and strings; - logical operators
and,or, and unarynot; - lexer, recursive-descent parser, AST and interpreter diagnostics;
- the
noviCLI; - automated lexer, parser and interpreter tests.
Installation
Novi currently targets Node.js and TypeScript for its implementation.
Clone or download the project, then install development dependencies:
npm install
npm run buildThe CLI entry point is dist/src/cli/main.js, and the package exposes the command novi through its bin field.
For a local shell command after linking the package:
npm link
novi --versionYour first Novi program
Create hello.novi:
say "Hello world from Novi!";Run it:
novi hello.noviExpected output:
Hello world from Novi!Syntax
Variables
name = "Nexus";
age = 19;
online = yes;
state = none;Output
say "Hello world";
say name;say is a Novi language statement handled by the interpreter. It is not implemented as a JavaScript function injected into the parser.
Arithmetic
a = 10;
b = 5;
sum = a + b;
difference = a - b;
product = a * b;
division = a / b;
remainder = a % b;Strings
name = "Glydex";
message = "Hello " + name;
say message;Functions
greet(name) {
say "Hello " + name;
}
greet("Nexus");Functions can return values:
add(a, b) {
return a + b;
}
result = add(5, 10);
say result;Conditions
age = 19;
check(age >= 18) {
say "Adult";
} otherwise {
say "Minor";
}Supported comparisons:
== != > < >= <=Logical operators:
and or notThe unary ! form of not is also accepted.
Arrays
users = [
"Nexus",
"Lyra",
"Dante"
];
say users[0];
say users.length;
say users;Each loops
each(user in users) {
say user;
}Objects
Object properties use Novi's assignment syntax and end with semicolons:
user = {
name = "Nexus";
age = 2;
};
say user.name;
say user["name"];.length is available on arrays and strings.
CLI
novi file.novi
novi --help
novi --versionOn language errors, the CLI reports a Novi error with the source filename, line and column and exits with a non-zero status.
Project structure
novi-language/
├── examples/
│ ├── hello.novi
│ ├── variables.novi
│ ├── functions.novi
│ ├── conditions.novi
│ ├── loops.novi
│ ├── arrays.novi
│ └── objects.novi
├── src/
│ ├── ast/
│ │ └── nodes.ts
│ ├── cli/
│ │ └── main.ts
│ ├── interpreter/
│ │ └── interpreter.ts
│ ├── lexer/
│ │ └── lexer.ts
│ ├── parser/
│ │ └── parser.ts
│ ├── runtime/
│ │ ├── environment.ts
│ │ └── value.ts
│ ├── errors.ts
│ ├── index.ts
│ ├── source.ts
│ ├── token.ts
│ └── version.ts
├── tests/
│ ├── helpers.ts
│ ├── interpreter.test.ts
│ ├── lexer.test.ts
│ └── parser.test.ts
├── CHANGELOG.md
├── LICENSE
├── package.json
├── README.md
└── tsconfig.jsonThe execution pipeline is:
Novi source
↓
Lexer
↓
Tokens
↓
Parser
↓
AST
↓
Interpreter
↓
Novi Runtime
↓
OutputDevelopment
Build the implementation:
npm run buildRun the automated test suite:
npm testThe test suite executes Novi programs and covers tokenization, AST construction, arithmetic, strings, variables, functions, returns, conditions, arrays, loops, objects, property access, parser errors and runtime errors.
Examples
The examples/ directory contains runnable .novi programs for the v0.1 language core.
novi examples/hello.novi
novi examples/variables.novi
novi examples/functions.novi
novi examples/conditions.novi
novi examples/loops.novi
novi examples/arrays.novi
novi examples/objects.noviRoadmap
v0.1.x
Core interpreter and language foundations.
v0.2.x
Better standard library and additional language features.
v0.3.x
Modules and imports.
v0.4.x
Bytecode and virtual-machine research.
v1.0.x
A stable language specification and a mature implementation.
These roadmap items are future work and are not part of the current v0.1.0 implementation.
License
Novi is released under the MIT License. See LICENSE.
Developer
Glydex Studio
Novi Programming Language — early developer preview, v0.1.0.
