RSS

Category Archives: FunctionalProgramming

One year with “Haskell Programming from First Principles”


My relationship with the Haskell programming language, my efforts to learn it had its ups and downs throughout the years. According to my memory and the archives of my blog, my first attempts had been around 2005 – 2006, more than 12 years ago. Back then, apart from a few books written by university professors, and some Wiki-based books, I couldn’t find much high quality material for beginners. Therefore, my efforts didn’t last very long. A few years later, I heard the news about a new book, “Real World Haskell” being written. I was excited once again, I even made a few comments here and there as the book was being written. Unfortunately, life happened, and I couldn’t spend much time on that nice book, too. Fast forward to the end of 2015, and I was working at a company in Ghent, Belgium where there were some Haskell experts, trying out things in an industrial storage system development environment. The teams that I was part of had nothing to do with Haskell though, my daily job was almost always about Python, Bash, ActionScript, Java, and some Scala. Nevertheless, being in such an environment rekindled my curiosity, and I decided to look around to see if there was some new Haskell books targeted at people who didn’t use this language before. Luckily, I’ve heard about the book “Haskell Programming from First Principles“, and I decided to give it a try. Therefore I bought the book, and started to read and study it in the beginning of 2016. Since Haskell was not at all used in my daily job, I could study the book only in my spare time, therefore it took me about 1 year to finish the book, doing most of the exercises. Read the rest of this entry »

Advertisements
 
 

Tags:

How and Why is Scala Used in Aerospace Industry?


There’s been a recent thread in scala-user e-mail list that touched an interesting topic: How and Why is Scala Used in Aerospace Industry?

A few highlights from the thread:

* Scala and Akka are currently used for spacecraft telemetry data display, storage and analysis for European Space Agency. The software is used for all missions at GSOC (the Columbus Module of the ISS, the SAR earth observation satellites TerraSAR-X/TanDEM-X, and some other missions) and for LEOPs at Eutelsat.

* DLR GSOC ( http://www.dlr.de/rb/en/ ) will be using Scala and Spire for space mission planning. The next generation of the GSOC scheduling engine PLATO (http://www.dlr.de/rb/en/desktopdefault.aspx/tabid-6816/4256_read-6303/) is currently being written in Scala.

* Scala is also used for telemetry analysis at JPL (NASA’s Jet Propulsion Laboratory), and more generally for development of modeling DSLs. We are part of a research lab (Laboratory for Reliable Software), which works in close interaction with missions.

* Rüdiger Klaehn’s words: “I am absolutely convinced that functional programming (meaning not just a language that has closures, but programming using almost exclusively with pure functions) is the correct path to reliable software. The most ubiquitous and accepted platform in space operations at DLR and in general in european space operations is the JVM. Even the next generation European Mission Control system (MCS) is going to be written for the JVM: http://www.egscc.esa.int/system.html. So you need a functional language that runs on the JVM and can seamlessly consume JVM libraries. This leaves Scala and Clojure as serious contenders. Since I favour strongly typed languages, the choice was clear.”

Some reasons given by programmers that chose Scala for aerospace industry software: Read the rest of this entry »

 
1 Comment

Posted by on December 22, 2014 in FunctionalProgramming

 

Tags:

Functional Programming in Scala: The most advanced Scala and functional programming book for the working programmer


bjarnason_cover150It is safe to say that “Functional Programming in Scala” by Chiusano and Bjarnason can be considered the most advanced Scala programming book published so far (in a sense, it can be compared to SICP.). Half of one of my bookshelves is occupied by Scala books, including Scala in Depth, but none of them takes the concept of functional programming as serious as this book, and pushes it to its limits that much. This, in turn, means that most of the Java programmers (including very senior ones), as well as Scala programmers with some experience should prepare themselves to feel very much like a newbie again.

But why the need for such a book, and what’s all that noise about functional programming? Here is my favorite description of functional programming given by Tony Morris : “Supposing a program composed of parts A, B, C, D, and a requirement for program of parts A, B, C, and E. The effort required to construct this program should be proportional to the size of E. The extent to which this is true is the extent to which one achieves the central thesis of Functional Programming. Identifying independent program parts requires very rigorous cognitive discipline and correct concept formation. This can be very (very) difficult after exposure to sloppy thinking habits. Composable programs are easier to reason about. We may (confidentally) determine program behaviour by determining the behaviour of sub-programs -> fewer bugs. Composable programs scale indefinitely, by composing more and more sub-programs. There is no distinction between a ‘small’ and a ‘large’ application; only ‘smaller than’ or ‘greater than’.”

The description above not only points at the core idea of functional programming and why that is important, as well as useful, but also draws attention to the fact that getting used to functional programming design can be difficult for people who are not used to thinking that way. Fortunately, “Functional Programming in Scala” is here to fill a huge void in that respect.
Read the rest of this entry »

 
Leave a comment

Posted by on September 13, 2014 in FunctionalProgramming

 

Tags: ,

Java 8, Lambda Expressions and the Psychology of the Masters of the Universe (devoxx style)


A quick quiz: Take a look at the words / phrases below and tell me in what kind of talk can you hear them?

scary, scared, lazy, don’t want to scare, risk, risky, ivory tower, functional, real life, scary, no functional, reality, customers, complex

Those are some of the words I remember from the keynote given by Mark Reinhold and Brian Goetz, and titled “Java 8 and Beyond” at Devoxx 2013 conference. And I think this fact shows the real and biggest difference between designing a programming language and marketing one.

Let me explain: Devoxx, which does not need much introduction, is the biggest Java conference in Europe, including anything related to Java, JVM, Android, languages running on JVM (and even Microsoft, this year). Close to 4000 Java developers, as well as team leads, and software project managers come together from all over the world for 5 days. And just like Devoxx, Brian Goetz, one of the keynote speakers, does not need much introduction: He is a Java and concurrency expert, having written one of the best books in this field, and  serving many JCP Expert Groups and working at Oracle as the Java Language Architect. In other words, when a heavyweight Java expert such as Goetz gives a keynote at a conference such as Devoxx, and talks about the upcoming version of Java 8, and stressing features such as lambda expressions and streams, thousands of developers do listen, and they listen very carefully.

So far, so good. But there is one thing surprising. Some of those developers, I, for example, feel like listening to the aspects of human psychology and the finer points of marketing to the masses, albeit technical masses. The reasons I felt like that can be summarized as the following:

devoxx_java8_1 Read the rest of this entry »

 

Tags: , , , , , , , , , , ,

Lisp and statistics


As I was browsing the blog of Incanter, a statistical computing and graphics environment for the JVM, I realized a couple of Lisp related statistics articles and software:
Read the rest of this entry »

 
 

Direniş Kırıldı: O'Reilly Bir Lisp Kitabı Çıkarmaya Hazırlanıyor – Lisp Outside the Box


Daha önce burada bahsetmiştim O’Reilly ve anti-Lisp politikasından. Tekrar alıntılayalım http://oreilly.com/oreilly/author/writeforus_1101.html adresinden:

Books on topics that have dismal sales despite quality books being available. (If you’re addressing a topic where good books have sold dismally in the past (for instance, LISP, LaTeX, or Web-based training), you have a much higher threshold to clear with your proposal. Convince us why there is a revival of interest in your topic, or why your approach to a deadly topic will provoke interest nonetheless.)

Aynı yayınevi O’Reilly fikir değiştirmiş görünüyor. MIT’de birkaç ay önce düzenlenen (ve benim de katılıp bir sunum yapma zevkine eriştiğim) International Lisp Conference ’09 etkinliğinin ardından yayınevinden bir editörün bazı teklifler sunduğu haberi geldi ve sonunda Lisp camiasının aktif isimlerinden Nick Levine bu işi üstlenmeye karar verdi ve Lisp outside the box kitabını yazacağını duyurdu. Kitabın resmi web sitesi http://lisp-book.org/ duyuru metnini de alıntılayalım:
Read the rest of this entry »

 

Tags:

The Second Answer Set Programming Competition – Call For Participation


The Second Answer Set Programming Competition

Call For Participation

K.U.Leuven, Belgium, spring 2009

http://www.cs.kuleuven.be/~dtai/events/ASP-competition/

The second ASP competition is a Modeling and Solving competition open to all declarative problem solving systems from areas such as ASP, SAT and CP. In the competition, both satisfiability problems and optimization problems need to be solved. Each team submits a solver and modelings for all benchmark problems. These are used to solve a number of instances of each benchmark problem. The solver that solves the most instances wins. The results will be published in the Tenth International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR’09). For more details on the format of the competition, see the webpage.
Read the rest of this entry »