Bits and Pieces

by Zef Hemel

First of all, I got my “TOEFL”:http://www.zefhemel.com/archives/2004/11/09/test-of-english-as-a-foreign-language exam results. I scored 250 (out of 300), which is not bad. I needed 213 to be admitted to Trinity, so that will do.

Second, two very busy weeks are coming up. At the end of this week I have to finish up an article about handwriting recognition and a column for my communication skills class (heh, I mistyped that as communication kills before). Then, thursday and friday I got a “Software Variability Workshop”:http://www.rug.nl/informatica/onderzoek/programmas/softwareEngineering/SVM2004 (site not up ATM). That weekend we celebrate “Sinterklaas”:http://en.wikipedia.org/wiki/Sinterklaas (like Christmas, with presents) with my dad’s family. Then next week I’ll have new assignments for my communication skills class (possible a debate) and we also have to submit our paper for the student colloquium. That weekend we celebrate Sinterklaas with my family here in Groningen.

So it’s going to be a very busy two weeks. Therefore I’ll either not post at all or much less. Just so you know.

JotSpot

by Zef Hemel

A couple of weeks ago I first heard of “JotSpot”:http://www.jot.com. JotSpot is yet another wiki implementation, yet tries to take the wiki to the next level, by extending it to a “developer platform”. Its main way to do this is trough adding structure to pages, which in wikis traditionally have been free-form.

On the basis JotSpot is a nice wiki implementation which allows WYSIWYG(What You See Is What You Get) editting. What makes it more interesting is that it allows you to define forms. These forms can be applied to pages and makes them fit the format of the form that is applied to it. For example, if you want to collect personal information on your wiki, you might want to create a Contact form with fields like: name, address, telephone, e-mail and website. When you now create a new wiki page named ZefHemel and apply the Contact form to it, the form will show up and ask you to fill in the fields. Now that your data is more structured, you can show it in nice tables and do other stuff with it.

JotSpot also comes with some nice built-in tags. Using these it is possible to include Google search results on the person’s name when viewing a contact. JotSpot makes it very easy to create simple data-centric applications. Want a simple customer system? It’s just a couple mouse clicks and couple lines of code away. You can enrich it with some RSS feeds and Google searches.

If you don’t understand a word of what I’m saying (and I won’t blame you), a movie tells more than a thousand words. You can find a “27mb flash movie with a demo here”:http://weblog.infoworld.com/udell/gems/jot2.swf.

I wonder how far the JotSpot guys can take this, what are the limits of what you can do with this?

Related links:
* “JotSpot website”:http://www.jotspot.com
* “How JotSpot compares to old-style development”:http://www.jot.com/compare/index.php
* “InfoWorld: Wiki startup JotSpot draws crowd for product beta”:http://www.infoworld.com/article/04/10/28/HNwikibeta_1.html

UML Virtual Machine

by Zef Hemel

For a class I’m taking I’ve been reading a couple of papers on runtime generation of classes. You need this if you don’t know upfront how many classes, or even which classes you’ll need. There are a couple of solutions for this problem. Most interesting is the “UML Virtual Machine”:http://www.riehle.org/computer-science/research/2001/oopsla-2001.html.

By now you’ll have heard of virtual machine. A virtual machine is a program that reads a program written in some low-level intermediate format and executes it (or translates it to native machine code of the underlying platform and then executes it). A Java virtual machine, for example, executes the Java bytecode that the Java compiler generated.

The UML virtual machine executes “UML models”:http://www.omg.org/uml/. UML stands for Unified Modelling Language and is a set of methods to visualize software designs. The most well-known of these methods is the class diagram which looks something like this:

But there are many kinds of diagrams, including ones to model behavior in some situations. UML is used as a specification and communication tool. In a usual software project there’s one or more architects that first specify how the application will work and how the different parts will be working together. After this architecting phase is done — resulting in a specification — the programmers will use this spec to implement the actual product. Managers don’t like seeing code, they like images. That’s why UML can also be used to show managers how the software will be organized and how it will work. So UML is a communication tool aswell.

The UML Virtual machine sort-of eliminates the implementation phase. It will just take the UML diagrams and execute them. Just like that, no code generation or anything. As of now this UML VM still has its restrictions. UML is a modelling language and not all behaviour can be specified unambiguously (without multiple interpretations), therefore in some cases logic still has to be written in a programming language like Java and plugged in. Still, I think it’s an interesting development.

You can find the “full paper here”:http://www.riehle.org/computer-science/research/2001/oopsla-2001.html, but I’ll warn you upfront: most of it is about the implementation of this virtual machine, which isn’t like grade-school math.

Mixing Blogs and Wikis

by Zef Hemel

Starting since I discovered Wikis I’ve got the feeling that there should be a good mix possible between Wikis and blogs. The problem I have with my blog is that once the days pass, your post will “disappear”. They won’t really disappear, but just end up in the archive, which nobody is going to look at anyway. A solution I came up with is maintaining one post with some of the bigger articles in the articles section of my website. But it’s not really satisfying. Some posts don’t really fit the blog post format.

“Martin Fowler felt the same”:http://www.martinfowler.com/bliki/WhatIsaBliki.html:

I’ve been watching the blog scene develop for a while, and it’s impossible to not want to join in. But there are things I’m not so keen about blogs. For a start the name, as my colleague Mike Two puts it, “blog sounds like something I should pay a physician to remove”. Beyond the name, however, there’s the very ephemeral nature of blog postings. Short bursts of writing that might be interesting when they are read - but quickly age. I find writing too hard to want to spend it on things that disappear.

I have similar mixed feelings about wikis. I like the way they allow you to quickly put stuff together. But they can easily lead to long rambling sites. And I do like the fact that blogs make it easy to see what’s really changed recently - thanks to the hooks into RSS and aggregators.

So I decided I wanted something that was a cross between a wiki and a blog - which Ward Cunningham immediately dubbed a bliki. Like a blog, it allows me to post short thoughts when I have them. Like a wiki it will build up a body of cross-linked pieces that I hope will still be interesting in a year’s time.

His solution is called a bliki, you can find his “here”:http://martinfowler.com/bliki/.

Sometimes I want a place that I use to dump information and links on. I want others to be able contribute to that also. And easily link to it from my blog posts. Wikis are good for that. What I’m looking for, is a system that does both well. I’ve been looking at “TikiWiki”:http://tikiwiki.org, but that looks like overkill (and that’s an understatement). It’s a still a Wiki, but decorated like a christmas tree.

I’ll see if I can figure out a nice solution for this.

Sergey Dmitriev, of JetBrains, the company that develops the Java IDE “IntelliJ IDEA”:http://www.jetbrains.com/idea/, wrote an article on Language Oriented Programming. According to Sergey, the current programming paradigms are seriously flawed and we need a new one.

The question Sergey asked himself is why it is so that you can explain a solution to a problem to a programmer in an hour or less and it can take weeks to explain the solution to a computer. The answer, according to Sergey, is that our solution description has to fit the syntax and instructions of a language the computer understands. This instruction set usually is quite small and for many reasons that’s good; if you have to use a programming language that’s as complex as natural language, people won’t be happy. Instead, programmers tend to lean towards general purpose programming languages. These languages are not good at anything in particular, just moderately good at mostly everything. What we have to do is reformulate our solution to terms that the compiler of that general purpose language understands. This is like explaining something very specialistic to a laymen: you can’t use any terminology and shortcuts, because the layman won’t understand them. The consequence is that you need a lot more words and time to make it clear.

It’s the same with programming languages. That’s why we should work with Domain Specific Languages (DSLs). These languages contain all the “terminology” and shortcuts for that particular field and therefore a solution can be made clear much faster and effective. Take SQL(Structured Query Language) for example. SQL is a DSL. With SQL we can formulate very complex queries with just a couple of lines of code. Imagine having to do that with a general purpose language like C. It’ll be a lot more work. Each area of speciality has its own language and way of describing things, therefore they also need their own DSL. “Language” should not be taken too literally here. In some occassions a textual representation simply isn’t suitable. GUIs, for example, today are often described in code, even though they are completely visual. It would be much more obvious and efficient to draw GUIs visually (and many IDEs already offer a “language” for this; which they call a form designer).

The solution Sergey proposes is Language Oriented Programming (LOP). The idea is that you first design a programming language for a particular part of your problem solution and then use that language to describe the solution. Because writing compilers and designing languages until now never has been an easy job, a simpler method has to be figured out. Sergey shows a fairly simple way to do this. It’s not easy to describe it in a couple of sentences, so if you’re interested you can read his paper. Once you’ve developed the language that you’ll be using, a language that allows you to express yourself in the way that suits your solution, actually describing the solution is a much faster process.

Sergey is already working on an implementation of this sytem, called “Meta Programming System”:http://www.jetbrains.com/mps/ (MPS). Once released, this system (which will be part of IntelliJ IDEA) will come with three predefined languages. One imperative one, which contains the usual control structures, variables, operators etc. The second is a collection language. This language is targeted at using and manipulating collections (such as arrays and hashmaps). The third one is a language for defining graphical user interfaces.

I think it’s a very interesting idea. There are two things that I think are vital for this to succeed:
* Languages really should be very easy and fast to design. If this takes too much time, it’ll be faster to just use a general purpose langauge.
* The languages should be able to collaborate nicely. The concepts used in different languages can be completely different. There should be a way from a database manipulation language to get data from the GUI written in a GUI language.

I’m looking forward to actually seeing something like this in action.

You can find the “whole article on LOP here”:http://www.onboard.jetbrains.com/articles/04/10/lop/index.html.

I’m really tired (had a long day), so I’ll only reiterate the difference between free software and open source today. Mainly because I’ve heard some people mixing them up here and there, not realizing there’s a fundamental difference between them. I described this difference in “Free Software, The Religion”:http://www.zefhemel.com/archives/2004/08/12/free-software-the-religion, but if you don’t feel like reading that much text, I’ll briefly mention the main differences.

Free Software is about freedom, not price. They think it’s evil to put any kind of restriction on the use of software. Well, nearly. You should be able to modify it, distribute it, use it in your own free software but it should remain free software and copyrights still apply. According to the FSF(Free Software Foundation), free software is the only ethic kind of software. If you develop proprietary (non-open) software, you’re evil. It’s as simple as that. The FSF’s main license is the “GPL”:http://www.gnu.org/copyleft/gpl.html. The GPL is a tool to spread free software. The FSF is a political movement, not a practical one.

The open source movement in contrast sees open software as the best way to develop software. Many eyes see more than just a couple. Therefore more bugs are found and the software is of higher quality. Being allowed to modify the code, distiribute it and reuse is something that’s convenient. They don’t necessarily think proprietary software development is evil, just that the open source way is a better development paradigm, and many companies are starting to see that. The open source movement is more of a practical movement than a political one. Being an open source developer doesn’t mean you don’t have the FSF’s believes. Open source just isn’t about political statements. All the stuff licensed under a GPL license is considered open source. Licenses like the “BSD”:http://www.opensource.org/licenses/bsd-license.php one (which also allows you to use code in prepretary software) are open source licenses aswell.

My opinion is simple. I do not share the view that proprietary software is evil and don’t see why all software should be open to everyone. And it’s not ignorance, I’ve read “Free as in Freedom”:http://www.amazon.com/exec/obidos/tg/detail/-/0596002874/103-8935409-7422208?v=glance and really tried to understand the reasoning behind it. I just don’t share the beliefs. I don’t like the zealot vision that free software has. That’s also why I’m not a big fan of the GPL; because it’s a tool to spread free software. Open source, on the other hand, I do like. I see many occassions where a more open development style is useful. And hey, sometimes it’s just handy to have the source code so you can adapt it to better suit your needs.

There’s an interesting project at sourceforge called the Java Syntactic Extender. If you always thought that some control structures were missing in Java, like a proper foreach loop or built-in property support, this is your chance to add them.

“The Java Syntactic Extender”:http://jse.sourceforge.net/ allows you to add your own keywords and control structures to Java. Some “examples”:http://jse.sourceforge.net/examples/index.html:

  • unless(expression) { … }, which executes the piece of code unless the expression is true (so it’s like if(!(expression)) { … })
  • property, for example:
    class Bean implements Serializable {
      public property String firstName = "Tom";
    }

    which will generate a setFirstName(…) and getFirstName() method for this field.

  • foreach, for example:
    List l = ...
    foreach (String s in l) {
      doSomething(s);
    }

    which is nice way of writing:

    List l = ...
    for(Iterator i = l.iterator(); i.hasNext(); ) {
      String s = (String) i.next();
      doSomething(s);
    }
  • enum, for example
    public enum Colours red, blue, green, yellow;

    Which will create a class called Colours that has the enumerated constants red, blue, green and yellow each of type Colours. All generated enumerated type classes are Serializable and Comparable. These last two, of course, are only useful if you use a version of Java which is older than 1.5, as 1.5 has support for enumerated types and has a kind of for-each statement (slightly different syntax).

I doubt how useful this really is as code is harder to distribute with other people. They would need the same Java language extentions. But still it’s fun to play with on a rainy sunday morning.

You can find more information on “The Java Syntactic Extender”:http://jse.sourceforge.net website.

Next Page »