21st Century Smalltalk

February 28, 2007

Almost Smalltalk

Filed under: Lisp, Smalltalk Language — pfisk @ 8:14 pm

lisptest14
Vista Smalltalk Site

To run the above demo, open a Lisp workspace and execute “(@open ListDemo)” – you can open Vista Smalltalk in your browser here.

This test was designed to test event callbacks using Smalltalk-style messaging.
Here is part of the code (the full source is here):

(setq btn (@new Button))
(@label- btn “Selection One”)
(@addcallback-function- btn “click” (lambda() (@self ‘oneselected- lst)))
(@addchild- hb btn)

Of course this doesn’t look like Smalltalk – it looks like some weird kind of Lisp. But it is equivalent, semantically, to this Smalltalk code:

btn := Button new.
btn label: ‘Selection One’.
btn addcallback: ‘click’ function: [self oneselected: lst].
hb addchild: btn

The next step is to make a Lisp reader that can read Smalltalk source (not too difficult), and then rearrange the Smalltalk token stream into the “weird Lisp” format above using macros.

Smalltalk running in Flash is not that far away.

Walking Robot

Filed under: Robots — pfisk @ 5:14 pm

Paul Graham’s post has a link to the video and an analysis of why this is important:

There are of course biped robots that walk. The Honda Asimo is the best known. But the Asimo doesn’t balance dynamically. Its walk is preprogrammed; if you had it walk twice across the same space, it would put its feet down in exactly the same place the second time. And of course the floor has to be hard and flat.

Dynamically balancing—the way we walk—is much harder. It looks fairly smooth when we do it, but it’s really a controlled fall. At any given moment you have to think (or at least, your body does) about which direction you’re falling, and put your foot down in exactly the right place to push you in the direction you want to go. Practice makes it seem easy to us, but it’s a very hard problem to solve. Something as tall as a human becomes irretrievably off balance very rapidly. When a robot is falling, meaning its center of gravity is not centered over the foot (or feet) on the ground, the error grows by e^(t/.5). If a robot gets more than a few centimeters off balance, it’s unlikely to recover, because you just can’t move the limbs fast enough to compensate.

Perhaps this is an historical milestone – we won’t know for a few decades.

There are many other things happening in the robotic area right now, such as Microsoft’s Robotic Studio and Toyota’s plans to bring out a line of household robots. Robotics is probably at the same stage of maturity that the computer industry was in the late 1970’s – the broad-scale revolution was about to begin. And if you think that PC’s changed the world, it was nothing compared to the social changes that the arrival of general purpose robots will likely cause…

One of the best commentators on the state of robotics is Hans Moravec, who has been building robots since the 1960’s. I particularly like his essay entitled “Ripples and Puddles” which gives a broad overview of the path to building intelligent systems.

His last paragraph may prove prophetic:

Robotics should become the largest industry on the planet early in this evolution, eclipsing the information industry. The latter achieved its exalted status by automating marginal tasks we used to call paperwork. Robotics will automate everything else!

The beauty of Lisp

Filed under: Lisp — pfisk @ 4:32 pm

IBM recently published an excellent article on Lisp as part of its “Crossing Borders” series. Its author refers to it as “The El Dorado of programming languages” – here are some extracts:

Lisp has long been recognized as one of the great programming languages. The fanatical following it has inspired throughout its long history — nearly 50 years — tells you it’s something special. At MIT, Lisp plays a foundational role in the curriculum for all programmers. Entrepreneurs like Paul Graham used Lisp’s incredible productivity as the jet fuel for successful startups. But to the chagrin of its followers, Lisp never made it into the mainstream.

I recently finished my first marathon and found running much more rewarding than I ever could have expected. I turned an act as simple as taking a step into something extraordinary for the human body, running 26.2 miles. Some languages, like Smalltalk and Lisp, give me a similar feeling. For Smalltalk, the step is the object; everything in Smalltalk deals with objects and message passing. With Lisp, the foundational step is even simpler. This language is composed entirely of lists. But don’t let the simplicity fool you. This 48-year-old language comes with incredible power and flexibility that the Java language can’t begin to match.

Notice that the author attaches a similar importance to Smalltalk – just as I do.

His remark about Lisp never making it to the mainstream is interesting since IBM introduced a mainframe-based Lisp in the 1980’s as part of a broader initiative to market it’s AI products. In fact, many other Lisp implementations were introduced around the same time and very few were successful in the market. In retrospect, some reasons were:

  • high prices
  • over-hyped expectations
  • expensive memory and processing power
  • lack of standardized data exchange formats (eg XML)

The world has changed in the two decades since IBM’s mainframe Lisp was introduced, and many of the impediments that blocked its adoption have disappeared.

I expect that Lisp (and Smalltalk) will see a revival as Internet users demand a level of application flexibility which the current approaches (Ajax,Xaml/C#, MXML/ActionScript, OpenLaszlo, etc) will be unable to deliver.

Blog at WordPress.com.