Showing posts with label Metacello. Show all posts
Showing posts with label Metacello. Show all posts

Tuesday, December 21, 2010

Metacello ConfigurationOfAida

  Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfAida';
    load.

  ((Smalltalk at: #ConfigurationOfAida) project version: '6.0') load.

"the above is the code for a DoIt in a Pharo or Squeak Smalltalk workspace so as to load AIDA/Web by Janko Mivšek."

"This and the above are in quotes because Smalltalk comments in code are in dbl-quotes."

"The two semi-colons above permit three messages to be sent in series to the instance of the Gofer service. A period (full-stop) ends those two keyword messages and the final unary message."

"What is argably not clear is that the first two messages set values in slots but the last directs an action. I say this because 'load' is not unambiguously a verb in English.  It would have been lovely if set and do had been available as no op sugar useful to an Slint."

  Gofer new
    set squeaksource: 'MetacelloRepository';
    set package: 'ConfigurationOfAida';
    do load.

"An easy mod to most Smalltalk implementations would be "
  Gofer new
    set_squeaksource: 'MetacelloRepository';
    set_package: 'ConfigurationOfAida';
    do_load.

"One up-side might be reminding developers to not hide actions in methods which consume value arguments. But that ship sailed in 1980 or earlier.

Here is the added quibble: the first two values are names (the second is certainly not a package qua object) and so this code might better have been more revealing as: "

  Gofer new
    set_squeaksource_id: 'MetacelloRepository';
    set_package_name: 'ConfigurationOfAida';
    do_load_package.
   Transcript nextPutAll: 'I blasphemed against ST.'

"What cannot yet be done is to send a message to a class
  >>requestFreshObject
and have the class request the needed parameters of YOU either then or at the time of the proposed action.

I say this because >>new is not the sole means of acquiring a reference to an instance. "

  >>new
    ^self shouldNotImplement 
" a possible class method in Gofer "
 
   Gofer default   "would be no surprise"

   SmalltalkComms currentGofer   " may lie in the offing.

So "

   Smalltalk user: me requires: (package named: 'Aida') from: (Metacello squeakSource).

"Unlike Curl, in Smalltalk the order of those keywords matters because no semi-colon means that the last message send used only one selector named
    user:requires:from:
and only by looking at the actual code would you maybe know which objects to supply.

And yet "
  Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfAida';
    load.
" is so easy - provided that you already know to use Gofer and also know to provide a version as in "

   (Smalltalk at: #ConfigurationOfAida) project version: '6.0') load


" That last direct call into the global Smalltalk dictionary is a sure sign that even this great improvement in loading packages into Smalltalk is an improvement itself awaiting another iteration.

For generations, introductions to Smalltalk have glossed over the pragmatics of Smalltalk - the actual use of Smalltalk in context for some end.  It may even be that calling Smalltalk a 'language' is itself misleading and so I should not use the 'pragmatics' metaphor.  Back to guilds and artisans?
"

Thursday, December 16, 2010

Metacello Pharo

I am loading Seaside into a Pharo Smalltalk (1.2 beta) 'core image' running on top of the latest Cog VM using
Gofer new
   squeaksource: 'MetacelloRepository';
   package: 'ConfigurationOfSeaside';
   load.

(Smalltalk at: #ConfigurationOfSeaside) load
which is going fine except that I occasionally have to look to see what cycles the process is consuming as I get no 'busy'cursor and the 'top' progressbar stays empty - during some downloads the image returns my blank stare.
It is good to see that I do not need 'ConfigurationOfSeaside30' to get 3.0
And only one walkback so far ( a minor deprecated method to correct )
Enhanced by Zemanta
OOPs ... I saw Cfg of Seaside loading Cfg of S 3.0 but here comes a pile of 2.8   oh vey.
How will we escape 'ConfigurationOfSeaside3.1bOsX' etc etc ?

And POOFFF! Magritte compiles by kicking back multiple error streams ... and we are off to try
Gofer new
    squeaksource: 'MetacelloRepository';
    package: 'ConfigurationOfSeaside30';
    load.

(Smalltalk at: #ConfigurationOfSeaside30) load
On my first try I type '3' and not the full '30' and was rejected (not advised, but rejected.)

The issue is that Smalltalk is not yet organic software: it is component software.  But then I see that Pharo offers a configuration ST file.  Now I have to go check to see if this facility remains available in a 'stripped' Pharo image.

This is an old Smalltalk implementation issue often glossed over - but try to explain to some one tasked with Governance, Risk and Compliance (GRC) that your Pharo image starts up by evaluating a raw ST file.  I remember a mission-critical app at a Fortune 100 where one of the ST files being consumed (Why not read and interpret all ST files that you find in the image directory ? ) was quite a shocker (for me, at least.)  But so long as 'stripping' Smalltalk images is more mysterious than establishing a 'base' Smalltalk developer image this concern will remain.

All in all, Metacello configurations are a big improvement.

I think that David Kranz says something about this in his Dr Dobbs interview on the role of the architect.

Meanwhile a class load method just failed on a createClass  message due to a global name collision - and I do not see the equivalent of a tool dating back to Cooper Peters 1990 for resolving this ... so a Seaside 3.0 on Pharo 1.2 alpha on Cog will have to wait for another day ... so back to Pharo 1.1.1 to further explore what Traits can bring to Seaside for multiple markup strategies (read: Curl in addition to HTML + JS)

Monday, December 13, 2010

Rebol Altme

As soon as IE hits this blogspot blogger site this PM (ADT) today, ProcessExplorer shows IE consuming almost all CPU cycles - and with no end in sight, I keep killing it.  But Opera just opened on the site fine.  So I won't try Chrome.  No point in acting paranoid ...

And then there's Rebol.  It seemed today from an announcement in the altme.com Rebol3 'world' that a testable combo of runtime+DLL+gui-code was available.  But it fails immediately on any test I tried. OK - it's based on code that is not even in the R3 alpha yet, so no big deal.  I'll tinker with it and someone may post something on the style issue involved (some essential path type is finding a none! value.)

But altme.  This is the public face of Rebol these days.  Oh vey.  Not that I am so crazy about the curl.com developer site at developers.curl.com not being written in Curl ... but at least that site is largely useable and searches well with things such as google site:curl.com

Imagine (as I hop in and back out of the HTML editor in the WYSIWYG editor) - oh hang it, I give up on editing this post.

Of course what is far worse is this Google-owned blog editor in which I find myself at the moment.  It repeatedly traps a user in a blockquote element or in an em element - and it is not just a problem with some one browser.  It is all but impossible to post a simply formatted text without spending time in the HTML edit page. Okay. HTML is markup ...

And facebook - suddenly putting a url in a status makes it impossible to get rid of a web snippet that it shovels into the status update.  Give me twitter's fewer characters any day ...

And this blog's edit interface just screwed up two "carriage returns" in a row ...

Then there is the Rebol showcase web site which is not smart enough to set the background in CSS ... such very smart and capable and inventive people but a result that looks so dumb it doesn't matter how smart it is.

But there is always Microsoft OneNote:  a software pkg that by-and-large works and it mostly adequate to the task.

Question: how many x100 megabytes must an editor be so that it can format a short latin-encoded text [non-technical English] in simple paragraphs and emit it in a DOC format?  It must be a Monday. And I'm north of 45 deg LAT and its both warm and raining on Dec 13. Something's not right ...

There is hope for Rebol3 GUI: I see what style code did for Curl GUI's and such chrome will do the same for Rebol GUI''s.  What would be worthwhile would be for an historian of technology to document just how difficult it has been to move from Rebol2 to Rebol3 - difficult for such very bright and dedicated people.

But what explains why an altme/safeworld is so dismal: no simple reply metaphor (topics, not threads), no tagging (which is now all but universal) and no one able to step up to the plate and make a signature app outa that thing.  What vexes me most is the notion that there was some advantage to be had in writing the darn thing in Rebol at the very point when it had been acknowledged that Rebol had to be significantly re-thought in order to be used for PITL.

On the positive side is the web bug tracking - but that has also become near universal.

In a sad parallel, Smalltalk is only now arriving at Metacello for a sane approach to loading Metacello packages.  For years loading open-source Smalltalk packages has been a near total crap-shoot.  And that from the folks who gave us class browsers, refactoring browsers, unittest frameworks, the wiki, eXtreme programming ... but Metacello configurations appears to be a strategy that is working - both for Squeak Smalltalk and for Pharo Smalltalk.  Is there hope for Cincom VisualWorks Smalltalk ?  Their public code repository is those nightmare in which those use it to commit code are used to it and continue to use it ("Isn't it great?") but they also wonder that Smalltalk does not catch on.  Just compare Ruby gems any day.  Python virtualenv may be an embarrassment that is less than a kludge, but at least it works as intended.