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

No comments:

Post a Comment