News for hackers. Stuff that matters.
Re:GHC Parser Principles by arturogoosnargh on Tuesday May 15, 2018 @04:30AM (#17072491)
I'm writing a Haskell compiler in C as a hobby. I didn't take a look at GHC code but now I find the way they deal with optional indentation interesting. Nonetheless I implemented the same thing in a simpler way having a function in my parser that checks for the presence or absence of curly braces and sets some state on the parser.

My implementation: https://github.com/angel-manuel/schc/blob/c1fa77b332a765b476...

Re:GHC Parser Principles by kreetx on Tuesday May 15, 2018 @07:50AM (#17073260)
Out of curiosity, do you have a mathemathics background? I.e for me the scaryest part of this is type inference and type checking.