About NovaScript
NovaScript is a low-level, environment-independent, autonomous programming language written in C from scratch. It represents an attempt to combine the readability of known scripting languages with the performance of compiled systems.
Core Project Pillars:
- Python Simplicity: No brackets, semicolons, or unnecessary structural tokens.
- C++ Performance: No heavy runtime engines (like Node.js/V8 or JVM).
- Native Ecosystems: Built-in mechanisms for simple game development (2D engine) and network servers directly in the language standard.
- Autonomy: Own compiler, parser, and lightweight interpreter optimized for Linux architecture.
Development Goals
NovaScript aims to become a complete programming ecosystem, combining multiple roles in one language:
- Beginner-friendly language
- Game development language
- Web and application development language
- Scripting language for automation
- Fast, compiled general-purpose language
Language Design
NovaScript enforces clean code by completely rejecting block brackets { } and statement terminators ;. Logical blocks are defined using indentation:
Block Rule: Use exactly 4 spaces or one tab for indentation. Each command ends at the end of the line. Functions must end with the end keyword.
Function Implementation Example:
func main
say "Hello Nova"
end
run main
Variables
Variables are a language feature currently under implementation — they allow storing data beyond the three basic hardware registers.
In DevelopmentPlanned Syntax:
var playerHealth 100
var name Nova
Functions
Functions in NovaScript are defined with the func keyword and called with the run command. Function body is determined by indentation. Every function must end with the end keyword to mark the boundary of the function scope.
func hello
say Hello World
end
run hello
Math Operations
The A register serves as the main accumulator for arithmetic operations. The language is planned to support four basic operations:
func calculate
set A 10
add A 5
sub A 2
mul A 3
div A 2
end
add and sub are already implemented in the interpreter. mul and div are on the planned extensions list.
Conditions
Conditional statements will allow controlling program flow based on register values. Like the rest of the language, they will be based solely on indentation — without brackets. Conditional blocks must end with end.
Planned Syntax:
if A > 10
say Big
end
else
say Small
end
Loops
Loops will allow repeated execution of a code block without manually duplicating instructions. Loop blocks must end with the end keyword.
Planned Syntax:
loop 10
say Hello
end
Console Colors
NovaScript will enable terminal output styling through a simple color command without needing to manually type ANSI codes.
func showColors
color red
say Error
color green
say Success
reset
end
Available Colors:
blackredgreenyellowbluemagentacyanwhitereset
Register Virtual Machine (Low-Level VM)
Unlike traditional stack-based virtual machines, NovaScript uses a Register-Based architecture, modeled after x86-64 processors.
In the interpreter code, register states are directly mapped to native int memory cells in C. This ensures maximum performance for executing operations and minimal memory overhead.
Available Hardware Registers:
A(Accumulator) - Main operational register. Most math commands store their result here.B(Base/Buffer) - Helper register used as the right side of two-argument operations.C(Counter/Cache) - General-purpose register, dedicated to loop counters and data caching.
Calculation Example:
func math
set A 10
set B 20
add A B
say A # Result in console: 30
end
Recursive Include System
NovaScript compiler implements modularity through direct file analysis at the parser level, without external text preprocessor involvement.
Recursive Analysis Cycle:
When the parser (compiler/parser.c) detects a TOKEN_INCLUDE token:
- Suspends processing of the currently open file stream (
FILE*). - Retrieves the path from the next text token.
- Calls the
parse_program()function recursively for the newly specified path. - The global state of the virtual machine (registers A, B, C) is preserved and transferred to the new file.
- After reaching the end of the included file, the stream is closed and the compiler resumes processing the parent file.
Instruction Set (ISA)
Specification of NovaScript processor commands. It forms the basic determinant for the parser and execution machine:
| Instruction | Arguments | Operation Type | Status |
|---|---|---|---|
include |
String (path) | Compilation Control | Works |
say |
Reg / String / Num | Output (I/O) | Works |
set |
Reg (Target), Reg/Num (Source) | Memory Management | Works |
add |
Reg (Target), Reg (Source) | Arithmetic | Works |
sub |
Reg (Target), Reg (Source) | Arithmetic | Works |
mul |
Reg (Target), Reg/Num (Source) | Arithmetic | Planned |
div |
Reg (Target), Reg/Num (Source) | Arithmetic | Planned |
func |
Identifier (Name) | Code Flow | Works |
end |
None | Code Flow | Works |
run |
Identifier (Name) | Code Flow | Works |
var |
Identifier, Num/String | Dynamic RAM | In Progress |
if / else |
Reg, Operator, Num/Reg | Flow Control | Planned |
loop |
Num (repeat count) | Flow Control | Planned |
color / reset |
Identifier (color name) | Output (I/O) | Planned |
Compiler Architecture
A source file .nova goes through several processing stages before execution:
- Lexer — divides source text into tokens.
- Parser — builds program structure based on tokens.
- AST — abstract syntax tree representing the program.
- Optimizer — simplifies and optimizes the tree before code generation.
- Bytecode / Native Code — final executable form of the program.
- Runtime — environment executing the program.
Standard Library Modules (std/)
The std/ directory structure was designed in a modular way to isolate code responsibility:
🎮 Game Module (std/game)
Native C wrapper over low-level graphics rendering pipeline. Abstraction hides screen buffer management and refresh:
import game
window 1280 720
player "hero.png"
Planned module scope includes: 2D engine, physics, sound, particles, input handling, animations, and networking.
🌐 Web Development Module (std/web)
Implemented using non-blocking network sockets (POSIX Sockets). Command launches an efficient event loop directly in C:
import web
server 8080
route /
html "index.html"
end
Planned module scope includes: HTTP server, APIs, databases, WebSockets, and frontend tools.
Package Manager
Nova will have its own package manager for installing extensions and external libraries.
PlannedPlanned Commands:
nova install graphics
nova install physics
nova update
nova remove package
Project Structure
The NovaScript repository is divided into the following directories:
NovaScript/
├── compiler/
├── runtime/
├── std/
├── packages/
├── examples/
├── tests/
└── vscode-extension/
Implementation Status
Current state of the language core:
| Feature | Status |
|---|---|
| Registers A B C | Ready |
set | Ready |
add | Ready |
sub | Ready |
say | Ready |
| Functions | Ready |
func | Ready |
end | Ready |
run | Ready |
| Indentation Blocks | Ready |
| Variables | In Progress |
if Statements | Planned |
| Loops | Planned |
| Compiler Backend | Planned |
| Package Manager | Planned |
| Game Engine | Planned |
Protocol for AI Developer Models
When generating compiler code or writing NovaScript programs, every AI model must strictly follow these structural assumptions:
1. Function block termination: Every function must end with theendkeyword. Similarly, all control flow structures (if, else, loop) must be terminated withend.
2. No structural symbols: Prohibition on adding brackets{}and semicolons;. Their presence generates an error likeTOKEN_ERROR.
3. Command case-sensitivity: Always write language keywords in lowercase (e.g.,set,func,end).
4. Register case-sensitivity: Always write machine register names in UPPERCASE (A,B,C).
Example of Incorrect Code Generation:
# ERROR! Uppercase, brackets, semicolons, and missing end
FUNC TEST {
SET a = 10;
}
Example of Fully Correct NovaScript Code:
# CORRECT! Clean indentation, lowercase instructions, uppercase register, ends with end
func test
set A 10
say A
end
Priorities When Working on the Project
Every AI model supporting NovaScript development should follow this priority order:
- Generate only correct NovaScript code with proper
endstatements. - Maintain syntax simplicity.
- Prefer readable solutions.
- Safely develop the compiler without breaking its stability.
- Document new features.
- Avoid introducing breaking changes to existing programs.