1 unstable release

0.1.0 Jan 19, 2024

#662 in Programming languages


Used in nexus-api

MIT license

54KB
1.5K SLoC

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

Dependencies