DEV Community

Cover image for I made a unique compiled programming language in Rust without LLVM
Morcules
Morcules

Posted on

I made a unique compiled programming language in Rust without LLVM

Hello. My name is Morcules.

I’ve had a unique idea of making a programming language that has 0 optimizations. Everything works as expected.

The goal is to:

  • provide maximum control for the user.
  • zero hidden optimizations.
  • Assembly, but more readable, std library and structured.
  • Provide many compile time features and maybe even optimizations using manual specification: @[unroll]

I started to work on it only like a month ago. I’ve had some starting points from like a year ago, but most of them were discarded.

It’s mostly made for embedded, os dev or anything that needs to just work as written. It compiles to assembly (Right now only to arm64) tested only on mac apple silicon. If you have any questions feel free to ask them.

I would really appreciate some help, because I see myself using this language.

Even small things like descriptive comments would really help me.

I don’t consider myself as a programmer that writes good code. Many things were written fast without considering many things.

Github: https://github.com/Morcules/byte-lang

Example Source Code:

// This doesn’t make sense it’s just random instructions showing everything that works right now //

void : term(i64 exit_code : [reg(x0)]) { 
    asm(format("mov x1, #{}\nmov x16, #1\nsvc #0x80\n", 10));
}

void : test(i32 test_var : [stack], i64 test_var_two : [stack]) {

}

void : main() { 
    i32 var = 5; 
    i16 var2 = 2; 
    i8 var3 = 1; 
    i64 exit_code = 30; 
    i64 exit_code_clone = exit_code; 
    u64 test = 10; 
    u8 something = 30; 
    u8 something_clone = something; 
    i64 exit_code_success = 0;

    bl(test, var, exit_code_clone);

    bl(term, exit_code_success);
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)