Saturday, September 11, 2010

Introducing Go

I think that for many of those from the climate change blogs, Go is a new language that will be needed for this project. In this post, I will introduce the basic concepts of the language. I will point out however that the best place to learn more about this language is through their website (in particular the tutorial and the effective go page). Also some of the blogs on the blog roll have some particularly good articles about Go, especially Andrew Gerrand's blog.

Go was developed at Google and released as an open source development in November 2009. The designers (Robert Greisemer, Rob Pike and Ken Thompson) have quite a pedigree and many were excited just by the fact of who designed the language. Since then, a strong community has grown around Go and many people are finding that it is quite powerful and expressive.

Some of the basic features are that it doesn't have classes like C++, but you can create methods attached to c like structs. This allows some of the functionality of objects, without the complex type heirarchies. In the same line of thinking, there is no inheritance in Go. There is an interface declaration however, that allows similar constructs to be built and yet be quite simple to use as well.

Another feature of Go is it's Concurrency constructs. It has a keyword to launch a small lightweight thread of execution. This is called a goroutine and it allows a parallel thread of execution (see the go site for details of it's implementation). Go also has a channel type in order to pass information between various goroutines.

The interesting part about goroutines and channels, is that it allows a programmer to define very concisely the work needed to be done by any given goroutine, and also defining it's interaction with other goroutines through the channels. The real strength of these concurrency constructs is they provide a manner to logically describe the work that needs to be done. I'll try to add some examples applied to some GCM calculations and how these constructs can link together to be very powerful.

There are a few aspects of go that could be troublesome for this project however. Go is a Garbage Collected language. Generally I think this is good, especially in a concurrent language like Go, however there are some issues related to high performance calculations where it could be a nuissance. It will be something to pay attention to and I'm hoping to get some help from the current Go community to tackle these issues.

Another issue (right now) is that go's support for windows is not complete. While there has been some great strides, the best bet to run Go is to run it on Linux or Mac. This is being actively worked on by the Go community and I'd expect it to improve rather quickly. I'm quite hopeful that by the time there is any meaningful coding happening on GoGCM, the windows support will be a non issue.

I'm certain there will be other issues as the project moves forward, however I truly believe that the benefits of Go outweigh the issues. I'm looking forward to learning more about Go as others get their feet wet and take on the various challenges for this project. I encourage those who want to learn go to look at the documentation on their website and to engage the go community. I think you will find it well worth the effort.


My next post will be in the next day or two and will discuss the strategy of GoGCM. How will the design be fleshed out, how it will be compared to other GCM's (will it be baselined to an existing model) and what will it try to achieve.

Friday, September 10, 2010

Introducing GoGCM

I have been interested by two subjects recently. Climate Change and the Go Programming Language. This blog is a combination of these two interests. I want to start a project to create an open source General Circulation Model (GCM) in Go. The obvious questions are, why a GCM and why Go?

Why a GCM?

There has been much interest in "citizen science" of late in the climate change blogosphere. There have been many global temperature reconstructions over the past several months. I think efforts like this are extremely valuable and that more should be done, especially in order to improve our understanding of (or increase our confidence in) an important issue such as climate change.

In this light, I want to start a project in order to create an open source GCM. This blog will have a series of posts that discuss various aspects of GCM's and how to implement it in GoGCM. I think GCM's are often misunderstood and these posts (while trying to design this GCM) will shed some light on how GCM's work, and what they can/can't do.

While the main audience of this blog will be "citizen scientists" (eg. Engineers, Programmers and other technical persons interested in Climate Change), I am hoping that some of the Climate Experts will contribute in some form (commenting or guest posts) from time to time.

Why Go?

Since it was released in November 2009, I have been following the development of the Go Programming Language. My first reaction was, if you take a few interesting languages and strip the interesting parts out, you get Go. Since then, I've been looking more and more at this language, and I have been extremely impressed. While the feature set seems basic on first inspection, it is quite expressive. Andrew Gerrand had two posts (part 1 and part 2) that demonstrates this nicely.

I think the Go Programming Language represents an important innovation in programming. In particular, it's ability to reduce bookkeeping and focus on the important parts of code are remarkable. While many in the "citizen science" climate community have been relying on R for the analysis of the temperature reconstructions, I believe a project like this requires something more substantial.

The other option would be using directly the source code provided by current GCM's (GISS and NCAR for example). While this option likely has a better chance of success (a GCM that actually runs), developing GoGCM will force all aspects of the GCM to be investigated. This means that the GCM's will be understood more by the community that I hope this blog fosters.

The final reason I chose Go, is that I am optimistic about the Go Programming Language. I believe it could be an important general programming language in the future. By trying to create GoGCM (especially with a vocal "citizen science" community), I'm hoping to attract dozens of new Go programmers, particularly those who are interested in scientific programming like I am.

Going Forward

I'll be laying out some of basics rules for how this site will work and try to start some technical threads for the basic design decisions. As well, I'll be setting up project page (likely github) in which I will post the code. I look forward to any feedback.