nexus-lib

Crates.ionexus-lib
lib.rsnexus-lib
version0.1.0
sourcesrc
created_at2024-01-19 19:41:32.202569
updated_at2024-01-19 19:41:32.202569
descriptionThe raw implementation of the nexus scripting language
homepage
repository
max_upload_size
id1105671
size69,171
thepigcat76 (Thepigcat76)

documentation

README

Nexus

Introduction

Nexus is a smart, modern and powerful scripting language.

It was built for creating packages and extensions for rust applications.

Features

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

Inspiration

The language takes inspiration from go & kotlin as well as some features from python and rust

Installation

If you want to try out Nexus you will need to compile it manually for now.

To do this follow these steps:

Currently text.nx contains the sample source code

Documentation

Getting started

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.

Contributors

This project wouldn't have been possible without the help of these amazing people!

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

Commit count: 0

cargo fmt