DEV Community

Cover image for Mufi Concept Toy-Lang
Mustafif
Mustafif

Posted on

2 1

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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay