URL micro languages.

Silly, fun, idea from a sleepless moment last night:

This really doesn’t have anything to do with del.icio.us, but I’ll use it as an example. Consider this URL from del.icio.us:

   http://del.icio.us/tag/forth+language (try it?)

That URL returns a list of the links bookmarked at del.icio.us which have been tagged with both “forth” and “language” by one of the users.

The phrase “forth+language” in there is pretty much the extent of the query language provided by delicious (well that’s not really fair).

Meanwhile I’ve been shopping for a calculator and remembering with fondness an old programable stack based HP calculator.

So that’s the silly idea. Why not support a stack based query language for systems like delicious.

   all          -- push's the set of all bookmarks
   "forth"      -- push the tag "forth"
   query        -- pop 2, push set of forth bookmarks
   "language"   -- push the tag "language"
   query        -- pop 2, push final set.

We have two operators used there, all and query. All pushes the set of all bookmarks. Query takes a tag add a set of bookmarks off the stack and returns a subset of those bookmarks that contain that bookmark.

We might pack that script into a URL, using underscore to denote tag literals.


The fun thing is adding more operators on the bookmark sets. Operations for popularity, user, intersection, etc. etc. Operations that configure the output formating would be another class of fun. Like all good micro-languages the key is to stand on some really big data types, in this case that’s data type is set-of-bookmarks, since that allows a small set of operators to do big useful things.

Systems, like this one, that reveal a micro-language for the use of an untrusted population have abuse problems. Lots of schemes for managing that risk exist. For example: limiting the resources you provide to a given query or actor. Preflight analysis of the program etc.

Of course if you micro-language is sufficently micro you can write optimizers and lazy evaluators and other fun stuff.

So the fun idea here is to reveal tiny micro-language APIs to web sites using in a style like this.

0 thoughts on “URL micro languages.

  1. Robin

    Interesting… I’ve been looking into wiki_pipe and xmlrpc interfacing lately to provide many small web services. Using reverse polish notation (like the hp-48 did) sounds promising 🙂
    ps, your mysql link on the right under “thanks!” is leading to php.net.

Leave a Reply

Your email address will not be published. Required fields are marked *