Born-Again Javascript

While most of my coding for fun is in Python, a whole lot of my coding at work is in Javascript. Over the years I have tried many, many frameworks for extending Javascript to add new widgets to the browser, to handle functional-style programming in Javascript, or simply to make the browser DOM easier to use. They pretty much all suck. Much of the suckitude comes from trying to support beasts such as Netscape 4 or IE Mac, neither of which are supported by any sane company these days. Of course, now that Netscape 4 is finally settling into the dim recesses of history where it belongs, we still have all the flavors of IE to plague us. Microsoft does their best work when they are playing catch-up. Everyone predicted that as soon as they were the dominant browser they would stop caring about standards and stop updating their browser in any significant way. Microsoft denied it, but can anyone really say they’re suprised that it’s exactly what they did? Only when Firefox began to seriously erode their “market share” did they reanimate the moribund IE team. I can’t wait to see what kind of nightmares we get when that monster walks out of the laboratory.

Despite all this, I’m still somewhat of a fan of Javascript. It doesn’t get much respect, in part because of poor implementations, and in part because it wasn’t designed to be very modular. It ignores modern concepts such as threading. You could go on for days on the problems of Javascript, and others have, so I won’t. What all this is getting to is that I’m excited about seeing good uses of Javascript in Google Maps and Backpack. I’m going to try using Script.aculo.us to see what I can get away with (using my new fave web framework, CherryPy). And I’m really, really looking forward to what Bob Ippolito is cooking up with his semi-stealth project: Mochikit. Bob has done some amazing work with PyObjC, and Mochikit could well be the Javascript framework I’ve been looking for, complete with documentation and unit tests. I can’t wait.

The Sky is Falling

Is it just me, or has the world gone crazy?

First, Microsoft announces that the next version of Office will use XML file formats as the default. Now, Apple announces that (after all these years of denial) they are moving to Intel chips.

Vuja Dey (Vuja dey is the strange feeling you’ve never been here before).

Years ago I was in Boston for MacWorld and the BeOS developer’s conference when Jean-Louis unveiled BeOS running on Intel processors (because Steve Jobs wouldn’t give Be specs to the PowerPC Macs). Yesterday’s announcement felt a little like that (even a similar presentation, hmmm). Intel is very motivated to have something besides windows running on their chips–they loaned Be a couple of engineers for the port. Of course, BeOS started on IBM “Hobbit” CPUs, then the PowerPC BeBox, then the PowerPC Mac, then Intel, now PalmPilots. OS X started on Intel and wasn’t ported to PowerPC until Apple bought them, so it’s not as much of a stretch. Now if Microsoft started to build stuff on PowerPC, that would be crazy.

Oh, wait, never mind.

The thing that really gets me is that I have to wait another year before I can buy a PowerBook with good battery life which doesn’t sear my lap.

Tidbits

My posts have been infrequent, in part because I’ve been working on lots of things to talk about. I’m in the last stages of putting together info on creating NSStatusItems (tools which show up in the menu bar across all applications in OS X) in PyObjC. I’ve also got some cool Quicktime and iSight tools coming soon. And I’ve renamed ZenPaint to DrawingBoard, but it’s working and just waiting for a little GUI cleanup before I post the first binary and source.

Two of my back-burner projects, better blue-screening, and easy lightsabre effects, have been done by others recently. Inspired by the same BoingBoing piece on rotoscoping your own lightsabres as I was, but Naked Software actually sat down and wrote the code. It’s pretty slick, too. For blue-screen effects (and many more), check out Sam Kass’ Quartz Composer Compositions. Very neat stuff, Tiger-only though [Update: now Leopard]. Some of the compositions require a newer system with a higher-end video card than my three-year-old PowerBook.

But to be honest, the real point of this post is not to tease with coming attractions, but to point out my first paid publication. My friend David Mertz asked me to collaborate with him on his XML Matters column for IBM developerWorks, and my first column went live last Friday: Beyond the DOM.

I’ve wanted to be a writer for as long as I can remember, with poetry notebooks and 200 pages of a novel gathering dust on my bookshelves, so finally getting around to finishing something and having it published leaves me pleased as punch. And more will be forthcoming.

Now we’re cooking!

My copy of the new Python Cookbook arrived today (pretty quick considering my first issue of Make magazine hasn’t arrived yet). It’s pretty cool to see my name in an O’Reilly book, even for only a single recipe. The book looks great too, I think Alex and Anna and David have done a great job and I’m really looking forward to going through it.

Thanks to everyone who replied about the missing word. I’ve been a bit overwhelmed lately and haven’t had a chance to follow up with that, but the responses were all great.

50-Year Language

A post by Patrick Logan on languages, in response to something Bill de hÓra wrote on language and communication inspired me to think some more about the language I’d like to be programming in. If you follow those links you might be interested to know that KIF is the Knowledge Interchange Format, FIPA is the Foundation for Intelligent Physical Agents, and ACL is the Agent Communication Language.

Paul Graham has an essay, The Hundred-Year Language in which he argues, in part, “Unlike physics in a hundred years, which is almost necessarily impossible to predict, I think it may be possible in principle to design a [programming] language now that would appeal to users in a hundred years.”

It’s a hard argument to back up, because we have no evidence in our existing programming languages. Lisp and Fortran are a little over fifty years old at this point, so those are the oldest examples we have to go by. And only Lisp is still gaining new adherents, as far as I can tell. It took Unix over 30 years to begin winning the OS wars, so who knows, maybe Lisp’s time has come.

There are some trends that have been showing up in recent mainstream languages like Java, Python, etc. The ability to handle Unicode for internationalization. Threads for scaling. Making network connections easier, especially for HTTP connections. Various layers of support for HTML.

If we assume that adding these facilities into programming languages is progress, if it is a kind of encapsulation of best practices, or at least making common cases of complex behaviour more accessible (if you’ve ever managed network connections in C you’ll understand what I mean), then what does that say for the next 50 year language? What would a language with the staying power of Lisp look like?

Well, what are the trends and emerging best practices today? Testing is a big one. Designing for testability, unit testing, test-driven development, these are all current buzzwords and for good reason. If Extreme Programming manages to get one idea into the mainstream, test-driven development would be a good one. But certain types of code are very hard to test, and these are some of the code that most needs to be tested. Code that results in persistent state changes (databases) are hard to isolate for testing because by nature they keep changing. Threaded code is hard to test, and multi-process code is even harder. User interfaces are incredibly hard to test well. Web code is difficult to test because you have no control over the environment it runs in–how do you automate a test which needs to run over several versions of several browsers under various operating systems? Performance is difficult to test well, it’s hard to isolate the bottlenecks of code to see where a minimum of effort (and disruption) can make a maximum performance impact.

So, one thing I’d like to see in the language of the future is the language designed for testability. What would a language deigned for testing look like? In part it might look like Eiffel with all the knobs turned to 11.

We can look at some of the most heralded features of existing languages, some mainstream, some more esoteric, to see what else might go into this future language.

  • Scalability [Erlang]
  • Robustness [Erlang]
  • Testability [Eiffel]
  • Flexibility [Smalltalk/Lisp]
  • Support for Little Languages< [Lisp]
  • Native UI [C#]
  • XML as a native datatype [ECMAScript2]
  • Small core language [Ruby/Lua]
  • Web as a core competency [ECMAScript/PHP]
  • Refactorability [Smalltalk]
  • Prototyping [ECMAScript/Smalltalk]
  • Security [What does this now?]
  • Manipulate units as well as numbers [Frink]
  • Able to compile efficiently when needed [Lisp]

The specific languages I chose are meant as examples, and reflect what I have some knowledge of. If I’ve left out Haskell, or Oz, etc., it’s largely because I’m less familiar with them and their benefits. The languages I chose are definitely weighted towards the dynamic end of the spectrum because that’s just the way things are going and I can only see that trend accelerating.

I’ve also mixed up language and libraries a bit freely. This will be one of the axes that languages will be measured on. Python would probably be easier to port to new platforms if the language core were smaller and the standard library could be defined in terms of that core. Lua wins in this regard, if someone wants a small, embeddable language. Some of the list above may be mutually contradictory. Paul Graham theorizes that there will be only a small number of languages in the future, but there will certainly be more than one, depending on the needs of the programmer.

Smalltalk and Lisp are mentioned above as “Flexible” and I should probably mention what I mean by that. In both languages you can create new core language features: operators, flow control, code rewriting, etc. Most languages do not support that level of manipulation (and Java specifically goes to lengths to prevent it).

When I think about what I’d like to see in the next fifty-year language, I call it Rotfl, which comes from ROTFL (Rolling on the floor laughing), which is what a programmming language should lead to. I spend far too much of my coding time in computer-induced Tourette’s Syndrome (i.e., swearing uncontrollably). I want to put the fun back in functions. This is at the core of Programming for the Fun of It. Some people spell Rotfl as Python 3000. We’ll see.

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »

google

google

asus