Neutron is a high level general-purpose programming language that is inspired by C and Python.
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");
}
}
There is a documentation here for full documentation and installation instructions. There is also a Gitter Chat here.
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:
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
Text Editor | Where to find |
---|---|
Atom | Atom Package Repository (language-neutron) |
- It's actively maintained
- It's a versatile programming language suited for many things
- New features are constantly being added
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.
- Numpy arrays Builtin!!
- Classes
- Functions
- Built-Ins (e.g. print, get, stdin, to_int)
- Primitive Types (Integers, Floats, Booleans, Strings)
- Python Lists, Tuples and Numpy Arrays Builtin
- While loops
- For Loops
- Import statements
- C-like Structs
- Switch Statements
- Syntax Changeable at Runtime
- Sly lex yacc used for parsing
- Python 3 (can be used with CPython, Nuitka, or PyPy)