Live data from Hacker News

Show HN: Crafting Interpreters – A handbook for making programming languages

craftinginterpreters.com

51–60 of 77 posts

Re: Show HN: Crafting Interpreters – A handbook for making programming languages

#52
post #28
post #21

Earlier quoted context omitted.

There's nothing more "advanced" about statically typed languages. Static typing and type inference are straightforward and can make implementation details simpler than dynamic languages (because you're greatly reducing or removing the unknowns you have to deal with at runtime). This is assuming you're making a batch-style compiler, as most implementors do, and not an interactive system. If you're focused on benchmark…

I meant "advanced static-typing" (e.g, like System F, which is advanced to someone learning PL). Not that it was more advanced, although I think in fact it is from a learner's point of view. It's incredibly simple to throw together a Scheme, or even a more complex interpreted dynamic language. Add in a static typing, type inferencing, and type checking, and that all becomes much more complicated, at least from this l…

   dearth of learning materials for things 
   like Hindley-Milner 
What's wrong with the original paper [1]? It's really basic and boiled down to the essence (in true Milner style). I give it to all my students interested in typing systems as first paper. (There is a typo on Page 211.)

[1] L. Damas, R. Milner, Principal type-schemes for functional programs.

Re: Show HN: Crafting Interpreters – A handbook for making programming languages

#53

Really looking forward to this! A much less involved language-building tutorial that's available now is Beautiful Racket.[0] Racket is a Scheme, but it's also specially outfitted to be a language workbench.

And 16 hours later: [0] http://beautifulracket.com

Re: Show HN: Crafting Interpreters – A handbook for making programming languages

#56

That's so cool! Learning to make a programming language is in my life's todo list, just as doing my own (super simple) operating system. Thank's for contributing with a free book, I very much appreciate it. Does anybody know of something similar but for operating systems?

Not quite but this is a good read. https://littleosbook.github.io/

Re: Show HN: Crafting Interpreters – A handbook for making programming languages

#57

That's so cool! Learning to make a programming language is in my life's todo list, just as doing my own (super simple) operating system. Thank's for contributing with a free book, I very much appreciate it. Does anybody know of something similar but for operating systems?

I found https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures... from a UK university. I like the style of it and the emphasis on getting started coding straight away.

Re: Show HN: Crafting Interpreters – A handbook for making programming languages

#58

Seems to be a hot topic, a friend and colleague published this in December 2016 and I can thoroughly recommend it (Uses Go as an implementation language): - https://interpreterbook.com

Yeah, I've talked to Thorsten over a email a little. I'm excited about his book too, and I hope it does really well. Go is a cool choice for a language book. It's low-level enough to let you show some of the fundamental algorithms, but not as tedious to work with as C and its manual memory management.

Re: Show HN: Crafting Interpreters – A handbook for making programming languages

#59

Looking forward to the chapters about the C interpreter. Meanwhile, it looks like both interpreters are available to study now in the Git repo. [1] [1]: https://github.com/munificent/craftinginterpreters

Nice project. What do all the //> SomeName not-yet in the code mean? Are they meant for some kind of automatic processing? Its a bit hard to read with all of them there...

Sorry, yeah. Those are the markers that the build script uses to insert the code snippets in the right place in each chapter.

I know it makes the code hard to read. I should probably slap together a little script to strip them out.

Re: Show HN: Crafting Interpreters – A handbook for making programming languages

#60
post #39

Earlier quoted context omitted.

> See also Lua's upvalues for a way to optimize closure variable access Yes! In fact, that's how the C version of the interpreter in my book implements closures. It's pretty brilliant. <3 those Lua folks.

Will you cover anything about LuaJIT's "NaN-coding"? Or perhaps do you have a link about how it works?

Yes, we'll do NaN-tagged values in the last chapter on optimization.
Post reply on HN