Last updated at 12:45 pm UTC on 19 August 2020
(Smalltalk classNamed: #Metacello) new
Tonel is a file-per-class format for monticello repositories.
It is a new file format for Smalltalk code Pharo has started using in version 7.
Justification for the new file format: https://pharoweekly.wordpress.com/2017/10/06/iceberg-version-0-6/
- reduce the number of files used (file tree uses many more files)
- avoid problems with long file (MSWindows limitations)
- come up with a (human) user friendly file format ("nice formatting")
- easy to write a manual parser for it
- easy to read difference display on github
Please add information about reading / converting Tonel files to Squeak and Cuis below.
About the difference between Tonel and FileTree
Thierry Goubier via Cuis-dev Thu, Aug 29, 2019 at 10:52 AM
Reply-To: Discussion of Cuis Smalltalk
To: Discussion of Cuis Smalltalk
as someone who has worked a bit on filetree, I'd say there are no philosophical differences. Just implementation compromises (*) with the way Smalltalk has to deal with the world outside of the image for storing code.
For example, Tonel has been introduced to solve issues with filetree:
- the fact filetree generates too many files creating performance issues with the host filesystem implementation
- (and issues with the poor support of Windows long paths in the virtual machines),
- and losing space because the files are small (and that current storage tech has solved its performance issues with large files by forcing a large minimum allocation size).
Filetree is itself a compromise to have a different fit with current version management systems (git, for example). As I said, just implementation compromises(), no philosophy behind that.
If there is a philosophical difference, I would say that there is only one: declarative or imperative storage format.
- Traditional Smalltalk is imperative... you don't load code, you execute a program.
- Newer formats like filetree or tonel, or probably the database-oriented ones (VW, Magma) are more declarative in nature (but have still imperative parts).
The picture grows more complex if you consider what are version control systems. They are in fact databases (even git), so a more natural fit for Smalltalk would be an object persistence layer used with code objects (VW, again. Gemstone?).
To give you an idea of how that looks, for all formats:
In Smalltalk, you have code as an object graph (class, CompiledMethod instances, etc...) with an optimisation to store the text (the sources and changes files).
When you save, you iterate over that object graph and convert it to a file / multiple files. Then you interact with your version control system to record the files (either automatically or manually). Then your version control system store your changes into a database, as a set of objects...
This also explains why you have those Smalltalk to database for storing code implementations: avoid that file layer that is extremely annoying.
(*) For example, the last version of GitFileTree, a git-enabled filetree, never manipulates any files in Smalltalk. Git does file operations but only as a kind of user interface layer, to allow users to solve conflicts.
Tonel on Squeak
Tonel on Gemtalksystems
GemtalkSystems: SETT (Store Export to Tonel Tools) is a set of tools to export Smalltalk code from Store and write into the Tonel file format managed using Git.https://pharoweekly.wordpress.com/2019/01/20/ann-sett-store-export-to-tonel-tools-for-pharo6-1/