A Tour Of The Compiler

compiler

#1

Back in the days before this forum existed, I wanted to start going through the compiler, asking questions, and gaining a better understanding of the codebase. I was only able to get through a few discussions before other things got in my way, and since the format of the mailing list was not conducive to that kind of long-term work, I didn’t come back to it.

I’d like to try it again, aided by the fact that we now have this forum as a tool. My suggestion is to make our way through the compiler files as a sort of ‘reading group’, where different people can ask questions. I’d like to make my way from the front-end, focusing on the typechecker along the way, and if we ever get past that huge beast, over to the backend. The backend in general is much easier to read, so this process isn’t as necessary there.

The caveat is that I have limited time for this, so I don’t know how often I’ll get back to this thread. I’m perfectly happy if other people keep going without me though.

Ultimately I hope this will be a useful body of work to anyone wishing to learn about the compiler.

Let me know if you’re interested, and note that this is within the realm of the purely experimental. If the process breaks down due to unanticipated issues, that’s ok and should be understandable.


#2

I’ll may try to follow along.


#3

I am also interested, but have limited time at the moment. This link posted in another thread seems like a good starting point: HACKING.adoc


#4

About the typechecker, you may be interested by Oleg Kiselyov’s presentation: How OCaml type checker works – or what polymorphism and garbage collection have in common.


#5

Incidentally, this link is given at the start of typing/HACKING.adoc. If people in the thread have further advice that is not already in the HACKING file, I hope they will submit Pull Requests to improve them.