News for hackers. Stuff that matters.
Re:Crafting Interpreters: Calls and Functions by munificent on Thursday July 25, 2019 @04:32PM (#20529361)
> do modern compilers actually still pay attention to the "register" keyword?

You know, I'm honestly not sure. If nothing else, it sends a signal to human readers of the code.

> if I'm not mistaken you limit the number of parameters to 8, yet the number of arguments passed to 255.

You are not mistaken. I changed the limit, but missed that part. Filed an issue to fix this:

https://github.com/munificent/craftinginterpreters/issues/46...

Thank you!

Re:Crafting Interpreters: Calls and Functions by smueller1234 on Thursday July 25, 2019 @06:07PM (#20530271)
Quick search, first hit: https://stackoverflow.com/questions/10675072/is-the-register...

I know, hardly authoritative. But it matches precisely what I remember from when I was hacking on perl with an eye to performance at the time.

Maybe drop that bit regarding 'register'? The rest of that section is still perfectly valid. That is, assuming the compiler doesn't actually perform the local variable/keep in register optimisation itself, but I think it can't do that at least in the general case. I only remember vague things about this. At least aliasing may defeat the compiler optimisation.

Caveat: Like yourself, I picked this stuff up without studying it as part of a degree. Anybody with a proper compiler background want to jump in and enlighten maybe?