Writing a Compiler and Interpreter in Rust - Part 1
Vložit
- čas přidán 5. 05. 2024
- In this series, we write a compiler and interpreter for my stack based language "MCL" (a programming language I designed) in Rust. Originally written in C++, we investigate how it works, rewrite it in Rust, and optimize the hell out of it.
In this episode, we look at the old code, and then get into actually writing some Rust! Exciting.
The codebase will be on GitHub, but in this video we don't produce enough code to push anything yet. The original mcl is at github.com/lionkor/mcl - Věda a technologie
Was hoping to write an interpreter and learn Rust so this is precisely what I was looking for! Excited for the series
Hope you enjoy it! Taking a few weeks break for my thesis, but then I'll be right on episode 8 -- so in a few days probably. Interpreters are very fun to build, I encourage you to try it yourself!
Everyone has the idea to create own language, a compiler, an interpreter and so on. Certainly, I did it too. I am glad that someone is willing to share the idea. My way was a bit different, originally my language was written in Java and then I rewrote it in Rust.
It's a wonderful challenge, especially when you go more in depth than "just" a stack based language like we do here
@@lionkor98 Sure.
Looks promising! You should create a playlist for these videos.
Done!
These days my feed has gotten a lot better with people like him appearing.
cool stuff
You've got really appealing ASMR-like voice 🙂↔️
But the content is good too, looking forward to see how LLVM works, I hope you'll use it for codegen.
Hi, we're probably gonna write our own shitty JIT first to see how far we can go, and then switch to something serious
hes just like me fr
heard we switching to rust
we have to, its very hip and very cool!
I'd honestly rather write stuff in C++, but cargo is simply built different.
Why C++?
@@blueghost3649 I just prefer C++, to my monkey brain it just reads easier, and I'm not referring to most C++ 20 features, stuff is living, breathing, nightmare fuel. (specifically std::ranges)
I agree for the most part, C++ is quite nice and it's still what I mostly write, but rust + cargo are just too easy to not use ;)
Why would u want to miss out on traits & algebraic enums? I heavily use them to model language for compilers
@@axisaligned9799 exactly
Audio quality is wack & over edited
Hi! I didn't edit the audio at all, I just sound like that. If you mean it cutting out here and there, that's RNNoise noise suppression.
I like the audio, it’s lovely