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.
First fileout of the full PDFtalk for Pharo
Wednesday, 23. May 2022
This new 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)
First fileout of the full PDFtalk for Squeak 5.3
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
Observations
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.
First fileout of the full PDFtalk for Squeak 6.0
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
Observations
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.
Project definition
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))
Next steps
- (meta) find a Squeak buddy to pair on this
- fix the load warnings on the Transcript
- resolve all remaining undeclareds
- make the tests run