Crates.io | nexus-lib |
lib.rs | nexus-lib |
version | 0.1.0 |
source | src |
created_at | 2024-01-19 19:41:32.202569 |
updated_at | 2024-01-19 19:41:32.202569 |
description | The raw implementation of the nexus scripting language |
homepage | |
repository | |
max_upload_size | |
id | 1105671 |
size | 69,171 |
Nexus is a smart, modern and powerful scripting language.
It was built for creating packages and extensions for rust applications.
Similar to it's father language rust, Nexus has features from both oop and fp.
This includes polymorphism and in some limited cases inheritance.
As for functional programming it supports higher-order functions, mapping, annonymous functions
[WIP] It also allows you to interact with rust code from your nexus script to create libraries or api bindings
The language takes inspiration from go & kotlin as well as some features from python and rust
If you want to try out Nexus you will need to compile it manually for now.
To do this follow these steps:
Download rust here: https://www.rust-lang.org/tools/install
Run the main.rs file by executing cargo run
in the terminal
Currently text.nx contains the sample source code
Let's start off simple with a "Hello, World" program
print("Hello, World")
Let's start defining some variables to make our code cleaner and more flexible
var message = "Hello, World!"
print(message)
Let's improve the code a bit
const message = "Hello, World!"
print("{message} <- what a cool message")
output:
Hello, World! <- what a cool message
Let's look at what we have done here.
First we changed from var
to const
which means we can not modify the variable. This leads to better performance.
Instead of printing the value we reference the message string in the print function using $
. This allows us to better manipulate the output text and makes it a lot cleaner overall.
We can further simplify it
message :: "Hello World!"
print("{message} <- what a cool message")
Using ::
we can quick-assign a const to a value. This also works for vars using :=
For more information look at the docs.
This project wouldn't have been possible without the help of these amazing people!
Thepigcat76 - Project lead and lead dev
TheHackerChampion - Developer and Design team
If you want to contribute yourself, follow the Installation Guide. Also make sure to read and follow the Style Guide
The original implementation was made possible through waiig (MonkeyLang) and yesmeck's amazing implementation of ML in rust