Hacker News new | ask | show | jobs
by st0012 3336 days ago
Haha, I did read that book before start this project, it's a very useful material. But for now the project are far more complicated than the sample project in that book, only lexer and parser remain similar.

BTW I also took "nand2tetris II" on coursera and read "Ruby under a microscope" for this project.

1 comments

I think that you should be a bit more transparent about how much of Thorston's ideas and code you are using in this project. You should probably give him some attribution.

I also read that book, and have a toy language I've been building, basically extending his ideas. I've looked through your code and much of is it nearly verbatim from the book (including code in your 'vm', or the monkey 'eval' package - it's not just the lexer/parser), though you (as I have), chose different names, or organized things differently, and added new features.

Yes, you've extended his ideas much farther, but the core of 'rooby' is pretty much the same as Thorston's language, 'monkey'.

Monkey is available with the MIT license, so it's fine what you've done. But, having been through the book and pretty familiar with the Monkey code (available for download here: https://interpreterbook.com/waiig_code_1.3.zip), I think it's disingenuous to say 'I read that book before this project..', which seems to imply that it was inspiration, rather than original source material.

On a positive note, it's a pretty cool version of Monkey.

The 'code' you read is similar, but the way they work are totally different.

Monkey is fundamentally a functional language, but rooby is totally an object oriented language. And the compiler, vm's internal implementation and bytecode spec, which are the 'core' of rooby, is not like monkey at all.

I would say I extended monkey's lexer and parser as rooby's. I feel sorry if I didn't give enough credit to Thorston, I would add reference to his book in readme. But the core is more a Ruby than monkey, so I don't think it's just an "extension" of monkey.

Please read the commits and you'll know how much work I did to make rooby, it's far more complicated than just "extend" monkey.

BTW here's the monkey source code I wrote when I practiced with the book https://github.com/st0012/monkey