GIGO: words unreadable aloud
Mishrogo Weedapeval
 

 

  Friday 5 January 2007
quarkup and quirkywiki in Scala

A couple of years ago, I came up with yet another wiki markup syntax. I called it "quarkup". I intended (and, I suppose, still do intend) to use it in a home-grown wiki + weblog setup that I'd like to write in Scala. I wrote a quarkup-to-HTML translator in Python, as one of my first fully test-driven developments. It was fun to do and it worked out well.

So now I'm translating it into Scala. I start to get a feel for three different kinds of changes I have to make.

  1. I have to be explicit about a variable's type sometimes. Overall, this is an improvement. Sometimes, it leads to a radical simplification of the function I'm working with, because giving the type a name makes it more clear to me what that function is doing.
  2. Some missing features (e.g., the lack of optional parameters) have also led to minor simplification.
  3. Some stuff remains slightly painful (so far, what hurts most are string manipulation and literal array creation).
That simple triumvirate of "def", "var", and "val" is IMHO a brilliant distinctive feature of Scala. The "var"/"val" distinction is like a lightweight form of Haskell's heavyweight way of separating mutable state from pure (or assign-once) values, or of Java's heavyweight "final" keyword.
12:59:39 AM   comment/     


Click here to visit the Radio UserLand website. Click to see the XML version of this web page. © Copyright 2007 Doug Landauer .
Last update: 07/2/6; 12:49:52 .
Click here to send an email to the editor of this weblog.

January 2007
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Dec   Feb

Previous/Next