the-neutron-foundation / neutron-language

A simple, extensible and efficient programming language based on C and Python
https://the-neutron-foundation.github.io
GNU General Public License v3.0
32 stars 0 forks source link
efficient neutron programming-language programming-languages python python3 sly

The Neutron Programming Language

Codacy grade Website License Code style: black

Neutron is a high level general-purpose programming language that is inspired by C and Python.

Example

Here is how to do the guess the number game in neutron:

import "types";
import "io";
import "random::randrange";

is_not_win = true;
number = randrange(0, 100);
num_guesses = 0;

while (is_not_win) {
  guess = types::to_int(io::stdin(prompt="Enter A Number Between 0 and 100: "));
  if (guess == number) {
    io::print("You Win!");
    is_not_win = false;
  } else if (guess < number) {
    io::print("Too Low");
  } else if (guess > number) {
    io::print("Too High");
  }
}

Documentation

There is a documentation here for full documentation and installation instructions. There is also a Gitter Chat here.

Dependencies

Before installing/building/running neutron, you should first install the dependencies. you can do this via pip3 or any other package manager. The dependencies required are:

Basic Usage

To use, run the filename as the first argument. It is recommended to use the python interpreter to run the code (just run the neutron folder), like so:

python3 neutron path/to/neutron/file.ntn

The filename for neutron files is .ntn. For example, important_file.ntn. If you want to use the compiled binaries, on Unix-like systems, you could do:

./neutron.bin path/to/neutron/file.ntn

Syntax Highlighting

Text Editor Where to find
Atom Atom Package Repository (language-neutron)

Why Neutron?

Features

There are constantly new features being developed in neutron. To see the features that are coming and the one that are being worked on, go here.

Tools used