Wednesday, December 23, 2009

What is this GLoo thing, anyway?

Okay, so you're probably wondering (like I was not long ago) exactly what GLoo is, and what it's useful for. This post will explain the rationale behind the language, and its major design features.

The biggest problem that can arise when designing and developing a software system is translating a solution into code using a language that has little in common with the problem domain. This creates tension when making design choices: should the design translate the solution perfectly, or should the flaws/quirks/deficiencies of the target language allow scope for a more pragmatic approach?

The lack of a "Perfect Programming Language" means that this tension cannot ever be fully resolved, but a big push in recent years is helping to ease the burden.

Domain-Specific Languages (or DSLs for short) are specialised programming languages that are specifically designed to make solving problems in a particular domain easier. These DSLs may lack some general-purpose flexibility, but they usually provide a language that is closer to the problem domain, and thus a closer fit to the original solution.

The domains themselves are very different: one wouldn't (and probably couldn't) write a synthesizer in AWK, or a text processor in CSound.

Enter GLoo. GLoo is a functional programming language based on the LambdaF-calulus, an extension to the Lambda Calculus defined by Alonso Church.

GLoo is a language designed for specifying other languages: you can use it to create your own DSL for the domain of your particular problem. This allows a language to be made to suit any set of problems, from the minute to the huge. In this sense, GLoo is a "problem-oriented" language.

GLoo runs on top of the Java Virtual Machine, which makes it portable. It also has a Java gateway built-in, allowing GLoo scripts to utilise the vast array of libraries, frameworks and tools that have already been written. In addition, JNI allows GLoo to talk to anything with a C binding, broadening the possibilities further.

In the next few posts, I'll work through a fairly trivial (but interesting) example, and we'll define a very basic drawing language. Stay tuned.



Further reading:

GLoo as explained by its creator

Welcome

Hi there, welcome to this programming blog. Allow me a few short paragraphs to explain why it's here, and what it will be about.

I've set this blog up to share some of the experiments and discoveries I've made during a Research Internship I'm currently undertaking at Swinburne University in Melbourne, Australia. I've just completed a BSc (Professional Software Development) there, and was offered an opportunity to stay a little longer to do this short project.

The project involves working with a programming language/framework called GLoo (hence the name of the blog). GLoo is the brainchild of two of my lecturers: Markus Lumpe and Jean-Guy Schneider. I'll explain some of its background (and its quirks) as we go, as my understanding of it and its usefulness increases.

As I'll explain in the next post, GLoo is an experimental language, so you're unlikely to see the next killer app written in it. In order to keep up, some knowledge of functional programming will be very helpful.

I hope you'll stick with me for the ride!