6 ms·
Reminder the creator of Wren wrote the awesome Crafting Interpreters book [0]. [0] https://craftinginterpreters.com/ https://craftinginterpreters.com/
by plainOldText 11mo ago
Reminder the creator of Wren wrote the awesome Crafting Interpreters book [0].
[0] https://craftinginterpreters.com/ https://craftinginterpreters.com/
- l9o 11mo agoThis is awesome. Thank you for sharing. I have been working on a small interpreted language for shell scripts with lots of help from Claude Code. The main idea is to automatically generate the cli interface for the scripts based on function definitions. However, I'm far from a programming languages expert, so I've been a bit hesitant to share my work. Going to give this book a read this week to see how far I am. Thank you!
- manveru 11mo agoTake a look at how Nushell does this, it's quite neat: https://www.nushell.sh/book/custom_commands.html#documenting-your-command https://www.nushell.sh/book/custom_commands.html#documenting...
- l9o 11mo agoThat's excellent. Somewhat similar to the syntax I went with, but most likely much better implemented. I'm going to give it a go. Thank you!
- mhaberl 11mo agoand he wrote Game Programming Patterns [0] [0] https://gameprogrammingpatterns.com/ https://gameprogrammingpatterns.com/
- ronbenton 11mo agoKnowing this is the author makes me 1000% more interested in Wren. What a great book!
- thw_9a83c 11mo agoIt is an excellent book and one of the canonical texts on the subject. My only suggestion for the "Lox" language would be to include an implementation of arrays, and preferably also hash/dict arrays. Other than that, the book contains everything you need to know about implementing a programming language.
- smnplk 11mo agoI wish he would have used C for everything. You need to buyin into Java's whole OOP thing, which I am not a fan of.
- nine_k 11mo agoWren, the topic of the post, is positioned as a descendant of Smalltalk, the most OOP language of them all. The author clearly finds the OOP paradigm important.
- thw_9a83c 11mo agoI understand. I wasn't a Java person when I read that book, yet I still prefer Java over more esoteric options. If Golang is easier for you to understand (no OOP), then I can recommend this one: https://interpreterbook.com/ https://interpreterbook.com/ BTW, I'm not the author of either of those books, but I have read both of them.
- SatvikBeri 11mo agoIt's not too hard to adapt the first half of the book into whatever language you want. People have posted versions in dozens of languages: https://github.com/munificent/craftinginterpreters/wiki/Lox-implementations https://github.com/munificent/craftinginterpreters/wiki/Lox-... (There are fewer options for the second half, since you need more control over memory management.)
- Conscat 11mo agoIt's hard to say what "that hard" should be considered, but the book's first half involves Java reflection, which isn't obvious code to port to different languages in my opinion.
- alberth 11mo agoIs Bob still involved (in Wren)? I thought his focus was Dart these days given being employed by Google.
- pansa2 11mo agoYeah, my understanding is that the bytecode interpreter in the second half of the book is essentially a stripped-down version of the Wren virtual machine.