139 points · by rspivak · 10y ago · 62 comments
It is an amazing archive of all kinds of neat algorithms and data structures.
The course was video-recorded and I downloaded and saved most of the lectures (and I gave Keith a DVD with a copy of them.) I still have them, but I don't know if it's okay to put them on YouTube or not.
This midterm exam is open-book, open-note, open-computer, but closed-network. This means that if you want to have your laptop with you when you take the exam, that's perfectly fine, but you must not use a network connection. You should only use your computer to look at notes you've downloaded from online in advance. If you are an SCPD student, you should take this exam in any two-hour period between 11:00 AM Pacific time, July 20 and 11:00 AM Pacific time, July 21 . If you have any questions, please feel free to call me at _ any time in this window except between midnight and 8AM on July 21, Pacific time. You may submit the exam either by faxing it to _ or by scanning and emailing it
I'm not familiar with how these things work in the US - are the students trusted to take the exam away and not use the internet to get help?
"The faculty on its part manifests its confidence in the honor of its students by refraining from proctoring examinations and from taking unusual and unreasonable precautions to prevent the forms of dishonesty mentioned above."
https://communitystandards.stanford.edu/student-conduct-proc...
A professor or grad student walks into the room every 30 minutes or so just to make sure everything looks okay. They otherwise sit outside the exam hall so you can ask them questions, ask to go the bathroom, etc. But it's up to the students to police each other and ultimately themselves.
There are definitely other universities in the US that have this policy, but I would say it's more the exception than the norm.
The exception to this was programming exams for which the department would boot all the lab workstations into a locked-down mode with no internet & new homedir containing only the exam files. At the end of the exam everything got collected and marked by an automated test suite.
They went to quite some effort to ensure that no cheating could take place - http://pubs.doc.ic.ac.uk/Lexis/Lexis.pdf
https://github.com/melling/ComputerLanguages/blob/master/com...
I'll add more as they are posted.
I was lucky enough to buy a used copy on amazon for $8.
http://www.amazon.com/Compiler-Construction-Principles-Kenne...
http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf
It is a very instructive process.
I'm terribly sorry to break the news for you, but no, compilers are not about parsing. Nowhere near that.
There is a followup course, CS243 which focuses on the optimization aspect.
There is another dimension to this. While code gen and optimisations are more interesting than lexing/parsing almost no student will ever again write a code generator, let alone optimisations. OTOH, most programmers need to write little lexers and little parsers for little languages all the time. That's why a bit of facility with lexing/parsing and associated tools is hightly useful.
compilers are easy
No.Modern, industrial-strength compilers are some of the most complicated pieces of technology we have.
Indeed almost every part of the compiler pipeline, in particular parsing, type-inference, and optimisations, are active areas of research.
How come that they are still teaching only yacc/lex as parsing generators in 2016?!
Niklaus Wirth would probably agree.
I actually think many useful languages are mostly syntax. If you compile to another source language (like C or SQL) you might not need much optimization.
Parsing some syntaxes is difficult but that doesn't imply we should just ignore it and let libraries handle everything. Thinking about parsing is an opportunity to learn about tradeoffs and to develop a good taste designing syntaxes which are easy to parse (and, possibly correlated, manipulate) both for computers and humans.
Parsing in most cases should either be trivial, or can be skipped altogether.
It's absolutely not uncommon for architecture experts to plug into the optimization stage of an existing compiler; expecting them to understand the first stages is not useful at all. They need to understand the AST / IR, but not how to arrive at it.
(Also, real parsers tend to be hand-written, judging from open source language implementations (some have actually migrated from generated parsers to recursive descent in the past). There must be a reason).
And backend is not just about optimisations, they're mostly insig igicant. Backend is about translating gradually one semantics to the other. An example of such is compiling a regular expression into a DFA and then a C array and a switch.