Nova is an opensource programming language built on node. The purpose of Nova is to make a pure psuedo-code language that is the perfect introduction into computer science. Completely built on node v12 and connected to npm packages, Nova is optimized for running on mac, linux and windows!
I made this project to make a pseudocode based language that simplified computer science. Nova's main purpose is to make it easier for non-programmers to learn the basics of coding. Using words such as "set" and "as" and "equals" makes it easier to follow and understand what is happening.
To get started go to usage and start your Nova journey today.
To support me, DanCodes, you can donate to my Patreon or just give this project a star :)
To use nova you can either evaluate with the "-e/--eval" option in the command line or make a novascript. A novascript is a file ending in .ns
and is made for nova. These files can be ran by the nova-cli.
$ npm i -g cli-nova
$ nova [options] [file]
$ nova test.ns
$ nova --verbose test.ns
$ nova -e "output.log('HI!');"
// We recommend setting swift for language highlighting
set variable as "hello"; // "Strings"
output.log(variable); // Logging
set two as 1 + 1; // Numbers
set array as [1,2,3,4,5];
set chalk as include("chalk"); // Npm integration
output.log(chalk.red("Red text")); // Logs red
output.log(12 / 2 % 2 + 1); // Logs 3
if two equals 2 then output.log("two is equal to 2");
if two isnot 2 then output.log("won't be logged") else output.log("two is not not equal to 2");
For variables we use two keywords, "set" and "as". All variable values are evaluated on initiation and stored in memory. They can be referenced at any time throughout the code and are global.
set hello as "world1";
output.log("hello " + hello.slice(0, -1)); // output: hello world
Variables can also be set to npm modules and other files. Modules can be installed using npm.
set chalk as include("chalk");
set path as include("path");
set redText as chalk.red("red text");
output.log(redText);
set package as include(path.resolve("./package.json"));
output.log("Running v" + package.version);
Description: Args is defined as arguments passed in the command line when starting nova.
Type: Array
Example:
// test.ns
output.log(args);
// Command line
$ nova test.ns --test
['--test']
Description: The platform the program is being run on, for example: linux, darwin and win32
Type: String
Example:
// test.ns
output.log(platform);
// Command line on macbook
$ nova test.ns
darwin
Description: The process running containing information and functions to manipulate
Type: Object
Examples:
// test.ns
set exitCode as 0;
output.log("Process id is " + process.pid);
process.exit(exitCode);
// Command line
$ nova test.ns
Process id is 12345
Description: File information and Nova information
Type: Object
Examples:
// test.ns
output.log(Nova);
// Command line
$ nova test.ns
{
directory: '/files',
node: 'vX',
version: 'vX',
}
Description: Intervals and timers that allow you to run something every certain time or after a certain time
Type: Function
Examples:
// test.ns
set timer as startTimer(() => { output.log("After one second, I have logged") }, 1000);
set interval as startInterval(() => { output.log("I log every 5 seconds") }, 5000);
startTimer(() => { stopTimer(timer); stopInterval(interval); }, 11000);
// Command line
$ nova test.ns
After one second, I have logged
I log every 5 seconds
I log every 5 seconds
Description: Include is an alias of node require and allows users to import npm modules and seperate files.
Type: Object
Examples:
// test.ns
set chalk as include("chalk");
output.log(chalk.red("I am red text :)"));
// Command line
$ nova test.ns
I am red text :)
Description: Output is an alias of node console and lets you output to the console
Type: Object
Examples:
// test.ns
output.clear(); // This clears the output
output.log("This is regular log");
output.error("This is an error");
output.info("This is some info");
// Command line
This is regular log
This is an error
This is some info
👤 DanCodes [email protected]
- Website: https://dancodes.online
- Github: @dan-online
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 DanCodes [email protected].
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator