Devlog #5 - Pankti Language

Hello folks 👋 It’s been more than a month since I wrote in the English blog here.

I’ve been busy. I am working hard on rewriting the Panki Interpreter.

code code code

I am currently on the fifth iteration of rewriting from scratch.

  1. The original Tree walking interpreter written in Go.
  2. The bytecode compiler and vm written in Go.
  3. 1 (👆) written in Rust.
  4. Rewrite from Scratch with guidance from Crafting Interpreters (lox)
  5. Rewrite major parts of 3 (👆) from almost scratch because I made some huge blunders ðŸĶ§ which I am embarrassed to mention here.
  6. (Currently) Rewriting from Scratch in C.

I must say Rust ones were the most difficult to implement and kinda the slowest ones.

I started rewriting in Rust because I thought it would make improving and maintaining the codebases easy and error-free, well I was right but the cost of the decision was that the code base code was huge and ludicrously slow. I don’t think it’s fair to put all the blame for slowness on Rust itself, but it certainly is sometimes to blame.

ðŸĶ€

Look, I like rust. It’s great but I don’t think you can write a really fast interpreter without playing with unsafe rust.

Then Why Did I choose C? The first argument I would like to present is that C is simple and easy ðŸĪŊ. Second, it’s freakishly fast. Third, I like playing with pointers.

I know I will introduce many bugs and maybe some memory leaks here and there but it will be a really good learning opportunity for me to use C in a real-world program.

Plus, C can be called from other languages such as Go, and Rust which will make it easy for me to write some portable GUI editor for the interpreter.

Before starting with C, I was afraid it would be really difficult to handle Bengali unicode characters but apparently, it’s not that hard nowadays thanks to wchar and suckless’s libgrapheme is also handy if I need it later

✏ïļ Last edited: Thu, March 9, 2023 | 📎 permalink
Have any comments regarding this post ðŸĪ”? Please let me know via Email (mentioned below), Tweet/DM or Toot @bauripalash 😚!

Liked this article or any other work of mine? Please consider Buying me a Cup of Coffee

Read more