[Pharo-project] [ANN] ImageWriter, the SystemTracer's son
First public push of the first step of the hazelnut GSoC project :) *In a nutshell* For those who didn't know SystemTracer (the father): It is a tool that traces a graph of objects and writes an image from it. ImageWriter is a refactored, renamed and repackaged version of SystemTracer2 with the following changes: - The image format can be provided as a parameter. - You have to provide an SmalltalkImage object as root to write the image (so in the future we can write bootstrap with this). - The object format was reified in objects. So the code is easier to understand + change, and people can learn how are our objects in memory easily :D. Right now, only 32 bit image format is supported. *Structure* - ImageWriter-Core has the image formats and the image writer in itself - ImageWriter-ObjectFormats contains objects that represent the memory layout of the objects and it's headers. - ImageWriter-Tests has some tests. *Tests done* - Only tested in Pharo-1.4 - There are specific tests written for the size and headers of the objects - Also, I've written a Pharo-1.4 image and then run the tests in the copied image. Only one failure compared to the original :) *Known Bugs :)* - WeakRegistryTest>>#testFinalizationWithOnFork is failing, and when I run it manually it works :/. In the image I use to write, it does not happen, only in the clone. - When opening the new image, the window is too small. It is not respecting the original image size. Don't know yet what is the problem. *How To Download* Gofer it squeaksource3: 'ImageWriter'; package: 'ImageWriter-Core'; package: 'ImageWriter-ObjectFormats'; package: 'ImageWriter-Tests'; load *How to Use it* HzImageWriter new format: HzCogImageFormat new; "or HzInterpreterImageFormat new" imageFileName: 'someFile.image'; onInitializeDo: [ "Some initialization?" ]; "this is optional, probably the same as an startup script, probably nonsense" writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be" *Next steps on this direction* - support to write an isolated image different from the host one (I'll know what I need later, hehe) - class comments! - metacello configuration - better api :) *Links* http://ss3.gemstone.com/ss/ImageWriter.html Cheers, Guille
Great news! I tried it on fresh 1.4 and I got: SmalltalkImage(Object)>>doesNotUnderstand: #shutDownImage: HzImageWriter>>writeImage: Do you plan to create a loader too? To be able to load objects from different image file. -- Pavel On Thu, Apr 26, 2012 at 1:00 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
First public push of the first step of the hazelnut GSoC project :)
In a nutshell
For those who didn't know SystemTracer (the father): It is a tool that traces a graph of objects and writes an image from it.
ImageWriter is a refactored, renamed and repackaged version of SystemTracer2 with the following changes: - The image format can be provided as a parameter. - You have to provide an SmalltalkImage object as root to write the image (so in the future we can write bootstrap with this). - The object format was reified in objects. So the code is easier to understand + change, and people can learn how are our objects in memory easily :D.
Right now, only 32 bit image format is supported.
Structure
- ImageWriter-Core has the image formats and the image writer in itself - ImageWriter-ObjectFormats contains objects that represent the memory layout of the objects and it's headers. - ImageWriter-Tests has some tests.
Tests done
 - Only tested in Pharo-1.4  - There are specific tests written for the size and headers of the objects  - Also, I've written a Pharo-1.4 image and then run the tests in the copied image. Only one failure compared to the original :)
Known Bugs :)
 - WeakRegistryTest>>#testFinalizationWithOnFork is failing, and when I run it manually it works :/. In the image I use to write, it does not happen, only in the clone.  - When opening the new image, the window is too small. It is not respecting the original image size. Don't know yet what is the problem.
How To Download
Gofer it    squeaksource3: 'ImageWriter';    package: 'ImageWriter-Core';    package: 'ImageWriter-ObjectFormats';    package: 'ImageWriter-Tests';    load
How to Use it
 HzImageWriter new    format: HzCogImageFormat new; "or HzInterpreterImageFormat new"    imageFileName: 'someFile.image';    onInitializeDo: [ "Some initialization?" ];  "this is optional, probably the same as an startup script, probably nonsense"    writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be"
Next steps on this direction
 - support to write an isolated image different from the host one (I'll know what I need later, hehe)  - class comments!  - metacello configuration  - better api :)
Links
http://ss3.gemstone.com/ss/ImageWriter.html
Cheers, Guille
On Thu, Apr 26, 2012 at 1:52 PM, Pavel Krivanek <pavel.krivanek@gmail.com>wrote:
Great news!
I tried it on fresh 1.4 and I got: SmalltalkImage(Object)>>doesNotUnderstand: #shutDownImage: HzImageWriter>>writeImage:
Oups, bad packaging :). Will fix that asap.
Do you plan to create a loader too? To be able to load objects from different image file.
Hmm it's kind of the inverse operation :P. Don't think it's an important path for the project, but I can do it after for the lulz :).
-- Pavel
On Thu, Apr 26, 2012 at 1:00 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
First public push of the first step of the hazelnut GSoC project :)
In a nutshell
For those who didn't know SystemTracer (the father): It is a tool that traces a graph of objects and writes an image from it.
ImageWriter is a refactored, renamed and repackaged version of SystemTracer2 with the following changes: - The image format can be provided as a parameter. - You have to provide an SmalltalkImage object as root to write the image (so in the future we can write bootstrap with this). - The object format was reified in objects. So the code is easier to understand + change, and people can learn how are our objects in memory easily :D.
Right now, only 32 bit image format is supported.
Structure
- ImageWriter-Core has the image formats and the image writer in itself - ImageWriter-ObjectFormats contains objects that represent the memory layout of the objects and it's headers. - ImageWriter-Tests has some tests.
Tests done
- Only tested in Pharo-1.4 - There are specific tests written for the size and headers of the objects - Also, I've written a Pharo-1.4 image and then run the tests in the copied image. Only one failure compared to the original :)
Known Bugs :)
- WeakRegistryTest>>#testFinalizationWithOnFork is failing, and when I run it manually it works :/. In the image I use to write, it does not happen, only in the clone. - When opening the new image, the window is too small. It is not respecting the original image size. Don't know yet what is the problem.
How To Download
Gofer it squeaksource3: 'ImageWriter'; package: 'ImageWriter-Core'; package: 'ImageWriter-ObjectFormats'; package: 'ImageWriter-Tests'; load
How to Use it
HzImageWriter new format: HzCogImageFormat new; "or HzInterpreterImageFormat new" imageFileName: 'someFile.image'; onInitializeDo: [ "Some initialization?" ]; "this is optional, probably the same as an startup script, probably nonsense" writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be"
Next steps on this direction
- support to write an isolated image different from the host one (I'll know what I need later, hehe) - class comments! - metacello configuration - better api :)
Links
http://ss3.gemstone.com/ss/ImageWriter.html
Cheers, Guille
Quoting Guillermo Polito <guillermopolito@gmail.com>:
On Thu, Apr 26, 2012 at 1:52 PM, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
Great news!
I tried it on fresh 1.4 and I got: SmalltalkImage(Object)>>doesNotUnderstand: #shutDownImage: HzImageWriter>>writeImage:
Oups, bad packaging :). Will fix that asap.
Do you plan to create a loader too? To be able to load objects from different image file.
Hmm it's kind of the inverse operation :P. Don't think it's an important path for the project, but I can do it after for the lulz :).
This could allow extracting objects from broken images (that are unable to start)? That would be great! BTW, this is a great project. Thank you! Cheers, Juan Vuletich
-- Pavel
On Thu, Apr 26, 2012 at 1:00 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
First public push of the first step of the hazelnut GSoC project :)
In a nutshell
For those who didn't know SystemTracer (the father): It is a tool that traces a graph of objects and writes an image from it.
ImageWriter is a refactored, renamed and repackaged version of SystemTracer2 with the following changes: - The image format can be provided as a parameter. - You have to provide an SmalltalkImage object as root to write the image (so in the future we can write bootstrap with this). - The object format was reified in objects. So the code is easier to understand + change, and people can learn how are our objects in memory easily :D.
Right now, only 32 bit image format is supported.
Structure
- ImageWriter-Core has the image formats and the image writer in itself - ImageWriter-ObjectFormats contains objects that represent the memory layout of the objects and it's headers. - ImageWriter-Tests has some tests.
Tests done
- Only tested in Pharo-1.4 - There are specific tests written for the size and headers of the objects - Also, I've written a Pharo-1.4 image and then run the tests in the copied image. Only one failure compared to the original :)
Known Bugs :)
- WeakRegistryTest>>#testFinalizationWithOnFork is failing, and when I run it manually it works :/. In the image I use to write, it does not happen, only in the clone. - When opening the new image, the window is too small. It is not respecting the original image size. Don't know yet what is the problem.
How To Download
Gofer it squeaksource3: 'ImageWriter'; package: 'ImageWriter-Core'; package: 'ImageWriter-ObjectFormats'; package: 'ImageWriter-Tests'; load
How to Use it
HzImageWriter new format: HzCogImageFormat new; "or HzInterpreterImageFormat new" imageFileName: 'someFile.image'; onInitializeDo: [ "Some initialization?" ]; "this is optional, probably the same as an startup script, probably nonsense" writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be"
Next steps on this direction
- support to write an isolated image different from the host one (I'll know what I need later, hehe) - class comments! - metacello configuration - better api :)
Links
http://ss3.gemstone.com/ss/ImageWriter.html
Cheers, Guille
Cheers, Juan Vuletich
On Thu, Apr 26, 2012 at 2:12 PM, Guillermo Polito <guillermopolito@gmail.com
wrote:
On Thu, Apr 26, 2012 at 1:52 PM, Pavel Krivanek <pavel.krivanek@gmail.com>wrote:
Great news!
I tried it on fresh 1.4 and I got: SmalltalkImage(Object)>>doesNotUnderstand: #shutDownImage: HzImageWriter>>writeImage:
Oups, bad packaging :). Will fix that asap.
Now it is fixed :). Tested it in a clean 2.0 image and worked :).
Do you plan to create a loader too? To be able to load objects from different image file.
Hmm it's kind of the inverse operation :P. Don't think it's an important path for the project, but I can do it after for the lulz :).
-- Pavel
On Thu, Apr 26, 2012 at 1:00 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
First public push of the first step of the hazelnut GSoC project :)
In a nutshell
For those who didn't know SystemTracer (the father): It is a tool that traces a graph of objects and writes an image from it.
ImageWriter is a refactored, renamed and repackaged version of SystemTracer2 with the following changes: - The image format can be provided as a parameter. - You have to provide an SmalltalkImage object as root to write the image (so in the future we can write bootstrap with this). - The object format was reified in objects. So the code is easier to understand + change, and people can learn how are our objects in memory easily :D.
Right now, only 32 bit image format is supported.
Structure
- ImageWriter-Core has the image formats and the image writer in itself - ImageWriter-ObjectFormats contains objects that represent the memory layout of the objects and it's headers. - ImageWriter-Tests has some tests.
Tests done
- Only tested in Pharo-1.4 - There are specific tests written for the size and headers of the objects - Also, I've written a Pharo-1.4 image and then run the tests in the copied image. Only one failure compared to the original :)
Known Bugs :)
- WeakRegistryTest>>#testFinalizationWithOnFork is failing, and when I run it manually it works :/. In the image I use to write, it does not happen, only in the clone. - When opening the new image, the window is too small. It is not respecting the original image size. Don't know yet what is the problem.
How To Download
Gofer it squeaksource3: 'ImageWriter'; package: 'ImageWriter-Core'; package: 'ImageWriter-ObjectFormats'; package: 'ImageWriter-Tests'; load
How to Use it
HzImageWriter new format: HzCogImageFormat new; "or HzInterpreterImageFormat new" imageFileName: 'someFile.image'; onInitializeDo: [ "Some initialization?" ]; "this is optional, probably the same as an startup script, probably nonsense" writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be"
Next steps on this direction
- support to write an isolated image different from the host one (I'll know what I need later, hehe) - class comments! - metacello configuration - better api :)
Links
http://ss3.gemstone.com/ss/ImageWriter.html
Cheers, Guille
El 4/26/12 10:19 AM, "Guillermo Polito" <guillermopolito@gmail.com> escribió:
Now it is fixed :). Tested it in a clean 2.0 image and worked :). Â
Guillermo: I like duplicate all steps. Dowloaded a clean all in one 2.0. You have a script for loading and test Hazelnut and all your new work ? Cheers Edgar
Hi Edgar, On Thu, Apr 26, 2012 at 4:46 PM, Edgar De Cleene <edgardec2005@gmail.com>wrote:
El 4/26/12 10:19 AM, "Guillermo Polito" <guillermopolito@gmail.com> escribió:
Now it is fixed :). Tested it in a clean 2.0 image and worked :).
Guillermo: I like duplicate all steps. Dowloaded a clean all in one 2.0. You have a script for loading and test Hazelnut and all your new work ?
The only stable code part of the project is this :P. The other is kind of experimental yet, and is on another repository... So, for the image writer the script is: " load " Gofer it squeaksource3: 'ImageWriter'; package: 'ImageWriter-Core'; package: 'ImageWriter-ObjectFormats'; package: 'ImageWriter-Tests'; load " use the image writer " HzImageWriter new format: HzCogImageFormat new; "or HzInterpreterImageFormat new" imageFileName: 'someFile.image'; onInitializeDo: [ "Some initialization?" ]; "this is optional, probably the same as an startup script, probably nonsense" writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be"
Cheers
Edgar
On 4/26/12 2:17 PM, "Guillermo Polito" <guillermopolito@gmail.com> wrote:
Hi Edgar,
On Thu, Apr 26, 2012 at 4:46 PM, Edgar De Cleene <edgardec2005@gmail.com> wrote:
El 4/26/12 10:19 AM, "Guillermo Polito" <guillermopolito@gmail.com> escribió:
Now it is fixed :). Tested it in a clean 2.0 image and worked :). Â
Guillermo: I like duplicate all steps. Dowloaded a clean all in one 2.0. You have a script for loading and test Hazelnut and all your new work ?
The only stable code part of the project is this :P. The other is kind of experimental yet, and is on another repository... So, for the image writer the script is:
" load " Gofer it    squeaksource3: 'ImageWriter';    package: 'ImageWriter-Core';    package: 'ImageWriter-ObjectFormats';    package: 'ImageWriter-Tests';    load
" use the image writer "  HzImageWriter new    format: HzCogImageFormat new; "or HzInterpreterImageFormat new"    imageFileName: 'someFile.image';    onInitializeDo: [ "Some initialization?" ];  "this is optional, probably the same as an startup script, probably nonsense"    writeImage: Smalltalk "Yes, we provide the our lovely global Smalltak, but any SmalltalkImage instance could be"
Â
Cheers
Edgar
Very, very thanks. I excited with this project Edgar
participants (6)
-
Edgar De Cleene -
Edgar J. De Cleene -
Guillermo Polito -
Juan Vuletich (mail lists) -
Pavel Krivanek -
Stéphane Ducasse