@TheUberphil My linear algebra teacher used to come into the room and ask "So how are you fuckers doing today?" College is a great place sometimes. :)
One thing I've always wanted to learn is how to write a compiler. It was one regret that I have for not learning it in school. (I was a lazy student). Now that I'm working, I never have time.
@all028 Last semester I took a compiler class in my universaty. The assignment was to build a bc-alike calculator. But I asked the professor to write something more challenging, then I wrote a LLVM based C-alike compiler, that I am currentlly planning to extend it to include untyped lambda expressions.
It is not that hard, just grab FLEX and Bison, and in a week or so you might end up with something you might call a compiler
I got this (i did it before i saw his optimization, but of course i took longer than 4 minutes)
int i,x,y,u;
x=0;
y=0;
u = (4*a/b) +2
for (i=0; i <= N; i++)
{ x = x + i*i + i*u + 1; }
return x; After seeing his optimization, I realized I shouldn't rely on algebra to do things like this. The compiler would be really complicated if it started doing all sorts of algebra.
OCW is one great initiative. Thanks, MIT.
zecadojuneca 1 month ago
But of course, a robust compiler won't have that kind of intuition
blackcompe 8 months ago
You can further optimize his code by using Faulhaber's formula (sum of pyramidal squares) to replace t*t in the loop.
blackcompe 8 months ago
Instructor is Saman Amarasinghe
/people.csail.mit.edu/saman/
thevishy 9 months ago
0:20 - "this last shit i give at the end of class"
17:28 - "so, what da hell we do?"
i think this guy is just trying to sneak words in.
TheUberphil 11 months ago 2
@TheUberphil
this last sheet.........
vamsi108 8 months ago
@TheUberphil My linear algebra teacher used to come into the room and ask "So how are you fuckers doing today?" College is a great place sometimes. :)
nychold 4 months ago
I cant even understand what hes saying!
corpmedia 1 year ago
What what was at 9:32 ???
alexanderssson 1 year ago
One thing I've always wanted to learn is how to write a compiler. It was one regret that I have for not learning it in school. (I was a lazy student). Now that I'm working, I never have time.
Thank you for posting this...
all028 2 years ago 13
@all028 read the "dragon book" and use the net to help you
vaf88 1 year ago
@vaf88 expensive; dry but worth it (Y)
MarijnStevens 6 months ago in playlist MIT 6.035 Computer Language Engineering, Fall 2005
@all028 This is my exact problem! If I could of gone back in time I would of done computer science or electrical engineering!
tradingpilot 1 year ago
@tradingpilot - What did you take instead? I found computer science to be hard at the time but now, in retrospect, I actually like programming!
all028 1 year ago
@all028 Last semester I took a compiler class in my universaty. The assignment was to build a bc-alike calculator. But I asked the professor to write something more challenging, then I wrote a LLVM based C-alike compiler, that I am currentlly planning to extend it to include untyped lambda expressions.
It is not that hard, just grab FLEX and Bison, and in a week or so you might end up with something you might call a compiler
marlls1989 3 months ago
can any body tell what TA means?
nmania03 2 years ago
teaching assistant
VelikiBedak 2 years ago 5
Teacher Assistant.
Gearhe1d 2 years ago
@nmania03 teaching assistant
zndr27 1 year ago
Did anyone else do the optimization challenge?
I got this (i did it before i saw his optimization, but of course i took longer than 4 minutes)
int i,x,y,u;
x=0;
y=0;
u = (4*a/b) +2
for (i=0; i <= N; i++)
{ x = x + i*i + i*u + 1; }
return x; After seeing his optimization, I realized I shouldn't rely on algebra to do things like this. The compiler would be really complicated if it started doing all sorts of algebra.
ludwigious 2 years ago
Ignore first 17 minutes.
darijo203 2 years ago 33
Thank, you saved me 17 min. I owe you.:-)
VelikiBedak 2 years ago
"removed due to copyright concerns"
What does that mean !!!!!!!!!!!!!
bluekads 3 years ago
Probably some image or diagram that was being displayed in the slideshow
ANet64 3 years ago
It's a bit obvious isn't it? You would think someone interested in something like this would have half a brain.
chaz2290 3 years ago 3
LOL== removec due to copyright concerns==
yikyikyik 3 years ago 2