Giter Club home page Giter Club logo

neutron-language's Introduction

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?

  • It's actively maintained
  • It's a versatile programming language suited for many things
  • New features are constantly being added

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.

  • 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

Tools used

neutron-language's People

Contributors

codacy-badger avatar monlih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

neutron-language's Issues

Dependabot couldn't find a requirements.txt for this project

Dependabot couldn't find a requirements.txt for this project.

Dependabot requires a requirements.txt to evaluate your project's current Python dependencies. It had expected to find one at the path: /requirements.txt.

If this isn't a Python project, or if it is a library, you may wish to disable updates for it from within Dependabot.

You can mention @dependabot in the comments below to contact the Dependabot team.

Interpreter written on top of an interpreter?

This implementation will end up being quite slow, given that your writing this high level language in another interpreted high level language. Perhaps consider writing a bytecode compiler. You could compile your parse tree to Python bytecode and have it run on the Python VM. This is a good option because you're already writing it in Python so getting it to work should be easy, although Python bytecode is slightly non-standardised, so that's a con.
Alternatively you could rewrite this AST traversing interpreter in a compiled language and give it a speed boost, or even do that and write a virtual machine and compile it to your own bytecode.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.