general

The Art of the Minimal

February 14, 2004 23:16:22.475

As part of my work for the trial run of the Master of Software Arts, I've been thinking a lot about minimalism as something to strive for in software. I have a strong bias towards solutions that involve a small number of primitives that can be easily combined, as opposed to a lot of sugar and special cases - which is why I prefer Smalltalk to Java or Python, Scheme to Common Lisp, and Objective-C to C++ (of course, I don't go so far as to write everything in Unlambda). Guy Steele's Growing a Language talk is worth mentioning in this context, since he gets the point across better than I ever could.

One of the artifacts I've produced while thinking about this is Sorrow, a compiler for a language that resembles the minimal functional language Joy. Sorrow integrates with Smalltalk in two interesting ways: in Joy (as in early Lisps), functions are passed around as simple lists of symbols, and in Sorrow they are represented by Smalltalk arrays. This means that Sorrow's syntax becomes Smalltalk's literal array syntax, and you can use an array with Sorrow code in it anywhere you would use a code block. The other is that the compiler translates the tokens in the array to Smalltalk 80 bytecodes essentially one-to-one, so that Sorrow code is directly controlling the stack machine implemented by the Smalltalk VM. In this way I think of it as a "minimal syntax" for Smalltalk (although it can't produce bytecodes that perform direct mutation or early returns).

Another is a proposal for a minimal solution to a problem domain that I've done a fair bit of work in over the last year, that of single-sign on across distributed, untrusted web applications. It's called MISO, for Minimal Integrated Sign On, and effectively it's a way to let people use public key cryptography to log into websites without having to carry an SSL certificate around with them - instead, they delegate their private key to a trusted host and let it work out the authentication details with the target site. The trick is coordinating the three way communication (key host, user, application) across HTTP without opening up any gaping holes. I'm sure I haven't gotten it right yet, but the only way to find out is to let other people see it and point out how dumb I am. It seems to me that there's a strong argument for being minimal here - the only way something like this is going to have the kind of exponential growth that makes it worthwhile is if everyone and her brother can trivially whip up something that'll talk to it, whatever platform their application happens to be on. MISO requires an HTTP client and a DSA implementation, which is more heavyweight than I'd hoped but a far cry from solutions like the Liberty Alliance.

Comments

The Art of the Minimal

[Alex Peake] February 15, 2004 11:16:06.998

I note one of your examples:
#((1 2 3) 0 (+) inject:into:)
Since this is almost Scheme, why are you re-inventing the (already extremely good) wheel?
(fold-left + 0 '(1 2 3))

Reinventing Scheme?

[Avi Bryant] February 15, 2004 17:10:39.002

Alex, this isn't a language I invented (it's based on Joy, which I link to in the article). But it's actually extremely different from Scheme. It's a postfix stack-based language, and so has no notion of environment or lexical scope; it doesn't use the lambda abstraction. This makes it map much more closely to the Smallalk VM - it's almost an assembler language for Squeak, which certainly wouldn't be true of Scheme.

Reinventing Scheme?

[Alex Peake] February 15, 2004 20:37:55.695

Thanks for setting me right on this Avi! Alex

Re: The Art of the Minimal

[Vassili Bykov] February 16, 2004 2:16:03.833

Comment on The Art of the Minimal by Vassili Bykov

There is a discussion related to this in Rich Demer's blog; thought I'd drop a link to it here.

Re: The Art of the Minimal

[Einsteiin sum it up pretty well] February 16, 2004 2:44:10.178

Comment on The Art of the Minimal by Einsteiin sum it up pretty well

"As simple as possible, but not simpler". Clearly, Unlambda is 'too simple'. Java is not simple enough. Smalltalk seems to be closer to the mark, Scheme as well.

The problem I'm foreseeing with MISO (sorry, haven't reviewed it yet - I even printed it out to force myself, but the weekend was full with other stuff) is that in security, 'as simple as possible' often is a whole lot more complex as we'd like...

Re: The Art of the Minimal

[cdegroot] February 16, 2004 2:45:52.111

Comment on The Art of the Minimal by cdegroot

Hmmm.... Mistook 'Posting Name' prompt for 'Subject' in BottomFeeder - that stuff above is by me :-)

MISO Proposal

[Brian Brown] February 19, 2004 13:30:57.084

From what I understand of your proposal, it reminds me of Kerberos - Third party trusted authentication, using public keys. It also utilizes a one time session key for establishing credentials, and it is absolutely imperative that the keyserver is secure. All the user's secret keys are stored there, and each authenticating server has it's own secret key as well (host key). Have you looked at the Kerb 5 stuff? I wouldn't call it minimal to be sure, but it is secure :)

Capabilities?

[Patrick Logan] February 19, 2004 14:46:37.890

Have you considered a capability-based approach to security? Someone in the Squeak community was working with the e-lang folks on such a thing. http://www.erights.org/ Waterken would be another good starting point. http://www.waterken.com/

Capabilities

[Avi Bryant] February 19, 2004 16:59:54.340

I'm very interested in capabilities - Seaside has, in some ways, a capabilities model (it hands out opaque and unguessable URLs, and the only way to get the system to do anything is to have one of these). And in fact I spent a long time talking about MISO with Rob Withers, who did the Squeak-E stuff. I think he eventually decided that MISO actually mapped pretty well to E, although not knowing much about E myself I'm fuzzy on the details.

Capabilities

[Patrick Logan] February 19, 2004 18:37:32.208

Seaside has, in some ways, a capabilities model Yes, that's what I was thinking. Hmm. I'll have to look at Squeak-E.