Giter Site home page Giter Site logo

luk3d / nos Goto Github PK

View Code? Open in Web Editor NEW
24.0 8.0 3.0 70.44 MB

Multi purpose programing language written in Rust

Home Page: https://www.nos.luk3d.com

Rust 100.00%
programming-language python-source awesome-made-by-angolans luk3d-angola luk3d-nos nos-source

nos's Introduction

nos-logo

😌 WELCOME TO PROJECT {NOS}

{Nos} (NΓ³s), Its an interpreted language written in Rust.

The focus of this project is to create a language that can be easier to learn.

little example application to show the {NOS} Syntax πŸ™‚

/*
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ BASIC NOS CODE EXAMPLE                                                  |
  | 23/05/2022 - luk3d                                                      β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 */

def name s = 'Filipe Lukebana';
def number_1 i = 2;
def number_2 f = 34;
def is_gather b = fls;


/** Defining a New Function**/
fn main (def cmd_arguments stack<s>) {
    out('Enter the name: '); //Print a message on cmd
    name = in(); //reading the user input
    out('Enter the first Number: ');
    number_1 = i.parse(in());
    out('Enter the Second Number: ');
    number_2 = i.parse(in());
    /**Adding two numbers**/
    add(number_1,number_2);
}

/** Function to add two numbers**/
fn add (def n1 f, def n2 f)->i {
    rtn n1+n2;
}


/** Function that returns a Stack of Numbers**/
fn range(def number f)->stack<f>{
    def numbers stack<f> = [];
    def counter i = 0;
    loop(fn(){
        number.add(counter);
        counter++;
        if(counter == number){
            breack;
        }
    });
    return numbers;
}

/** Function to get the even numbers between 0 "number" x **/
fn evenNumbers(def number f){
    def numbers stack<f> = [];
    loop.on(range(number),fn(_i){
        if((_i%2) == 0){
            numbers.add(_i);
        }
    });
    return numbers;
}

πŸš€ CURRENT STATE

Lexer / Tokenizer

Example:

INPUT -> 1.2+22+1.3/4
//The above input is tanslated to this tokens by the {NOS} Lexer
OUTPUT-> [FLOAT:1.2][PLUS][INTEGER:22][MULTIPLY][FLOAT:1.3][DIVIDE][INTEGER:4]

Parser

Abstract Syntax Tree (AST)

Example:

INPUT -> 1+2*32/3*5
//The above input is translated to this tokens by the {NOS} Parser πŸ˜€
(
    ComplexExpression: Operator: * 
        (
            (
                BinaryExpression: operator: + 
                    (
                        NumericLiteral: 1, NumericLiteral: 2
                    ) , 
                    (
                        ComplexExpression: Operator: / 
                            (
                                BinaryExpression: NumericLiteral: 32 , 
                                (
                                    (
                                        BinaryExpression: operator: * 
                                            (
                                                NumericLiteral: 3, NumericLiteral: 5
                                            )
                                    )
                                )
                            )
                    )
            )
        )
)

The above Example Represented as Graph.

NOS AST

devellopment

In progress...

nos's People

Contributors

denispower1 avatar imgbotapp avatar luk3d avatar nurul-gc 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nos's Issues

Vai se limitar na facilidade de aprendizagem?

A linguagem parece ser bem interessante, apesar de não ter visto ela ainda em ação, mas por que se limitar apenas na facilidade de aprendizagem?

A linguagem estÑ sendo escrita em Python, Python também é bastante simples, e de uma certa forma facilita bastante para quem vai começar na Ñrea, mas ela não se limita à isso.

E deveria ter uma parte na documentação que faz a comparação entre a linguagem(Nos) e o Portugol, sendo que ambas tΓͺm o mesmo foco.

Sugestão de organização!

Olaa Companheiro..
espero que esteja tudo bala por aΓ­!

bom, antes de tudo, quero parabenizar-te pela iniciativa e dizer que este Γ© um projecto muito interessante!

mas, tem um probleminha, para um projecto open-source ele estΓ‘ um pouquinho desorganizado,
estou a tentar contribuir com a parte do sdk baseado em python (minha especialidade) mas a desorganização do projecto me estÑ deixando confuso..

ainda nΓ£o percebi como o js usa o python para executar os seus codigos..
por favor faça uma analise no projecto, elimine ficheiros desnecessÑrios e simplifique-o!

obrigado
keep_awesome!

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.