All right, so you've had some
time to stare at this slide.
Who can tell me where it's from?
Anyone recognize it?
Well it's taken from a Bjarne keynote.
So he said he wants to do just that.
Anyway, it's download
some graphics 2d package,
install it, and then
right, importing his code.
So we have four minutes 30 seconds left,
let's see if we can do that.
He skipped a couple of steps.
The first one is where you
actually find the package.
So it would be nice to have
some kind of repository.
Perhaps where you can
search for some things.
Well, we're not gonna do graphics.
Today we only have four minutes left.
We'll do a hello example.
So we're looking for a
modularized hello library.
All right, let's search for it.
Hey look, someone actually wrote one.
And if you scroll down,
there are two versions.
One is in testing, the
other one is in stable.
Well, we are kind of conservative,
so let's go with stable.
There is a bunch of more information.
One interesting, or one important part
is where this package lives.
Right there, a URL for the repository.
Okay, let's keep it in our keyboard.
The other part that Bjarne skipped over
is we actually need a place
for our packages to live
where we store our
configuration for example,
which compiler we use,
which options we use.
So let's create that.
And this looks a little bit cryptic so
we'll call it a clang,
directory we'll call clang,
it's configured to build C++,
and we'll use clang as a compiler.
All right, so create our directory.
So the next thing we do, we are gonna add
that repository where our
modularized hello library lives.
Next, we fetch the list
of packages available
in this repository.
So there is some authentication.
Looks good.
So we've got five packages
and we're gonna
build it.
Okay, so it depends on another library
which looks like a
standard library modules.
Well building standard library modules
takes a little bit of time.
They are quite chunky.
But once that is done
then we should be okay.
All right, so if we look,
oh, there is our library.
Let's now go to our editor
and write a little program.
As you can see, I type very fast.
So, here is the import declarations.
We also import that
std.core for good measure.
So write a simple build file.
Pretty straightforward.
Import the two libraries we just installed
and then we have a simple
little build us an executable
from the hello source file
and link those libraries.
All right, so now we're gonna build this,
this little program in this configuration.
Hopefully magically everything will work.
So this is where our source lives.
So we are building it
in this configuration,
it's building in the hello subdirectory.
Okay.
And there is our executable.
And it even works.
All right, we have one minute left.
So let's try to do the same thing
but with the Visual Studio compiler.
Do you think we can do that?
So I have this, what looks
like a Visual Studio compiler.
So I'm just gonna repeat all those steps.
Go back to tmp.
So for clang, so we
call the directory msvc.
Adding the repository.
Fetching the package.
Building the library.
And building application.
Okay.
Hey look, there's an executable.
We can even run it.
All right, eight seconds to spare.
Thank you very much.
(audience applauding)
