WEBVTT

00:00:01.150 --> 00:00:03.440 align:middle
In this video, I'd like to
explain a little bit

00:00:03.607 --> 00:00:06.480 align:middle
Pharo's different packaging
ways, in order for 

00:00:06.647 --> 00:00:08.640 align:middle
not to get lost in the future.

00:00:09.000 --> 00:00:11.400 align:middle
When you install Pharo, you will
normally click on a link

00:00:11.950 --> 00:00:14.370 align:middle
given, but if you go on 
Pharo,

00:00:14.537 --> 00:00:17.280 align:middle
the release at the moment 
of this video

00:00:17.447 --> 00:00:21.060 align:middle
is version 4, but version 5 will
be exactly the same.

00:00:21.410 --> 00:00:24.370 align:middle
When I downloaded Mac OSX version,
I get this zip.

00:00:24.750 --> 00:00:29.090 align:middle
If I unzip this zip,
I get what I call Pharo4 app.

00:00:29.480 --> 00:00:32.460 align:middle
When I launch
Pharo 4 app, I get Pharo.

00:00:32.627 --> 00:00:36.410 align:middle
Let's imagine we write

00:00:42.690 --> 00:00:47.380 align:middle
"Hello". When I save, 
it will save the environment.

00:00:48.730 --> 00:00:50.430 align:middle
I click on Save.

00:00:51.490 --> 00:00:55.920 align:middle
If I click on Quit now,
I will launch it again,

00:00:56.360 --> 00:01:00.100 align:middle
and I will have exactly
"Hello", because saving the Pharo

00:01:00.267 --> 00:01:03.810 align:middle
image is making a memory copy
with all the

00:01:04.000 --> 00:01:07.780 align:middle
objects included Bytecode objects
and compiled methods.

00:01:07.947 --> 00:01:11.920 align:middle
What is there in 

00:01:13.340 --> 00:01:14.400 align:middle
this application?

00:01:14.567 --> 00:01:16.750 align:middle
On Mac, we can what is inside.

00:01:16.930 --> 00:01:20.620 align:middle
If I click on Show Contents,
what will I see?

00:01:20.930 --> 00:01:24.380 align:middle
I'm going ti find a Pharo virtual
machine and ressources.

00:01:24.810 --> 00:01:27.530 align:middle
And here, I will find a changes
file and an

00:01:31.280 --> 00:01:31.913 align:middle
image file.

00:01:32.400 --> 00:01:35.880 align:middle
The image file is the one that
really contains

00:01:36.047 --> 00:01:39.840 align:middle
the objects representing the memory,
and the changes file

00:01:40.070 --> 00:01:42.760 align:middle
is a file comprising all the 
incremental changes

00:01:42.927 --> 00:01:46.680 align:middle
done.
If I double-click

00:01:48.580 --> 00:01:49.800 align:middle
on the image file,

00:01:55.800 --> 00:02:00.000 align:middle
normally, depending on the
OS, I will launch it on

00:02:00.470 --> 00:02:03.960 align:middle
a Pharo virtual machine that
I have installed, it

00:02:04.127 --> 00:02:05.900 align:middle
will launch again my image file.

00:02:07.020 --> 00:02:08.450 align:middle
This image file,
what happens with it?

00:02:08.617 --> 00:02:10.000 align:middle
Let's imagine I define a classe.

00:02:10.157 --> 00:02:12.050 align:middle
I'm going to define a package,

00:02:18.100 --> 00:02:18.733 align:middle
"Add package" "ATest".

00:02:18.900 --> 00:02:20.060 align:middle
In this package,

00:02:23.470 --> 00:02:24.300 align:middle
I'm going to define 
"MyStrangeClass".

00:02:28.600 --> 00:02:33.170 align:middle
I define it and here, I put
"foooo" which returns

00:02:33.430 --> 00:02:34.063 align:middle
42.

00:02:38.650 --> 00:02:42.750 align:middle
If I save this image with
another name, I'm going

00:02:42.917 --> 00:02:44.270 align:middle
to save it with the name

00:02:44.437 --> 00:02:45.070 align:middle
Pharo40Stef.

00:02:52.060 --> 00:02:53.930 align:middle
What did it do?

00:02:54.097 --> 00:02:58.580 align:middle
I quit. It created another
pair

00:02:58.747 --> 00:03:01.570 align:middle
image and change. In this changes
file, we won't open it

00:03:01.737 --> 00:03:04.620 align:middle
because it is not readable
by a human, there is

00:03:04.787 --> 00:03:07.110 align:middle
the methods code I have just
created.

00:03:07.277 --> 00:03:11.840 align:middle
And if I launch again Pharo 4,
I'm gonna 

00:03:12.007 --> 00:03:16.300 align:middle
launch it using the virtual 
machine, I get

00:03:17.940 --> 00:03:22.110 align:middle
once more the snapshot, what
we call the system

00:03:22.277 --> 00:03:27.200 align:middle
copy that I had done at a certain
moment

00:03:27.440 --> 00:03:28.073 align:middle
before.

00:03:28.240 --> 00:03:32.790 align:middle
Now, if I execute again
PharoStef image, what will it

00:03:32.957 --> 00:03:33.590 align:middle
do?

00:03:33.757 --> 00:03:37.180 align:middle
It will show me the system
with my new class.

00:03:39.740 --> 00:03:42.920 align:middle
The Pharo 4 application,
it is what we call a Mac

00:03:43.087 --> 00:03:47.460 align:middle
bundle which contains the Pharo
VM plus an image plus a change.

00:03:47.627 --> 00:03:50.500 align:middle
If I double-click on it, 
I don't have any choice, it 

00:03:50.667 --> 00:03:52.950 align:middle
will always choose Pharo image
because it is a script 

00:03:53.330 --> 00:03:55.660 align:middle
that has coded:
"Here it is, this is THAT image."

00:03:55.827 --> 00:03:59.430 align:middle
In general, it is useful at 
the beginning of the use of

00:03:59.597 --> 00:04:02.600 align:middle
Pharo, but we do not use it.

00:04:02.767 --> 00:04:05.840 align:middle
In general, either we use an
instruction of the command

00:04:06.007 --> 00:04:09.200 align:middle
line which is something like

00:04:10.290 --> 00:04:14.470 align:middle
Pharo-ui with 
MyPharoImage.image

00:04:14.637 --> 00:04:19.250 align:middle
and this will

00:04:19.417 --> 00:04:21.710 align:middle
send the thing. Or if we use 
command line and we

00:04:21.877 --> 00:04:24.010 align:middle
don't want to have the ui, we
will do that kind of things.

00:04:24.520 --> 00:04:26.450 align:middle
It means that Pharo is installed
somewhere in

00:04:26.617 --> 00:04:30.130 align:middle
your system as a standard Unix
application.

00:04:31.070 --> 00:04:34.400 align:middle
Now, you see on this page

00:04:36.150 --> 00:04:38.930 align:middle
that you can download a 
Pharo

00:04:39.097 --> 00:04:40.940 align:middle
pair, you can
download a virtual machine.

00:04:41.110 --> 00:04:43.560 align:middle
We are gonna download the
virtual machine and

00:04:43.727 --> 00:04:48.220 align:middle
download an image pair
and also source.

00:04:48.690 --> 00:04:50.830 align:middle
I'm gonna explain what it is,
this way we will have the

00:04:51.000 --> 00:04:54.460 align:middle
3 at hand, we will play together.

00:05:02.630 --> 00:05:05.760 align:middle
Now if I unzip the file 
corresponding to

00:05:06.570 --> 00:05:09.240 align:middle
Pharo Image and
Changes, I get this one.

00:05:09.710 --> 00:05:12.260 align:middle
When I unzip, what do I get in 
Pharo in this file?

00:05:12.427 --> 00:05:13.680 align:middle
I get an image.

00:05:13.870 --> 00:05:15.950 align:middle
We will do it in a mode where
you can

00:05:19.140 --> 00:05:20.070 align:middle
see what is inside.

00:05:21.290 --> 00:05:24.010 align:middle
It means that this file, 
it is again an image pair

00:05:24.177 --> 00:05:27.660 align:middle
corresponding to a certain 
state of the snapshot or of the

00:05:27.827 --> 00:05:32.630 align:middle
Pharo image, of the virtualised
system. Here, I can execute it

00:05:32.797 --> 00:05:36.280 align:middle
on the Pharo image.

00:05:38.140 --> 00:05:42.120 align:middle
I get a message, 
what is this message?

00:05:44.700 --> 00:05:49.270 align:middle
The system can work since
I can execute anything.

00:05:49.890 --> 00:05:50.770 align:middle
I can run it.

00:05:50.937 --> 00:05:53.330 align:middle
Now, I can do exactly what I 
did before.

00:05:53.497 --> 00:05:58.360 align:middle
I can define MyPackage,
and in MyPackage

00:05:58.770 --> 00:05:59.900 align:middle
I will say MyStrangeClass.

00:06:00.740 --> 00:06:02.220 align:middle
So we start to be used to it.

00:06:04.180 --> 00:06:07.580 align:middle
I define a method:

00:06:09.010 --> 00:06:12.520 align:middle
fooo 42. It asks for my
login.

00:06:14.460 --> 00:06:17.510 align:middle
I can do as usual
"MyStrangeClass

00:06:19.370 --> 00:06:23.050 align:middle
new fooo" and I get 42.

00:06:23.420 --> 00:06:24.600 align:middle
So, very good. I can save.

00:06:25.620 --> 00:06:27.360 align:middle
I save it for example with 
another name, 

00:06:27.527 --> 00:06:32.240 align:middle
Stef, I name it
PharoStrange.

00:06:32.407 --> 00:06:33.040 align:middle
OK.

00:06:39.410 --> 00:06:40.200 align:middle
What does it say?

00:06:40.367 --> 00:06:44.530 align:middle
It says “I can’t find the source
file 

00:06:45.310 --> 00:06:49.200 align:middle
Pharo 4. 0." Why does it say this?

00:06:50.240 --> 00:06:53.730 align:middle
When I open the briwser, if I can
see for instance the 

00:06:53.897 --> 00:06:58.670 align:middle
AST code, this is not your code,
so we go at the top.

00:06:58.837 --> 00:07:03.000 align:middle
The reason why the system

00:07:03.167 --> 00:07:04.000 align:middle
doesn’t find the comments

00:07:08.120 --> 00:07:09.180 align:middle
is that it is decompiling.

00:07:09.750 --> 00:07:11.730 align:middle
So, we don’t see it because the methods
are

00:07:11.897 --> 00:07:13.420 align:middle
too simple, but it decompiles
the code.

00:07:13.587 --> 00:07:15.000 align:middle
Let’s go on something more
concrete.

00:07:15.147 --> 00:07:19.820 align:middle
Here it decompiled the code,
the Bytecode represents an

00:07:20.000 --> 00:07:21.620 align:middle
an argument and it knows very well
that this is an argument.

00:07:22.040 --> 00:07:23.440 align:middle
But we lost the source.

00:07:24.050 --> 00:07:28.870 align:middle
In general, the sytem source,
when Pharo

00:07:29.037 --> 00:07:33.530 align:middle
is implemented, is stored in 
a file called Pharo 4 source

00:07:33.697 --> 00:07:36.290 align:middle
that you can find here.

00:07:36.457 --> 00:07:38.920 align:middle
In genral Pharo 4

00:07:39.087 --> 00:07:41.420 align:middle
source will be installed once
on the system because

00:07:41.587 --> 00:07:44.040 align:middle
this file is on read only, 
and all your

00:07:44.860 --> 00:07:46.030 align:middle
applications can use it.

00:07:46.210 --> 00:07:47.180 align:middle
I have it here, I’m gonna unzipp it.

00:07:47.347 --> 00:07:50.670 align:middle
Here I have Pharo4.source.

00:07:51.270 --> 00:07:52.840 align:middle
If I quit without saving

00:07:56.690 --> 00:07:59.060 align:middle
and I relaunch the application,
here anyway you see

00:07:59.227 --> 00:08:02.280 align:middle
that it does exactly the same as
previously, it is to say

00:08:02.470 --> 00:08:05.190 align:middle
that when I save a snapshot 
giving it 

00:08:05.357 --> 00:08:10.160 align:middle
another name, I have once more
a system with 2 things:

00:08:10.420 --> 00:08:11.620 align:middle
the image and its changes.

00:08:12.520 --> 00:08:16.650 align:middle
Here if I take my old image,
there

00:08:17.670 --> 00:08:20.780 align:middle
is no more error because 
it has found the code and it

00:08:20.947 --> 00:08:24.710 align:middle
knows that it corresponds to 
the state there was

00:08:24.880 --> 00:08:27.130 align:middle
when we launched the first image.

00:08:27.297 --> 00:08:28.640 align:middle
Now if I use the second one,

00:08:34.500 --> 00:08:38.960 align:middle
if I consider the file
AST-Core, first

00:08:39.127 --> 00:08:41.830 align:middle
my classes have comments.

00:08:47.100 --> 00:08:51.000 align:middle
Here these are really the names
people gave. 

00:08:51.830 --> 00:08:53.870 align:middle
If we look at this architecture,
what do we have?

00:08:54.950 --> 00:08:57.230 align:middle
We have the source file
containing the system sources,

00:08:57.397 --> 00:09:02.000 align:middle
in general, once the system is
compiled, the compiler 

00:09:02.167 --> 00:09:04.610 align:middle
doesn’t need the sources,

00:09:04.777 --> 00:09:08.330 align:middle
the virtual machine and 
image and change pairs.

00:09:09.390 --> 00:09:12.180 align:middle
Image contains all the objects
that have been defined plus

00:09:12.347 --> 00:09:14.790 align:middle
the system objects,
with the changes files which

00:09:14.957 --> 00:09:18.520 align:middle
contains the deltas of what you’ve done
compared to the changes file.

00:09:18.690 --> 00:09:22.430 align:middle
Each time you save you system,
it is

00:09:22.597 --> 00:09:25.260 align:middle
as if you save a virtualised
image of your OS.

00:09:25.427 --> 00:09:26.730 align:middle
This is exactly the same principle.

00:09:27.480 --> 00:09:31.910 align:middle
If you look inside the Pharo 4
application,

00:09:33.200 --> 00:09:35.200 align:middle
you will find those ressources.

00:09:36.430 --> 00:09:40.730 align:middle
I have the Pharo 4 sources, 
I have the image file,

00:09:40.897 --> 00:09:43.130 align:middle
the changes file and somewhere
here the virtual

00:09:43.297 --> 00:09:44.540 align:middle
machine with its plugins.

