Other languages

February 18, 2007

Homophone joke

Zh
Zachary and Henry, my two boys, like to play the homophone game while waiting for our traditional Sunday breakfast at a local bagel store. Today, Zachary wanted to read his book instead, and came up with a neat way of telling Henry.

Henry: Want to play the homophone game?

Zachary: No.

July 02, 2006

Pluvo

LtU has a link to Pluvo, a language which seems like a cross between Python, JavaScript, Ruby, and Lisp. It has some interesting ideas (coordination is a fun one) and the basic system (written in Python) is currently less than 50k to download.

January 10, 2006

PyCon's Coming to Town

I hadn’t realized it until Jeff Rush sent me an e-mail, but PyCon, the annual Python conference, is going to be held in Dallas at the end of February. It’ll be about 10 miles from where I live. There are some interesting looking sessions (including several on both Django and Turbogears). I might well see if I can dress up like hotel staff and sneak in. If you’re into Python, early-bird registration closes soon, and at $185 ($125 for students), it’s quite a steal.

April 07, 2005

Putting Code in Python Documentation

To continue the thread, Rod Morehead gave me this link to Python doctest, a utility that performs what are almost unit tests on the code fragments in your Python docstrings.

Anyone in the Ruby community feel inspired?

April 06, 2005

Putting Code in JavaDoc

A couple of Ant tasks let you embed both code and sample output in your Javadoc.

Continue reading "Putting Code in JavaDoc" »

March 21, 2005

The State of the Scripting Universe

An interview with Perl’s Damian Conway, Rohan Pall from the PHP community, Guido van Rossum, TCL’s Jeff Hobbs, and myself, about the nature and future of dynamic languages.

Continue reading "The State of the Scripting Universe" »

March 01, 2003

Io, Io, it's Off to Play I Go

Call me slow, but I hadn’t come across the Io language before today. I popped over to its site (www.dekorte.com/software/c/io/) and played for an hour. It seems to have a lot going for it:

  • full OO (like Smalltalk)
  • very simple semantics (even assignment is a message)
  • nice orthogonal structure
  • very compact
  • fast enough
  • different enough to be interesting, similar enough to be easy to learn

You can even get Io T-shirts and mugs at www.cafeshops.com/IoLanguage (what else do you need in a language?).

Io’s objects are generated by cloning existing objects, rather than instantiating classes (so it has some similarity to Self). So I could create a Dog object using something like

  Dog = Object clone
  Dog sound = "woof"
  Dog bark = block( write(self sound, "\n") )

  Dog bark

The first line creates a new object based on Object, assigning it to a slot called Dog. The second creates a slot in Dog called sound and arranges for it to reference the string "woof". The third lines creates an anonymous block (which writes "woof") and assigns that block to the bark slot in Dog. Finally we call it.

We can now create some objects based on a Dog: note that the mechanism is the same:

  rover = Dog clone
  fido  = Dog clone

  fido  bark              #=>  woof
  fido sound = "bow wow"
  fido bark               #=>  bow wow
  rover bark              #=>  woof

Io has differential prototyping: the only slots created in sub objects are those specialized in those objects.

Io has lots of interesting features. It keeps its code lying around in a message tree structure, allowing you to inspect and alter it at runtime (yup, alter. You can write self-modifying Io programs, so I guess adding aspects would be fairly straightforward).

Because it’s becoming a tradition, here’s 99 bottles of beer in Io (taken from the distribution).

  bottle = block(i,
    if(i==0, return "no more bottles of beer")
    if(i==1, return "1 bottle of beer")
    return i asString("%i") .. " bottles of beer"
  )

  for(i, 99, 1,
    write(bottle(i), " on the wall, ", bottle(i), ",\n")
    write("take one down, pass it around,\n")
    write(bottle(i - 1), " on the wall.\n\n")
  )

I’m not sure if Io is a keeper for me. It is certainly interesting, but it has a slightly pedantic feel to it (especially compared with Ruby). But it’s fun to play with.

Now in Beta

  • Programming Ruby, 3rd Edition
    Third Edition, Covering Ruby 1.9, now in beta
My Photo

Site Search

  • Google Search

    The web
    PragDave

Pragmatic Stuff

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from pragdave tagged with pragdave_badge. Make your own badge here.