http://goran.krampe.se/blog/Squeak - 11/21/09 00:04:44 - 03/19/09 07:55:19
November, 2009
06 Sep 09
DeltaStreams boost in Brest
Here at ESUG in Brest DeltaStreams has gotten a real "boost". Igor Stasenko has joined the effort and is busy whipping up a user interface using the Toolbuilder API so that it will work in most Squeak flavours (and perhaps other Smalltalks too) and I have been busy getting the rest of the code in a better shape.The presentation I gave was very well received (I think), although it collided with the Seaside tutorial which meant that a lot of people I would have liked to see it was busy on the other track. But interest is high, and not only from Squeakers but also from developers using Smalltalk/X and VisualWorks!
The immediate results from Brest are:
- Tirade has been fully hooked into Deltas which means that Deltas now have a file format and can be serialized/deserialized using that.
- DeltaStreams now load very easily into latest Squeak "trunk" using an Installer based script, instructions below.
- Igor is building a Toolbuilder based user interface similar to the changesorter tools. After just a few hours he has something "up and running" and I suspect it will gain features over the next weeks rather quickly. NOTE: Matthew Fulmer made the first UI for Deltas but Igor and I wanted to build something different.
- We have been talking to Pharo people about what kind of APIs will be available in Pharo that we can depend on for Deltastreams and AFAICT Toolbuilder and SystemEditor are meant to be available in Pharo.
- Lots of tests cleaned up, we are almost in the full green with over 300 tests.
- Handling of DoIts has been added. A tricky problem.
Below follows an instruction for getting started HACKING on the DeltaStreams package for Squeak. If you are into meta programming, advanced source code management and Squeak, it might be interesting. Thus it is not an instruction for users (it is not really usable yet anyway) nor for Squeak beginners.
Step 1
Grab an image, 3.10.2-7179 should be fine but we are now working in trunk. It might be nice if you picked some other important target for DeltaStreams, like say Croquet, Cuis or Pharo. :)
Step 2
Add the repo for DeltaStreams on SqueakSource:
MCHttpRepository location: 'http://www.squeaksource.com/DeltaStreams' user: '' password: ''Step 3
Open the repository and load the latest version of the package called DeltaStreams-Installer. Then execute the class side script by executing DSInstaller install. If all was loaded you will get a nice greeting!
NOTE: Several packages in the repository are not loaded by this installer script. Some lines of development has not been pursued further by me (Primarily ICS, the first browser UI and some more things) but that does not mean that Matthew or someone else can port that code forward and make it work again :)
Step 4
Run some tests. Currently there are some tests failing. We do not like this "state" so I am in the process of cleaning up, fixing what I can fix and throwing out red tests I can’t understand. We should always be green, otherwise we don’t know if we broke something. These are the results in my image today:
Prerequisites:
SystemEditor-Tests: 11 failures (have not looked at it, was the same in 3.10.2-7179) Tirade-Tests: green SystemChangeNotifications-Tests: greenDeltaStreams:
DSDeltaApplyTest: green DSDeltaCreationTest: green DSDeltaAntiTest: green DSDeltaCopyTest: green DSDeltaTiradeFileOutTest: green DSDeltaLoggingTest: green DSDeltaRevertTest: 6 failures (related to dangling method categories, these we should fix!) DSDeltaTiradeTest: green DSDeltaTiradeTest: green DSDeltaValidationTest: red, red, red!!! (I need to read up on validation, Matthew made it) DSDeltaValidationTestSystemEditor: red, red, red!!! (same here)Step 5
Read some class comments and code. Start with DSDelta and the DSChange hierarchy.
Step 7
Grab a big cup of coffee, save your image from time to time (although the code generally does not make it crash…). Ask us whatever you like.
regards, Goran & Igor
30 Jun 09
"Hacking On DeltaStreams"-Guide For Suicidal Meta Squeakers
This instruction is for getting started HACKING on the DeltaStreams package for Squeak. If you are into meta programming, advanced source code management and Squeak, it might be interesting. Thus it is not an instruction for users (it is not usable anyway) nor for Squeak beginners.Step 1
Grab an image, I use 3.10.2-7179. It might be nice if you picked some other important target for DS, like say Croquet or Pharo. :)
Step 2
Install base image fixes for DeltaStreams (maintained as a CS for now), pick the one suitable:
http://map.squeak.org/packagebyname/deltastreamfixesStep 3
Add repos for DeltaStreams/Tirade/SystemEditor on SqueakSource and open them:
MCHttpRepository location: 'http://www.squeaksource.com/DeltaStreams' user: '' password: ''Step 4
Load the latest of ONLY the following packages from those repos:
SystemEditor-Core SystemEditor-Squeak SystemEditor-Traits SystemEditor-Tests SystemEditorBrowser Tirade InterleavedChangeSet DeltaStreams-Model DeltaStreams-Logging DeltaStreams-Storing DeltaStreams-Tirade DeltaStreams-Tests DeltaStreams-Deprecated DeltaStreams-UINOTE: The DeltaStreams-Logging package is from Matthew, not sure of its status. DeltaStreams-Storing is meant to contain the parts needed for DS to use InterleavedChangeSet - which is the funky changeset-compatible format Matthew invented. I am not pursuing that format but I see no harm in keeping it. It might be a good idea too - I am not sure. DeltaStreams-Tirade is the reader/writer support for the Tirade format which is the preferred format for Deltas from now on. All tests are in DeltaStreams-Tests, there is a UI too but Matthew wrote it and I am unsure of its operational status. The DeltaStreams-Deprecated is a big pile of stuff that should in the end just be dumped. Consider it to be "candidates for death". :)
Eventually we would typically only really need (no ICS, no tests, no SE browser, no deprecated):
SystemEditor-Core SystemEditor-Squeak SystemEditor-Traits Tirade DeltaStreams-Model DeltaStreams-Logging DeltaStreams-Tirade DeltaStreams-UIStep 5
Run some tests. Currently there are tons of tests failing. I do not like this "state" so I am in the process of cleaning up, fixing what I can fix and possibly even throwing out red tests I can’t understand. We should always be all green, otherwise we don’t know if we broke something. These are the results in my image:
SystemChangeNotifications-Tests: 1 error (it is a trivial fix I missed, will go away) Tirade-Tests: green SystemEditor-Tests: 11 failures of 181 (not sure why...) DSDeltaApplyTest: green DSDeltaLoggingTest: green DSDeltaCreationTest: green DSDeltaClassifyTest: green DSDeltaAntiTest: green DSDeltaCopyTest: green DSDeltaFileOutTest: 2 errors (Matthew has commented them, I am not pursuing ICS) DSDeltaRevertTest: 19 passes, 6 failures (these we should be able to fix!) DSDeltaTiradeTest: green DSDeltaChangeSetTest: red, red, red!!! (this is testing the ChangeSet "lookalike" ICS aspect, I am not pursuing ICS so will not fix now) DSDeltaTiradeFileOutTest: red, red, red!!! (these I will fix!) DSDeltaValidationTest: red, red, red!!! (I need to read up on validation first) DSDeltaValidationTestSystemEditor: red, red, red!!! (same here)NOTE: The Validation tests… I am unsure of, I have not looked at the design and I am unsure if I have broken them or if they were indeed broken. We should take an image and install the DS release from SM and see the test status there.
Step 6
Read some class comments and code. Start with DSDelta and the DSChange hierarchy.
Step 7
Pray. Ask me.
regards, Göran
July, 2009 31
20 Apr 09
Tirade, first trivial use
Last night I started hooking Tirade into Deltas. Quick background: Deltas is "Changesets for the 21st century", or in other words an intelligent patch system under development for Squeak. Tirade is a Smalltalk/Squeak centric "JSON"-kinda-thingy. I made Tirade in order to get a nice file format for Deltas.Just wanted to share how the first trivial code looks, and thus illustrate simple use of Tirade.
I have a DSDelta (a Delta being almost like a ChangeSet). It consists of some metadata (a UUID, a Dictionary of properties and a TimeStamp) and a DSChangeSequence (which holds the actual DSChange instances). As a first shot I only implemented the metadata bit. So step by step:
- Write a unit test, first let’s set up our readers and writers on a common stream:
setUp | stream | stream := RWBinaryOrTextStream on: String new. reader := DSTiradeReader on: stream. writer := DSTiradeWriter on: stream…then a trivial write, read and compare test - note that they both look at the same stream:
testEmptyDelta | delta same | delta := DSDelta new. writer nextPut: delta. reader reset. same := reader next. self assert: same = delta. self assert: delta timeStamp = same timeStamp. self assert: delta properties = same properties. self assert: delta uuid = same uuid
- Create DSTiradeWriter. It turns out that DSTiradeWriter at this point is just an empty subclass of TiradeRecorder! Eventually we might need to add behaviors but at this point there is no need. The TiradeRecorder uses DNU to intercept messages and encode them as Tirade.
- Implement #tiradeOn: in our domain object DSDelta. This will be used by the writer and looks like this:
tiradeOn: recorder recorder delta: uuid asString36 stamp: timeStamp printString properties: properties…here we convert the UUID to a String (base 36) and the timeStamp too. The properties Dictionary just holds "simple" data that Tirade can represent, so no need to convert it. The rule is that we make up a message (in this case #delta:stamp:properties:) which will be used in the Tirade stream, and we make sure our arguments are "Tirade proper" which basically means Booleans, Strings, Symbols, Arrays, Numbers, Associations and Dictionaries thereof. Note that the recorder being a DSTiradeWriter inherits the implementation of #doesNotUnderstand: from TiradeRecorder that will write this Tirade message onto the stream typically looking like this:
delta: 'd71oknvt1bwswhno6iwgund07' stamp: '20 April 2009 11:20:50 am' properties: nil.And then the final step, our reader:
- Creata a DSTiradeReader. We simply create an implementation of the above Tirade message #delta:stamp:properties: and put it in the method category "tirade" so that the default security mechanism is happy:
delta: uuidString36 stamp: timeStampString properties: properties result := DSDelta new. result uuid: (UUID fromString36: uuidString36); properties: properties; timeStamp: (TimeStamp fromString: timeStampString)…this class inherits an instvar called ‘result’, which is fine to reuse. As you see the properties needs no conversion, the others are converted from Strings.
And tada - the unit test is green! So we implemented reading and writing in more or less two lines of code. Kinda neat! :)
regards, Goran
April, 2009