DEV Community

Cover image for Mufi Concept Toy-Lang
Mustafif
Mustafif

Posted on

Mufi Concept Toy-Lang

I've been considering implementing my own toy language (which I hope I can expand to a more production) once I finish reading reading Robert Nystorms Crafting Interpreters. This language similar to clox in the book will be written with a byte-code compiler in either C or Rust. My current idea is to go C, and down the line start porting it to Rust if I'd like, so how does the language look like?

Well it will be an OOP Language, so it will feature things like classes, and follow a C-style syntax. Let's look at a sample program to get a better idea:

class Foo{
   var member1;
   var member2;
   func new(val1, val2){
      member1 = val1;
      member2 = val2;
   }
}

func main(){
   var foo = new Foo(5, 4);
}
Enter fullscreen mode Exit fullscreen mode

This is a rough idea, but again this is all concept and can easily change. I will probably start off as a dynamic typing, but as a preference I'd like to make the language statically typed, and have separate mutable and immutable bindings like var/const. This language will have a garbage compiler (a mediocre one), and will start with a builtin standard library.

I already made a little logo for the language, comment your thoughts about this project, and contributors are welcomed to join this interesting, and pain with the fun project.

Mufi-Lang Logo

Top comments (0)