While looking for a decent UI framework for Ruby, I came across FXRuby, a Ruby wrapper for the FOX toolkit. Nice.
Category Archives: Uncategorized
Here’s a thought
A team of 100+ developers will generally develop a system so complicated it could only have been developed by a team of 100+ developers.
And now for something completely different
This has been an ‘enterprise software’ free post.
Reasons not use C
Just saw a program about the largest cosmological simulation ever, requiring 5 years, a 512 cpu supercomputer, a terabyte of RAM and producing 20 Tb of data. The head researcher described how they almost lost all the work due to an integer overflow, and then went on to explain how computers can’t count above 4 billion. Funny, my 1 cpu laptop with a mere thousandth of a terabyte of RAM can count to much more than 4 billion.
All of which tomfoolery just reinforces my opinion that, unless you’re writing an operating system, device driver, or similar then you have no business using C or C++.
SkypeIn + SkypeOut = SkypeBridge?
It would be really cool if Skype allowed SkypeIn and SkypeOut to be bridged, so I could have my Skype client running, and set it to dial my mobile phone (or whatever number I happen to be near) over SkypeOut whenever it received a SkypeIn call.
Even cooler if I could leave Skype running on my home broadband connection and send it commands via the web to change the number it calls when it gets an inbound call, thus allowing me to call the nearest phone to my physical location.
That would be truly awesome.
Office Open XML Standard not so open
Microsoft have announced their new ‘Open Standard’ XML file format for the next release of Office.
Being a curious sort, I went and had a look at the license here.
Where it all goes wrong for me is in the phrases below (emphasis mine):
Notwithstanding the foregoing, “Necessary Claims” do not include any claims: (i) that would require a payment of royalties by Microsoft to unaffiliated third parties; (ii) covering any Enabling Technologies that may be necessary to make or use any product incorporating a Licensed Implementation, or (iii) covering the reading or writing of files other than those complying with the requirements of the specifications for the Office Schemas. “Enabling Technologies” means technologies that may be necessary to make or use any product or portion of a product that complies with the Microsoft specifications for the Office Schemas, but are not expressly set forth or required in those specifications, such as general word processing, spreadsheet or presentation features or functionality, operating system technology, programming interfaces, protocols, and the like.
Not being a lawyer, I may be mistaken, but I interpret this to mean that the license explicitly does not allow competing productivity suites such as OpenOffice to read and write the new file formats. So much for openness then…
This is huge. Really huge.
I was blown away when Skype introduced SkypeOut, allowing me to call friends all over the world for the price of a local call. Now they’ve closed the loop with SkypeIn.
Now it really doesn’t matter where in the world you are, your friends can call you up for the price of a local call!
Did I mention this is going to be totally huge?
Rant on retail
Supermarkets in the UK are posting record profits. 1 out of every 8 pounds spent in UK shops is spent in Tescos.
Independent retailers are understandably concerned about the threat to their business. Although apparently not enough to do much about it. I, like many people, leave for work before 9, and return after 5.30. From my perspective small retailers are actively avoiding my business. They wait to open until after I have left in the morning, and they make sure they’re closed before I return. Is it any surprise that I go to the large supermarket on my way home from work? It’s the only shop still open! Local retailers seem to be stuck in an era when we all lived in villages and the wife stayed home and did the shopping.
Alan Kay on software
From The Early History of Smalltalk:
I think the enormous commercialization of personal computering has smothered much of the kind of work that used to go on in universities and research labs, by sucking the talented kids towards practical applications. With companies so risk-adverse towards doing their own hardware, and the hardware companies betraying no real understanding of software, the result has been a great step backwards in most respects.
A twentieth century problem is that technology has become too “easy”. When it was hard to do anything whether good or bad, enough time was taken so that the result was usually good. Now we can make things almost trivially, especially in software, but most of the designs are trivial as well. This is inverse vandalism: the making of things because you can. Couple this to even less sophisticated buyers and you have generated an exploitation marketplace similar to that set up for teenagers. A counter to this is to generate enormous disatisfaction with one’s designs using the entire history of human art as a standard and goal. Then the trick is to decouple the disatisfaction from self worth–otherwise it is either too depressing or one stops too soon with trivial results.
I will leave the story of early Smalltalk in 1981 when an extensive series of articles on Smalltalk-80 was published in Byte magazine, [Byte 1981] followed by Adele’s and Dave Robsons books [Goldberg 1983] and the official release of the system in 1983. Now programmers could easily implement the virtual machine without having to reinvent it, and, in several cases, groups were able to roll their own image of basic classes. In spite of having to run almost everywhere on moribund HW architectures, Smalltalk has proliferated amazingly well (in part because of tremendous optimization efforts on these machines) [Deutsch 83]. As far as I can tell, it still seems to be the most widely used system that claims to be object-oriented. It is incredible to me that no one since has come up with a qualitatively better idea that is as simple, elegant, easy to program, practical, and comprehensive. (It’s a pity that we didn’t know about PROLOG then or vice versa, the combinations of the two languages done subsequently are quite intriguing).
While justly applauding Dan, Adele and the others that made Smalltalk possible, we must wonder at the same time: where are the Dans and the Adeles of the ’80s and ’90s that will take us to the next stage?
Getting meta
Okay, so the investigations continue. As mentioned previously I’m attempting to reimplement Dwemthy’s Array in Smalltalk. There are a couple of ways to port code from one language to another.
One approach is to attempt a ‘direct translation’, changing as little as possible outside the syntax. This has the benefit of making it easier to mentally flip back and forth as the code is ported. The difficulty depends on how similar the features of the 2 languages are. For example, transliterating idiomatic Lisp code to, well frankly, any non-Lisp based language would be exceedingly challenging. There is also the risk of being sucked into having to reimplement a bunch of the standard libraries of the source language in the target language.
The other approach is to establish a high level picture of the intent of the original code, and reimplement that in terms of the target language. The benefit here is being able to take full advantage of the idioms of the target platform. The disadvantage is obviously that subtleties of the original behaviour may be lost in the conversion.
Imagine a conversation conducted using a translator. A word for word translation might be more accurate but probably makes less sense in the target language, while a translator who digests an entire sentence and reiterates it in the colloquial form of the target language might well make more sense to the listener, but there is an increased need for the translator to understand the subject under discussion.
For the purposes of my journey I’m taking the direct translation approach. As Dwemthy’s Array uses some pretty exotic features of Ruby this is probably the more challenging of the two approaches, but that just makes it more interesting.
First off, I think I need to be able to extend the subclassing functionality of VisualWorks. The standard system creates subclasses by sending a message to a NameSpace object. This is a problem as I want to intercept the call for a specific class (Creature) and do some extra stuff. The current VisualWorks code looks like this:
defineClass: className superclass: superID indexedType: typeName private: isPrivate instanceVariableNames: iVars classInstanceVariableNames: ciVars imports: pools category: category attributes: attributes | superclass approved class cbr mbr | superID == nil ifTrue: [superclass := nil] ifFalse: [superID binding isForClass ifTrue: [superclass := superID value] ifFalse:[self error: (#SuperclassMustBeAClass <> 'The superclass of a class must also be a class')]]. Behavior checkLegalBehaviorType: typeName. approved := SystemUtils validateClassName: className for: nil. approved == nil ifTrue: [^nil]. cbr := (BehaviorBuilderRecord forName: approved in: self) superclass: superclass; instVarString: iVars; category: category; attributes: attributes; behaviorType: typeName; importString: pools; private: isPrivate. (mbr := MetaclassBuilderRecord new) forInstance: cbr; instVarString: ciVars. class := ClassBuilder new addRecord: cbr; addRecord: mbr; reviseSystem. ^class
What I actually want is for most of this code to live in the Class er, class so I can hook it from a subclass. The first chunk is all about making sure the superclass of the class under construction exists, so I don’t need that. I think I can take all the code from the line that starts ‘Behaviour’ and drop it into the Class um, class more or less verbatim, flipping around the references to ‘self’ and ‘superclass’ and adding ‘aNameSpace’ parameter:
subclass: className nameSpace: aNameSpace indexedType: typeName private: isPrivate instanceVariableNames: iVars classInstanceVariableNames: ciVars imports: pools category: category attributes: attributes | approved class cbr mbr | Behavior checkLegalBehaviorType: typeName. approved := SystemUtils validateClassName: className for: nil. approved == nil ifTrue: [^nil]. cbr := (BehaviorBuilderRecord forName: approved in: aNameSpace) superclass: self; instVarString: iVars; category: category; attributes: attributes; behaviorType: typeName; importString: pools; private: isPrivate. (mbr := MetaclassBuilderRecord new) forInstance: cbr; instVarString: ciVars. class := (ClassBuilder new) addRecord: cbr; addRecord: mbr; reviseSystem. ^class
The code in NameSpace then changes to:
defineClass: className superclass: superID indexedType: typeName private: isPrivate instanceVariableNames: iVars classInstanceVariableNames: ciVars imports: pools category: category attributes: attributes | superclass | superID == nil ifTrue: [superclass := nil] ifFalse: [superID binding isForClass ifTrue: [superclass := superID value] ifFalse: [self error: #SuperclassMustBeAClass <> 'The superclass of a class must also be a class']]. ^superclass subclass: className nameSpace: self indexedType: typeName private: isPrivate instanceVariableNames: iVars classInstanceVariableNames: ciVars imports: pools category: category attributes: attributes
Important thing I learned: an instance method of class Class is inherited as a class method of normal classes.
Minor aside: here I am changing the way classes are defined. I’d have been up to my armpits in the guts of the VM by now if this was Java.
You must be logged in to post a comment.