Functional programing with Scala and GRIFIN
I took an online course on “Functional programing with Scala” given by professor Odersky from the Ecole Polytechnique Federale de Lausanne (EPFL) in Switzerland - the author of Scala himself. Here are some stats about the course. There are several reason why I bother to write about it.
Firstly, I do not remember learning so much about programing in two months time period. The course certainly requires determination, time and focus to pass, but the effect was better then my expectations.
That comes to the second point that quality of the course is superb. I was expecting solid ground quality from the lectures by Odersky, but the content of the assignments, selection of tools and instructions for their setup, and their submission-evaluation-grading mechanism for the assignments - that made my jaw drop. Especially when I learned this single course drew an astounding 50,000 registrants worldwide! It is more than twice the number of all students currently studying at AAU, where I was developing and teaching master-degree courses myself for few years. The functional programing style is clean and scalable - that attracted me to the course. Now the course leans on Scala as the functional programing technology, Scala is designed by Odersky, and Scala was used for the management of the course, which makes the course itself a beauty. It is so compact, self referencing, and proving itself capable that you end up convinced about the power of what you have learned.
The third reason is that I have been using Scala for GRIFIN Shell for about two years.
The main original reason was that it provided GRIFIN with an interactive interface with JVM, which could help relaxing the fact that geospatial computation and its connection to information systems gets very easily (and very often) drawn in large blocks of Java, C or Fortran code. I still believe Scala can help with that. But there was also this “functional bonus” which, they say, could make GRIFIN to be much easier for the domain geniuses to both write and troubleshoot a software that keeps up with the new multiprocessor hardware. Designing and running geospatial models is a lot about dynamic cases with many different actors at static or changing positions influencing each other over time, which in computer science terms leads to a multi-threaded software. As Odersky says: “If you want to write a multi-threaded application now it’s still nightmarishly difficult. There are lots of mistakes that are hard to detect. We have to make programming these kinds of applications feasible for everyone, not just experts and that is very hard.” Hard that is indeed, but Scala (hopefully) tackles that. What I know by now is that Scala successfully mixes functions and objects; it resolves multiple inheritance problem; has effective type inference; and works seamlessly with JVM. That is a list that makes it altogether both an original and an impressive technology for me.
Most relevantly, however, this makes Scala a seemingly perfect match for the user-level creation of contents for GRIFIN using GRIFIN Shell.
Intel hosts Dr. Martin Odersky presenting Scala 2.10 from Typesafe on Vimeo.




