Porting my programs from Squeak 3.10.2 to 3.5

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Porting my programs from Squeak 3.10.2 to 3.5

Trygve
Hi,
I have been programming in Squeak3.10.2 for 10 years. Squeak 3.5 is a great improvement from the old 3.10.2 and it is time to update all my programs. There is a new VM that is different from the old. I'm used to letting the file extension identify the appropriate program for handling a file so I want to use a new file extension, .image3, for the Squeak Cog Spur Virtual Machine.

 It transpires that the String '.image' is embedded in any number of methods. In my Fortran days,  we learned to avoid embedded constants because they had a tendency to change. (E.g., '3.14' to '3.14159265358979323846' because we needed higher precision.)

Should I try to replace all embedded '.image' with a method call, e.g., Smalltalk imageExtension?

--Trygve
--

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo            

Norway                     Tel: (+47) 468 58 625



Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

stes

Is it an option to include the Squeak version or "image sequence tag" in the
name of the image ?

For example it seems most images on files.squeak.org are named like

Squeak4.6-15102.image
Squeak5.3-19431-64bit.image
etc.

So they all have suffix (extension) .image.
But the name part (before the .image) has a version and number which is said
to be the image's "sequence tag".

I do not know whether it is possible in Squeak to get the "sequence number"
by a method ...

However this naming convention could be used in your porting attempts as
well.



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

David T. Lewis
In reply to this post by Trygve
Hello Trygve,

On Sat, Apr 04, 2020 at 06:20:37PM +0200, Trygve Reenskaug wrote:

> Hi,
> I have been programming in Squeak3.10.2 for 10 years. Squeak 3.5 is a
> great improvement from the old 3.10.2 and it is time to update all my
> programs. There is a new VM that is different from the old. I'm used to
> letting the file extension identify the appropriate program for handling
> a file so I want to use a new file extension, /.image3/, for the /Squeak
> Cog Spur Virtual Machine/.
>
> ??It transpires that the String '.image' is embedded in any number of
> methods. In my Fortran days,?? we learned to avoid embedded constants
> because they had a tendency to change. (E.g., '3.14' to
> '3.14159265358979323846' because we needed higher precision.)
>
> Should I try to replace all embedded '.image' with a method call, e.g.,
> Smalltalk imageExtension?
>

I think that using a message send would accomplish what you are trying
to do. However, I would suggest considering another approach. The actual
image file provides enough information in its file header to determine
the appropriate VM to use, so this provides one solution when the image
is started from a command script. Another approach is to bundle a
specific VM along with the image.

Can you say something about your preferred operating system? With
that information, it may be possible to suggest an approach that would
be convenient for you, and that will also be familiar to other users
of your programs.

Also, I am guessing that you intended to say "Squeak 4.5" rather than
"Squeak 3.5". Is that right? If so, then I would suggest moving to
Squeak 4.6 rather than 4.5. The differences are not great, but the
4.6 release can more easily but converted to the newer Squeak 5.n
series of releases if you or someone else decides to do another
update of your programs at a later time.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

Eliot Miranda-2
In reply to this post by Trygve
Hi Trigve,

On Apr 4, 2020, at 9:21 AM, Trygve Reenskaug <[hidden email]> wrote:

 Hi,
I have been programming in Squeak3.10.2 for 10 years. Squeak 3.5 is a great improvement from the old 3.10.2 and it is time to update all my programs. There is a new VM that is different from the old. I'm used to letting the file extension identify the appropriate program for handling a file so I want to use a new file extension, .image3, for the Squeak Cog Spur Virtual Machine.

since we use V3 to refer to the pre-SistaV1 bytecode set and the pre-Spur image format, using image3 to refer to Spur images would be very confusing.

It is very easy to extract the image version number from the file, so first decide whether you need a new file extension or whether you can keep a single extension and extract version info from image files.


 It transpires that the String '.image' is embedded in any number of methods. In my Fortran days,  we learned to avoid embedded constants because they had a tendency to change. (E.g., '3.14' to '3.14159265358979323846' because we needed higher precision.)

Should I try to replace all embedded '.image' with a method call, e.g., Smalltalk imageExtension?

--Trygve
--

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo            

Norway                     Tel: (+47) 468 58 625




Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

timrowledge
We were discussing this with regard to the 5.3 release but didn't have time to sort out. Having a wrapper that checks the image file format and picks the right vm is not in principle difficult; we just need someone to write it.

The unix package for example already has a shell script that does a fair bit of fiddle-faddle. Adding use of the image format command wouldn't make a lot of difference.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Virtual Memory" means never knowing where your next byte is coming from.





Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

Trygve
I'm running Win 7. It has an automatic association between extension and executable.  I double click an .jpg file and a picture viewer opens. I double click an .image file and Squeak opens on the image.

I have tried opening a Squeak 3.10.2 image with the Squeak Cog Spur Virtual Machine. It seems to work, but I'm afraid there might be some hidden problem?

A solution with a wrapper would be ideal. It implies that every Squeak  release will include all old VMs in addition to the current one.
--Trygve

On 04-Apr-20 9:13 PM, tim Rowledge wrote:
We were discussing this with regard to the 5.3 release but didn't have time to sort out. Having a wrapper that checks the image file format and picks the right vm is not in principle difficult; we just need someone to write it.

The unix package for example already has a shell script that does a fair bit of fiddle-faddle. Adding use of the image format command wouldn't make a lot of difference.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Virtual Memory" means never knowing where your next byte is coming from.


-- 

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo             
http://fullOO.info
Norway                     Tel: (+47) 22 49 57 27



Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

Trygve
In reply to this post by timrowledge
I'm struggling with a new .image3 extension. It seems that Squeak Cog Spur Virtual Machine actually KNOWS that all images have the .image extension. This seems to mean that I can't run two different Squeak generation images within the same OS instance.

I'll try running my 3.10.2 under Cog Spur Virtual Machine. I hope it works.


On 04-Apr-20 9:13 PM, tim Rowledge wrote:
We were discussing this with regard to the 5.3 release but didn't have time to sort out. Having a wrapper that checks the image file format and picks the right vm is not in principle difficult; we just need someone to write it.

The unix package for example already has a shell script that does a fair bit of fiddle-faddle. Adding use of the image format command wouldn't make a lot of difference.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Virtual Memory" means never knowing where your next byte is coming from.






--

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo             
http://fullOO.info
Norway                     Tel: (+47) 22 49 57 27



Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

timrowledge
In reply to this post by Trygve


> On 2020-04-05, at 1:45 AM, Trygve Reenskaug <[hidden email]> wrote:

>
> A solution with a wrapper would be ideal. It implies that every Squeak  release will include all old VMs in addition to the current one.

That was something we were musing about for a sort of all-in-one that refers to the historical sense rather than platform sense. I suppose we probably could come up with a totally all-in-one package with the platform spread, the history and even the 32/64 spread - include a built-in convertor image etc. Might be quite a big bundle though.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: CSD: Charge Surreptitiously to DOE



Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

Trygve
In reply to this post by Trygve
PROBLEM SOLVED, THANK YOU.
I renamed the new Squeak.exe to Squeak Cog Spur Virtual Machine.exe. I can then use the Windows operation openWith... to select the appropriate VM for old and new images.

Many thanks for your helpful responses.
--Trygve

On 05-Apr-20 4:43 PM, Eliot Miranda wrote:
Hi Trygve,

On Apr 5, 2020, at 2:47 AM, Trygve Reenskaug [hidden email] wrote:

 I'm struggling with a new .image3 extension. It seems that Squeak Cog Spur Virtual Machine actually KNOWS that all images have the .image extension. This seems to mean that I can't run two different Squeak generation images within the same OS instance.

there’s no restriction on running multiple kinds of image or multiple images or multiple instances of the same image.  One can always drop an image on the right vm, or manually launch a specific vm with a specific in a shell.

The issue is only having double clicking select an appropriate vm for the image, and for that you’re right that one needs a wrapper.

Pharo has a wrapper implemented in Smalltalk, PharoLauncher, that could be adapted.  VisualWorks has a small wrapper and an ini file, VisualWorks.exe & VisualWorks.ini IIRC (know it? I wrote it).

It wouldn’t be hard to implement the wrapper solution.  I’ll try and get that done in the next few days.  But then it has to get pushed through to production, to be built using some kind of CI.  And of course it makes sense on all platforms.


I'll try running my 3.10.2 under Cog Spur Virtual Machine. I hope it works.

It won’t.  Spur 32-bit VMs are the only VMs that can run 32-bit Spur images, Spur 64-bit VMs are the only VMs that can run 64-bit Spur images, etc.  it isn’t just a matter of converting each individual object.  There are bytecode set, closure design, identity hash and object enumeration method, and other Smalltalk-level differences that mean automatically converting images is impossible.

Converting between 32-bit and 64-bit Spur images *is* automatable and there is a program (a Spur image) I should package up to do it.  But it takes a few seconds and requires VMMaker, so it is not small, and so is not something to add the the vm and have some images takes seconds to launch instead of milliseconds.



On 04-Apr-20 9:13 PM, tim Rowledge wrote:
We were discussing this with regard to the 5.3 release but didn't have time to sort out. Having a wrapper that checks the image file format and picks the right vm is not in principle difficult; we just need someone to write it.

The unix package for example already has a shell script that does a fair bit of fiddle-faddle. Adding use of the image format command wouldn't make a lot of difference.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Virtual Memory" means never knowing where your next byte is coming from.






--

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo             
http://fullOO.info
Norway                     Tel: (+47) 22 49 57 27




    

--

The essence of object orientation is that objects collaborate  to achieve a goal.
Trygve Reenskaug      
[hidden email]
Morgedalsvn. 5A       
http://folk.uio.no/trygver/
N-0378 Oslo             
http://fullOO.info
Norway                     Tel: (+47) 468 58 625



Reply | Threaded
Open this post in threaded view
|

Re: Porting my programs from Squeak 3.10.2 to 3.5

Jakob Reschke
I also noticed that you need a distinct executable name (distinct
paths are insufficient) if you want an application to appear multiple
times in the "Open with" list under Windows. Therefore I always rename
my 64-bit VMs to Squeak64.exe (and related files). Nowadays I should
probably rather do that for old 32-bit VMs...

Am Di., 7. Apr. 2020 um 11:12 Uhr schrieb Trygve Reenskaug <[hidden email]>:

>
> PROBLEM SOLVED, THANK YOU.
> I renamed the new Squeak.exe to Squeak Cog Spur Virtual Machine.exe. I can then use the Windows operation openWith... to select the appropriate VM for old and new images.
>
> Many thanks for your helpful responses.
> --Trygve
>
> On 05-Apr-20 4:43 PM, Eliot Miranda wrote:
>
> Hi Trygve,
>
> On Apr 5, 2020, at 2:47 AM, Trygve Reenskaug <[hidden email]> wrote:
>
>  I'm struggling with a new .image3 extension. It seems that Squeak Cog Spur Virtual Machine actually KNOWS that all images have the .image extension. This seems to mean that I can't run two different Squeak generation images within the same OS instance.
>
>
> there’s no restriction on running multiple kinds of image or multiple images or multiple instances of the same image.  One can always drop an image on the right vm, or manually launch a specific vm with a specific in a shell.
>
> The issue is only having double clicking select an appropriate vm for the image, and for that you’re right that one needs a wrapper.
>
> Pharo has a wrapper implemented in Smalltalk, PharoLauncher, that could be adapted.  VisualWorks has a small wrapper and an ini file, VisualWorks.exe & VisualWorks.ini IIRC (know it? I wrote it).
>
> It wouldn’t be hard to implement the wrapper solution.  I’ll try and get that done in the next few days.  But then it has to get pushed through to production, to be built using some kind of CI.  And of course it makes sense on all platforms.
>
>
> I'll try running my 3.10.2 under Cog Spur Virtual Machine. I hope it works.
>
>
> It won’t.  Spur 32-bit VMs are the only VMs that can run 32-bit Spur images, Spur 64-bit VMs are the only VMs that can run 64-bit Spur images, etc.  it isn’t just a matter of converting each individual object.  There are bytecode set, closure design, identity hash and object enumeration method, and other Smalltalk-level differences that mean automatically converting images is impossible.
>
> Converting between 32-bit and 64-bit Spur images *is* automatable and there is a program (a Spur image) I should package up to do it.  But it takes a few seconds and requires VMMaker, so it is not small, and so is not something to add the the vm and have some images takes seconds to launch instead of milliseconds.
>
>
>
> On 04-Apr-20 9:13 PM, tim Rowledge wrote:
>
> We were discussing this with regard to the 5.3 release but didn't have time to sort out. Having a wrapper that checks the image file format and picks the right vm is not in principle difficult; we just need someone to write it.
>
> The unix package for example already has a shell script that does a fair bit of fiddle-faddle. Adding use of the image format command wouldn't make a lot of difference.
>
> tim
> --
> tim Rowledge; [hidden email]; http://www.rowledge.org/tim
> "Virtual Memory" means never knowing where your next byte is coming from.
>
>
>
>
>
>
> --
>
> The essence of object orientation is that objects collaborate  to achieve a goal.
> Trygve Reenskaug      mailto: [hidden email]
> Morgedalsvn. 5A       http://folk.uio.no/trygver/
> N-0378 Oslo             http://fullOO.info
> Norway                     Tel: (+47) 22 49 57 27
>
>
>
>
> --
>
> The essence of object orientation is that objects collaborate  to achieve a goal.
> Trygve Reenskaug      mailto: [hidden email]
> Morgedalsvn. 5A       http://folk.uio.no/trygver/
> N-0378 Oslo             http://fullOO.info
> Norway                     Tel: (+47) 468 58 625
>
>