/Rusty-JS-Compiler

A compiler for Rusty JS

Primary LanguageC#

Rusty JS 🛠️⭐

Hi there! This is my compiler for Rusty JS!

What's Rusty JS?

Rusty JS is a compiler wich allows you to write clean Rust look alike code and compile it into Vanilla JavaScript.

Examples:

    class Person
        pub mut name:str;
        priv mut age:i32;
        
        fn _init_(name:str, age:i32)
            $.name = name;
            $.age = age;
        end
    end
    log!("Hello world!");
    _doc.query_all('p');
    _doc.query('p');
    fn add(x:f32,y:f32)
        ret x + y;
    end

JS

    class Person {
        constructor(name,age) {
            this.name = name;
            this.age = age;
        }
    }
    console.log("Hello world!");
    document.querySelectorAll('p');
    document.querySelector('p');
    function add(x,y) {
        return x + y;
    }

Commands

RSC -v or RSC --version - Display compiler version. RSC -f file.rsjs - Compiles specific file. RSC -f file.rsjs -o build.js - Compiles specific file and saves it in given path. RSC --init - Initialize an empty new RustyJs project. RSC - Compiles files based on rsjs.config.json

logo-rsjs

It's still in progress!