Live data from Hacker News

Write You a Haskell: Building a modern functional compiler from first principles

dev.stephendiehl.com

41–48 of 48 posts

Re: Write You a Haskell: Building a modern functional compiler from first principles

#41
post #9

This looks really interesting! But I can't see any way to subscribe to book updates. A mailing list (my preferred means of subscribing to this kind of stuff these days) or an rss feed to get notified when new chapters are ready would be really handy.

You could `watch` the repository on Github to get notified when there is update

Re: Write You a Haskell: Building a modern functional compiler from first principles

#42

Earlier quoted context omitted.

If this guy isn't getting headhunted, I have no idea what headhunting is. It's pretty rare for people to be able to write correct and easy-to-read guides to such low level concepts.

Finding a job is easy, finding the right job is hard for people like this.

Part and parcel of "There are not enough programmers [willing to work long hours for low pay]!"

Re: Write You a Haskell: Building a modern functional compiler from first principles

#43

Earlier quoted context omitted.

Finding a job is easy, finding the right job is hard for people like this.

Part and parcel of "There are not enough programmers [willing to work long hours for low pay]!"

For that talent, it might even be that the work is too boring regardless of the hours or pay.

Re: Write You a Haskell: Building a modern functional compiler from first principles

#44

Earlier quoted context omitted.

Part and parcel of "There are not enough programmers [willing to work long hours for low pay]!"

For that talent, it might even be that the work is too boring regardless of the hours or pay.

Very true. I'm running into that right now: humdrum legacy CRUD apps, where the only challenge lies in being allowed* to refactor the code into decent shape.

*I wish I could put that in sarcastic quotes.

Re: Write You a Haskell: Building a modern functional compiler from first principles

#45

Earlier quoted context omitted.

Your comment implies that programmers stop learning once they are slightly advanced.

No, it doesn't imply that, at all. My least favorite thing on the Internet nowadays are shallow fault-finding comments like yours from people who just want to interject themselves into discussions where they have nothing substantive to say. I used to be that guy and still have to actively resist the temptation. Don't be that guy.

Oh, man — not being that guy, at least in the fault-finding sense; just apparently failing to make an obvious joke. Very strictly, grammatically speaking, it does say that, and it was a humorous implication to me, since I have known so many programmers who apparently did stop learning once they were very slightly advanced. But I'm completely aware that the implication was accidental.

Re: Write You a Haskell: Building a modern functional compiler from first principles

#46

Earlier quoted context omitted.

No, it doesn't imply that, at all. My least favorite thing on the Internet nowadays are shallow fault-finding comments like yours from people who just want to interject themselves into discussions where they have nothing substantive to say. I used to be that guy and still have to actively resist the temptation. Don't be that guy.

Oh, man — not being that guy, at least in the fault-finding sense; just apparently failing to make an obvious joke. Very strictly, grammatically speaking, it does say that, and it was a humorous implication to me, since I have known so many programmers who apparently did stop learning once they were very slightly advanced. But I'm completely aware that the implication was accidental.

No, it actually doesn't even say that; in no way does it preclude the existence of a third group. Not only are you unfunny, you fail logic.

Re: Write You a Haskell: Building a modern functional compiler from first principles

#47
post #30

Very interested in seeing how he'll deal with lexing Haskell. It's a major pain, tools like Parsec are very good out of the box with whitespace insensitivity, but not whitespace sensitive stuff.

Its not that hard to implement some form of whitespace sensitive parsing, you need to maintain explicit state, essentially a stack and a number of combinators. See for example https://github.com/purescript/purescript/blob/master/src/Lan... The state is defined in https://github.com/purescript/purescript/blob/master/src/Lan... (its just the column number). I believe the whitespace rules for Haskell are somewhat subtle…

I tried to change the whitespace rules in the PureScript parser to match Haskell recently (to support explicit braces), and it proved to be very difficult. The "L" function which is defined in the Haskell 98 Report depends heavily on an interaction between the lexer and parser, in which a failed parse causes the indenter to behave differently in the lexer. For this reason, I stayed with the simpler rules that we have now, and I plan to support explicit braces in the parser instead.

Re: Write You a Haskell: Building a modern functional compiler from first principles

#48
post #32

Earlier quoted context omitted.

I suppose using haskell-src-exts is cheating...

"I will build haskell by taking the source code and running it" I jest, but this is an issue I've thought about idly for a while. Maybe it's possible to write a two-step parser: one that turns chars into tokens (and cheat a little bit by stripping spaces in some contexts to make it context free), and then you have a nice CFG that you can do easily.

I once took a compiler design course where the instructor said we could use whatever language we wanted (it was a tiny class - I think there were 8 of us?).

I asked whether I could use bash, and consider gcc a feature of the language.

I was informed that would be cheating.

Post reply on HN