SPEAKER 1: Probably
implementing a program.
But let's just see now what it
is we've been doing all this time
and what some of--
SPEAKER 2: So again, we're
going to sort of take
one final peek at some abstraction
here when we talk about compiling.
SPEAKER 3: Yeah, this is a
topic of always wrestled with.
As to how low level to
get and when to do it.
we've oscillated over the years as to
where this topic, if anywhere, goes.
In recent years, I've really just kind
of thrown it in the middle of the class
when there's a gap and it
never felt right there.
And this was the first year where
we've really done it this early.
Talking about pre-processing,
compiling, assembling, and linking.
And I actually think it kind of worked.
I mean, we allowed ourselves
the luxury this year
of having a variable length lectures.
So we gave ourselves
more time if we wanted it
and less time if we didn't need it.
I didn't want to scare too
much, right, because we're only
in the second week
really of the class here.
But I think it helps.
So long as we don't
dwell too much on it.
I think it helps to go all the way
down to where assembly meets, or really
where machine code meets source code,
and then just abstract on top of that.
SPEAKER 2: Yeah, we don't really
get into this sort of detail
again later in the course.
But like you said,
knowing when pound include
happens, when pound define happens,
and how exactly the CS50s library when
you do pound include.
How those bytes get
integrated into your program.
it's something that's worth talking
about early, but like you said,
we want to abstract away from that.
We don't want to make
that the take away here.
just this additional piece of
understanding about what's going on.
SPEAKER 3: And I actually feel now
in retrospect it's now or never.
Because it was always weird to do
it mid-semester and sort of blow
up the abstraction and go back down and
look at what's really been going on.
And there's just no
contextual motivation for it.
Here at least, I think
just minutes after students
have started seeing clang and make
and seeing fairly cryptic commands
or command line arguments
appear on the screen giving them
a sense of what those things are
doing so that it's not so cryptic.
SPEAKER 2: The first time
they've compiled a program
now they're actually doing it.
SPEAKER 3: Yeah.
SPEAKER 2: I would say
the one tricky thing
about explaining this is that compiling
contains a step called compiling.
SPEAKER 3: Yeah.
I know.
It's not obvious.
So hopefully having that
list of just the four steps
that most people just call
compiling all together helps.
and this is the only
time we show assembly.
And we don't really go into detail as
to the registers and the instructions
as to what's going on here.
But I think it's kind of neat to
give students a glimpse of that.
It's not zeros and ones
but it's also not C.
SPEAKER 2: That's true.
And in CS50 AP, we
actually do have a problem
where we do have students
take a look in assembly.
When I took CS50, we had a problem
set that was written in assembly.
It certainly makes you
long for the days of C.
SPEAKER 3: Yes, you
very quickly appreciate.
But that's not the goal here.
But you can start to pluck
out familiar things, right?
Like the low level print F instruction
and get the notion of returning.
Or pushing and popping
watch to come back to.
SPEAKER 2: Moving, adding, calling.
You see some things in there.
It's clearly one step lower than
the C-like syntax we're used to,
but we're not quite down
to zeros and ones yet.
SPEAKER 3: But what I like to is the
notion of linking especially, right?
Especially doing the hash include
at the top of your file really
it's just getting you access
to the header file, but not
the underlying zeros and ones into which
the library itself has been compiled.
So making this distinction between
header file and the actual library
code, the formerly dot C
file that's a dot SO or dot O
or whatever somewhere
on the file system.
Where those bits are coming
from that compose print F
I think is pretty helpful to mention.
SPEAKER 2: Yeah.
It's not the kind of thing
that needs to remain a mystery.
Because if people want to go on and do--
and use the CS50 library in an
environment that's not the CS50 IDE.
It's helpful to know
exactly how to recreate that
and where to store it
in your file system.
Again, these small little
skills that are nice to know,
but are not essential to taking CS50.
SPEAKER 3: It's the complete story.
And especially by way of things
being on video, if the student really
doesn't want to dive into this
just yet or maybe it's a little too
much too soon, skip over it, come back.
But at least it's chronologically
now, I think, in the right place.
SPEAKER 2: I agree.
