Discussion #8
Replies: 1 comment 2 replies
|
Hi @LadyBeGood Of course I am open to talk about this, though I feel it’s a very big topic so I ain’t sure if I can cover everything in a single comment. What I can suggest is to think about what features you want to include to your language, and why these features are needed. For Lox2, I want to build a modern full fledged object oriented programming language. The object model was inspired by Smalltalk and Ruby, while it borrowed many features from different languages. It is important to have a vision, otherwise your language will evolve organically like JS and PHP. You also want to think about how features fit with each other. Once you have a design philosophy and a list of features to implement, you will need to think about how to implement them. It is nice to have a roadmap, and to follow a step by step approach. Start with the simplest and the most fundamental changes you want to make, and gradually approach the harder and more challenging aspects. You may also want to study the compilers and VMs of existing languages for inspirations. With this being said, I was still a beginner of this subject when I got started, so I was also learning by doing. Fortunately, Lox2 is an experimental and educational language, so I can safely make corrections and breaking changes across versions if deemed necessary. The same may not hold true for your language, if backward compatibility is important. I was also limited by some design choices made by the original Lox language, which I would have done differently if starting from scratch. |
Uh oh!
There was an error while loading. Please reload this page.
Hello.
I recently came across Lox2 and I like the direction you took with it, turning Lox from more of a toy language into something that feels more complete and practical.
I'm currently building my own language that transpiles to JavaScript. While searching for resources on creating a transpiler, I found your project and it has been really interesting to go through your repo. Although I primarily work with JavaScript and don't have much experience with lower-level languages like C, I can still somewhat follow how you have structured your code.
Up until now, I have mostly been looking at the TypeScript compiler for inspiration. However, it has been very difficult to learn from because of its size and complexity. There are many layers and abstractions, and I often get lost trying to understand the overall flow.
I would really like to understand how you approached extending Lox into something more complete, and how I could apply similar ideas in my own transpiler. If you are open to discussing it, I would really appreciate the chance to ask a few questions, especially about the type checker, and learn from your experience.
Thanks for sharing your project.
All reactions