Header

Contrary to other serializers, Fuel is not focused only in one usage like code loading. Fuel is a general purpose serializer and it is highly customizable to cope with different objects and scenarios. Fuel is the infrastructure on top of which you can then build other tools. One important aspect to achieve that is to have good modularity and that's why we have several packages in Fuel.The following diagram shows some of the available Fuel packages. For simplicitly we do not include, for example, all the packages for unit tests.FuelPackagesDiagram

Fuel

This is the "core" of Fuel. It works as a general purpose serializer and all it does is serialize and materialize. If the graph you provide to serialize contains classes, they will all be considered as "global". That is, in serialization we just store its global name and during materialization we read the global name and we search it in Smalltalk globals. Therefore, classes have to be present in the image you are materializing. 99% of the users will be using this package.

FuelMetalevel

This is an extension to Fuel package and what it does is to add the knowledge of how to correctly serialize and materialize classes, traits, method dictionaries, compiled methods etc. It knows how to serialize a class and correctly materialize it. However, FuelMetalevel just do that: serialize and materialize. Nothing else. It does not send class side #initialize, it does not notify the system, it does not add the class to Smalltalk globals, no nothing.

FuelPackageLoader

This was a quick prototype (proof of concept) we did with Martin mostly to see whether we were able to serialize packages with Fuel and to see if in the future we could replace or integrate with Monticello. Martin could finish the package just in time so that I could show in ESUG last year how we could load full seaside in 15 seconds. Anyway, this packages uses FuelMetalevel (and therefore Fuel) and what it does is to ADD the class into the system. That means sendind class side #initialize, add classes to Smalltalk globals, sends notifications, etc, etc, etc. As said, this package was a prototype, it still have lot of work to do and that's why we proposed it for GSoC.What Pavel used, and what you asked, is about FuelPackageLoader. So, first we justo to load such package when using ConfigurationOfFuel. You should load the group 'PackageLoaderWithTests' in Pharo. Notice that nor FuelMetalevel nor FuelPackageLoader works on Squeak nor Quis. At least, not by default. This is because in Pharo classes have traits, which were removed in Squeak.Regarding your question of how to serialize a package with FuelPackageLoader, it is something like this:
FileStream forceNewFileNamed: 'Morphic.fuel' do: [:aStream |
       aStream binary.
       FLPackageStore new storeOn: aStream packageNamed: 'Morphic'.].
So far we do not have the granularity of claases in FuelPackageLoader, that is, the granularity is packages.

FuelPreview

It is a package to visualize the objects graphs being serialized. This is very useful to understand the transitive closure it is being serialized. This package depends on Roassal, a new visualization engine. FuelPreview is not installed by default, see more information in our Debugging guide.

FuelBenchmarks

Fuel contains a large suite of benchmarks that analyzes the speed of the serialization/materialization and the resulted size of the stream. It can be used to benchmark itself by comparing the results with previous versions or after certain change. For important changes we always run these benchmarks to see if we have not significantly decreased in performance. In addition, we have created adaptors so that we can benchmark Fuel agains other serializers. For more details read the class comments of FLBenchmarks.

FuelExamples

It is a small package that just contains some examples so that you can get started. Nevertheless, we recommend you to read the tests in case of more detailed scenarios.

FuelProgressUpdate

Is a small package that adds to Fuel the possibility of show a smart progress bar while the graph is being serialized or materialized. This is very useful for really large serializations like the case of Moose models where you want to inform the user the progress.

Contrary to other serializers, Fuel is not focused only in one usage like code loading. Fuel is a general purpose serializer and it is highly customizable to cope with different objects and scenarios. Fuel is the infrastructure on top of which you can then build other tools. One important aspect to achieve that is to have good modularity and that's why we have several packages in Fuel.

The following diagram shows some of the available Fuel packages. For simplicitly we do not include, for example, all the packages for unit tests.

FuelPackagesDiagram


Fuel

This is the "core" of Fuel. It works as a general purpose serializer and all it does is serialize and materialize. If the graph you provide to serialize contains classes, they will all be considered as "global". That is, in serialization we just store its global name and during materialization we read the global name and we search it in Smalltalk globals. Therefore, classes have to be present in the image you are materializing. 99% of the users will be using this package.

FuelMetalevel

This is an extension to Fuel package and what it does is to add the knowledge of how to correctly serialize and materialize classes, traits, method dictionaries, compiled methods etc. It knows how to serialize a class and correctly materialize it. However, FuelMetalevel just do that: serialize and materialize. Nothing else. It does not send class side #initialize, it does not notify the system, it does not add the class to Smalltalk globals, no nothing.

FuelPackageLoader

This was a quick prototype (proof of concept) we did with Martin mostly to see whether we were able to serialize packages with Fuel and to see if in the future we could replace or integrate with Monticello. Martin could finish the package just in time so that I could show in ESUG last year how we could load full seaside in 15 seconds. Anyway, this packages uses FuelMetalevel (and therefore Fuel) and what it does is to ADD the class into the system. That means sendind class side #initialize, add classes to Smalltalk globals, sends notifications, etc, etc, etc. As said, this package was a prototype, it still have lot of work to do and that's why we proposed it for GSoC.

What Pavel used, and what you asked, is about FuelPackageLoader. So, first we justo to load such package when using ConfigurationOfFuel. You should load the group 'PackageLoaderWithTests' in Pharo. Notice that nor FuelMetalevel nor FuelPackageLoader works on Squeak nor Quis. At least, not by default. This is because in Pharo classes have traits, which were removed in Squeak.

Regarding your question of how to serialize a package with FuelPackageLoader, it is something like this:

FileStream forceNewFileNamed: 'Morphic.fuel' do: [:aStream |
       aStream binary.
       FLPackageStore new storeOn: aStream packageNamed: 'Morphic'.].

So far we do not have the granularity of claases in FuelPackageLoader, that is, the granularity is packages.

FuelPreview

It is a package to visualize the objects graphs being serialized. This is very useful to understand the transitive closure it is being serialized. This package depends on Roassal, a new visualization engine. FuelPreview is not installed by default, see more information in our Debugging guide.

FuelBenchmarks

Fuel contains a large suite of benchmarks that analyzes the speed of the serialization/materialization and the resulted size of the stream. It can be used to benchmark itself by comparing the results with previous versions or after certain change. For important changes we always run these benchmarks to see if we have not significantly decreased in performance. In addition, we have created adaptors so that we can benchmark Fuel agains other serializers. For more details read the class comments of FLBenchmarks.

FuelExamples

It is a small package that just contains some examples so that you can get started. Nevertheless, we recommend you to read the tests in case of more detailed scenarios.

FuelProgressUpdate

Is a small package that adds to Fuel the possibility of show a smart progress bar while the graph is being serialized or materialized. This is very useful for really large serializations like the case of Moose models where you want to inform the user the progress.