This is an old revision of the document!


Porting Blog

A chronological account of the work done with the Smalltalk Transform project.

The beginning was documented for the Values port to Squeak.

Now the real project starts and will be recorded here.

Saturday, 11. June 2022

This version includes fileOuts for VAST 10.0 and VAST 11.0. All load without fatal errors.

Download the fileout and file it into a fresh VAST image.

585 run, 143 pass, 14 fail, 428 error

Wednesday, 23. May 2022

This version includes fileOuts for Pharo 6.1, 7.0, 8.0, 9.0 and 10.0. All load without errors.

Download the fileout and file it into a fresh Pharo image.

597 Tests: 148 pass, 19 fail, 430 error

597 Tests: 174 pass, 23 fail, 400 error (Pharo 6.1)

Like Squeak, Pharo does not like methods with more than 15 arguments. That is OK. Unfortunately, the error is swallowed somewhere and only a little popup informs about the problem without the chance to open a debugger.

There is no progress feedback for fileIn. Since the sources are large, the image seems to hang: no reaction to user actions, no update of the Transcript and the text cursor stops blinking. Not even the mouse indicates a busy state. After 7 minutes on my machine, Pharo wakes up and everything is fine. So, hold on and keep waiting…

Like Squeak 5.3, Pharo 8.0 and earlier does not like methods with more than 255 literals.

Navigation is more difficult than in Squeak, because the class categories are sorted alphabetically. Squeak sorts them in fileIn order.

Pharo 6.1 has the same encoding (macintosh) problem as Squeak 5.3. Interestingly, when the fileIn is triggered by pressing the play button of the playground, after fileIn GT will raise an encoding error when trying to display the beginning of the file.

Wednesday, 18. May 2022

This new version also loads in Squeak 5.3.

Download the fileout and file it into a fresh Squeak 5.3 image.

The file should load without errors.

597 Tests: 174 pass, 23 fail, 400 error

The macintosh encoding does not support several characters used in the library. The characters are either in comments copied from the PDF specification (like $×) or they are used in encoding tests. My temporary solution is to replace all unencodable characters with a $? when writing the final result to the file. The problem will come back when the then failing encoding tests need to be fixed.

Another problem: Squeak 5.3 does not like methods with more than 255 literals. Fortunately, there is only one such data method in PDFtalk. The solution is the split the method containing the data into two and replace one and add the other for Squeak 5.3.

Monday, 16. May 2022

Version 2 of the Smalltalk Transform project is ready for action. Most notable, it allows the renaming of namespaces classes. All, well almost all, references to the renamed classes are replaced by the new names. Also, it is now possible to specify class definition changes, which allows to redefine specific aspects of a class like it's instance variables, pool dictionaries or even the superclass.

The new engine has been taken for a first run on PDFtalk.

FileOut from VW with

Squeak60 fileOutPDFtalk.

The fileout includes Values, PDFtalk, Values tests, PDFtalk tests and the PDFtalk Demonstrations. The file PDFtalk.Squeak60.st is about 6 MB in size.

Download the fileout and file it into a fresh Squeak 6.0 image.

The file should load without errors. This takes about 8 minutes on my machine.

Although the fileout is very raw, some tests are already running.

597 Tests: 174 pass, 23 fail, 400 error

Methods in Squeak cannot have more than 15 parameters. This was a bit surprising. This caused problems with two value classes with more than 15 instance variables. This was fixed by adding a few transformations to establish an alternative implementation.

Squeak 5.3 chokes on loading over a character not available in the macintosh encoding. The character is used in the PDF specification and I would like to not fix this in the source… I will think of something.

ProjectChange
	name: #PDFtalk
	source: ((OrderedCollection new)
		add: (Package name: #Values);
		add: (Bundle name: #PDFtalk);
		add: (Package name: #'Values Testing');
		add: (Bundle name: #'PDFtalk Testing');
		add: (Package name: #'PDFtalk Demonstrations');
		yourself)
	changes: self pdftalkPackageChanges
	nameMapping: (NameMapping
		keep: ((OrderedCollection new)
			add: #{Smalltalk.PDF};
			add: #{PostScript.PSDictionary};
			add: #{PDFtalk.PDFObject};
			add: #{PDFtalk.PDFArray};
			add: #{PDFtalk.PDFDictionary};
			add: #{PDFtalk.PDFStream};
			add: #{PDFtalk.PDFString};
			add: #{PDFtalk.PDFDate};
			add: #{PDFtalk.PDFTypeDefinition};
			add: #{PDFtalk.PDFEncoder};
			yourself)
		classToNames: (Valuemap
			with: #{SubscriptOutOfBoundsError} -> #Error
			with: #{NonIntegerIndexError} -> #Error
			with: #{NotFoundError} -> #KeyNotFound)
		namespaceToPrefixes: ((Valuemap new)
			add: #{Smalltalk.PostScript} -> 'PS';
			add: #{Smalltalk.PDFtalk} -> 'Pt';
			add: #{PDFtalk.Fonts} -> 'PtF';
			add: #{PDFtalk.Fonts.CFF} -> 'CFF';
			add: #{PDFtalk.Fonts.OpenType} -> 'PtOT';
			yourself))
  • (meta) find a Squeak buddy to pair on this
  • fix the load warnings on the Transcript
  • resolve all remaining undeclareds
  • make the tests run
  • portingblog.1654963853.txt.gz
  • Last modified: 2022/06/11 18:10
  • by christian