Functional Programming eXchange

Friday Round-Up: 10 – 14 March

Here’s what you may have missed at Skills Matter this week!

fpx_blog_post

It has been a very exciting and busy week here at Skills Matter, with three days of In The Brain talks, meetups and the first conference of the year – The Functional Programming eXchange! Many thanks to everyone who came along to Skills Matter HQ, and if you missed out, be sure to check out the Skillscasts below!

Alberto Brandolini kicked of the week with an In The Brain on different approaches of domain complexity, and how they can help teams to understand, frame, and master the problems and solution space, enhancing collaboration with the domain experts and the stakeholders, all while keeping some fun involved!

The London Ruby User Group came with three talks, the first by Andy Appleton with a short story about the problems he and his team at GoCardless faced with modelling state and recording state changes. Derek Hill, steered away from Ruby, highlighting the key to market yourself as a developer. And finally Ismael Celis discussed a series of custom-made infrastructure components.

Thomas Kristensen and James Henderson joined the London Clojure community to run through the underlying principles behind propagators using the extensible “proaganda” Clojure library. James followed up from his talk at the ClojureX in December, about how the ideas and patterns presented went on to influence Clidget.

The London Java Community with Victor Grazi took a look at a series of animations that visualise the functionality of the components in the java.util.concurrent, covering Executors, Phaser and all kinds of Locks and synchronizers the new StampedLock and Fork Join.

London Ajax were also here, where Steve James explored the architecture of GenieConnect. Steve, who works for GenieConnect, ran through its’ usefulness as well as its’ drawbacks, discussing his personal experiences with the architecture which led to some interesting findings.

Finally, on the eve of the Functional Programming eXchange, the Functional Londoners were joined by Scott Wlaschin. Scott introduced a popular topic discussing ways you can use types as part of a domain driven process, using real world examples in F# that could be understood by everyone.

The Functional Programming eXchange 2014!

This years FPx was a great success, with eight talks covering everything from the practical theory of language-integrated query to wrapping an imperative API in a functional one, and some fantastic topics in between.

You can view all the Skillscasts here.

While It’s Compiling: Skills Matter Interviews Scott Wlaschin

While It’s Compiling is a series of interviews with experts across a range of bleeding-edge technologies and practices, exclusive to Skills Matter. Be sure to subscribe to this blog for future interviews, or follow us on Twitter.

Find out who we’ll be interviewing next and get a chance to put your questions forward with our hashtag #whileitscompiling.


scott_square_300This week on While It’s Compiling, we talked to Scott Wlaschin. He is a consultant at FPbridge.co.uk, creator of and blogger on F# for Fun and Profit, and the author of Understanding Functional Programming. Scott will be giving a talk on Railway Oriented Programming at the Functional Programming eXchange 2014.

1. What attracted you to Functional Languages in the first place?

I like languages that have simplicity, elegance and power, and are fun to program in. Many years ago, I spent a lot of time using Smalltalk, which is one of my all time favourite languages, and until recently languages like C# and Python were my main focus. I am also a fan of static typing, so when I discovered that I could get the power of static typing in a low ceremony functional language like F# (thanks to type inference), I was thrilled.  Also, like many people, I was frustrated with the bloat of modern OO programming and all the buzzwords that you had to learn. I was working towards breaking my code into much smaller, immutable pieces anyway, but the standard OO languages did not make this easy – whereas this approach was naturally suited for FP.

2. What are you working on?

Most of my recent work has been on standard enterprise software: services, e-commerce, supply chain, etc. I am convinced that FP is not just for academics or scientists, but has a vital role to play in what I call “Boring Line Of Business Applications”. Recently I have set up a FP consulting company (fpbridge.co.uk) to focus on training in this area. I am also working on a book, “Understanding Functional Programming”, which approaches FP from a non-academic point of view.

3. Do you work in only FP languages, or does the project you are working on have some FP code and some OO/Procedure code? If so, how do they fit together?

I work in a mixture of C# and F#. They work extremely well together. Don Syme and the F# team have done a fantastic job integrating F# into the .NET and Visual Studio environment. Most businesses are reluctant to fully commit to a functional language, so the functional stuff does tend to be around the edges; testing, utilities, analytics, and so on.  However, some projects have been purely in F#, and these are attracting attention for being faster to deliver, higher quality, and lower maintenance than the equivalent C# projects.

4. What is one piece of advice you can give to new programmers?

To paraphrase Doug Englebart, programming languages are tools to augment your intellect and help you solve problems. So, you should add as many tools to your tool chest as possible! Learn a variety of different programming paradigms using the “purest” language possible; e.g. learn OO using Smalltalk, FP using Haskell, logic using Prolog, stack-based using Forth/Factor, etc. This will expand your horizons and help you appreciate the bigger picture. If you stick with only mainstream languages (C# or Java, say) you will end up with a narrow (and boring) vision of how programming languages can help you think. Also, as part of this journey, you will discover that people from 30 or 40 years ago had a lot of insight and wisdom. Don’t overlook their ideas just because they are old!

5. What would you like to ask the community?

I think the FP community is doing well right now — there is a lot of interest from newcomers and in general the community is very welcoming. However, I would ask the community to appreciate that as FP becomes more mainstream, it will also have to become less pure and academic.  We shouldn’t scare newbies off by insisting that they have to understand monads and all the other scary terminology before they can be productive. What other things could we do to lower the barriers to entry?


What can we do to make Functional Programming more accessible? Tweet us at #whileitscompiling or @skillsmatter 

Scott will be giving a talk on Railway Oriented Programming at the Functional Programming eXchange 2014.

fpx-2014-1000x300px

While It’s Compiling: Skills Matter interviews Bodil Stokke

Bodil Stokke

While It’s Compiling is a series of interviews with experts across a range of bleeding-edge technologies and practices, exclusive to Skills Matter. Be sure to subscribe to this blog for future interviews, or follow us on Twitter.

Find out who we’ll be interviewing next and get a chance to put your questions forward with our hashtag #whileitscompiling.


This week on While It’s Compiling, we talked to Bodil Stokke; a frequent conference speaker in the fields of Functional Programming and internet technologies, and co-organiser of three annual developer conferences in her home town of Oslo. We caught up with her to discuss what she’s been up to in the Functional world.

1. What attracted you to functional languages in the first place?

It was a gradual process. Python used to be my main language back in the 90s, and coming from things like C++ I approached it mostly through its OO capabilities. I’d been aware from the start of Python’s Functions being first class, but it took me a while to realise the implications of this. A few years in, I was so attached to the idea of first class functions that I couldn’t do without them.

This, along with industry trends, led inexorably to Javascript. Eventually, it led to Node replacing Python as my go-to runtime for personal projects. And, as all things Node must, it led to so much frustration I decided enough was enough and I was going to start using a real Functional language. This led to spending a few days learning the basics of Haskell—and even that brief exercise changed my perspective on programming forever. I ended up spending the next three years with Clojure, but knowing even a little Haskell makes you a better programmer in any language, especially another functional one. Clojure very effectively highlighted what in my mind is the core value of Functional Programming: structuring code through composition, not the peculiar OO notion of inheritance. These days, though, I’m less interested in Functional programming than I am in exploring the idea of type systems. Clojure and Haskell both seem dull in comparison to things like Idris.

 2. What are you working on?

I’ve got a long running project exploring programming language design where I’m trying to build a modern typed Lisp, called BODOL. I spend a lot of time evolving my Emacs setup, and have an ambition to turn Emacs into a proper desktop environment, so I can use it for absolutely everything. And for a living I write Javascript game engines using various Functional compile-to-JS languages, the goal being to reduce the time spent building each individual game to as close to zero as possible. Functional languages are fantastic for this, because they excel at abstraction in a way traditional OO can’t hope to rival.

3. Do you work in only FP languages, or does the project you are working on have some FP code and some OO/Procedure code? If so, how does that fit together?

 I try to avoid non-functional languages when possible, and when I do have to write actual Javascript, I do it in a strictly Functional style, even to the point of employing immutable data structures whenever I can. Mutable state is Satan’s handmaiden.

4. What is one piece of advice you can give to new programmers?

Two things stand out. First, read the paper “Out of the Tar Pit” by Moseley & Marks, or all your code will be awful and you won’t know why. Second, always ask yourself, “would Dijkstra have liked this?”

5. You’ve recently moved to London – have you experienced much of the FP community in the UK capital yet?

One of the reasons I moved here in the first place was the amazing Clojure community. The Haskell community is even more amazing—not so much because they’re great people (too early to tell, though I’m sure they must be) but because where else in the world do you regularly get almost 100 people attending a Haskell meetup?

6. What would you like to ask the community?

When will there be a London Idris Meetup?


Are you up to organizing a London Idris Meetup? Tweet us at #whileitscompiling or @skillsmatter 

Bodil will be giving a talk on how to Build Your Own LISP for Great Justice at the Functional Programming eXchange 2014.

While It’s Compiling: Skills Matter interviews Kevin Hammond

KevinHammond

While It’s Compiling is a new series of interviews with experts across a range of bleeding-edge technologies and practices, exclusive to Skills Matter. Be sure to subscribe to this blog for future interviews, or follow us on Twitter.

Find out who we’ll be interviewing next, and get a chance to put your questions forward with the hashtag #whileitscompiling.


It’s the third round of While It’s Compiling and we’ve had some time to chat with Kevin Hammond. Kevin is a Professor at the School of Computer Science, University of St. Andrews where he also leads the Functional Programming research group. He is also an Honorary Professor at Heriot-Watt University, Edinburgh and his main interests are in cost modelling, real-time parallelism and embedded systems.

1. What attracted you to functional languages in the first place?

I took a summer job rewriting a novel lambda calculus reducer (using spine order reduction) before starting my PhD. I actually started my PhD looking at logic languages as part of an Alvey project, but decided that Functional Languages had advantages in simpler reduction order, and had fewer compromises in purity than Prolog. This was important for maximising parallel performance (due to an administrative error, my thesis was originally about “decorative” programming languages, but I hope we now have languages that are practical as well). After finishing my PhD I moved over to Glasgow where I wrote the first Haskell compiler (pre GHC) including a parallel implementation for the GRIP multiprocessor, working with Simon Peyton Jones, Phil Wadler and John Hughes amongst others. That was a very heady mix!

2. What are you working on?

All kinds of things. I lead a very active research group at St Andrews that is investigating worst-case execution time for lazy languages, static analysis, real-time functional programming, types for parallelism, security through dependency, patterns of parallelism, implementations for heterogeneous (CPU/GPU computation), functional financial computations.

One big current project that I’m running, ParaPhrase, has 13 partners in 8 European countries and aims to develop clean functional patterns of parallelism for both Erlang and C/C++. Partly you can see this as a stealthy way to get more functional ideas into the C++ community.

3. Do you work in only FP languages, or does the project you are working on have some FP code and some OO/Procedure code? If so how does that fit together?

I’ve partially answered that above. As a language implementer, the internals of our systems tend to be very complex and often low-level. I have, for example, written microcode, needed to deal with assembly language/machine code in a very intimate way, used C or other languages for runtime systems implementation, linked with code written in various languages etc. I even at one point had to build some prototype hardware using a wire-wrap tool. If I’m doing something high-level, I much prefer to use a functional language such as Haskell, since this lets me express my ideas quickly, concisely and usually with few or no errors. As an example, the first version of the Hume compiler was written in about a fortnight.

The front end (in Haskell) took one week, and the runtime system (in C) took another week. Over 95% of the bugs were in the (much simpler) back end. I find Java (which I’ve been using since 1995) to be a very awkward level: too low level to let me code quickly and abstractly, too high level to let me get easily at the machine details, and the libraries are often rather poorly written/documented, which I find very frustrating.

One thing that horrifies some of my collaborators is that I tend to write simple Haskell programs (a few hundred lines) without any type signatures at all, using the type inference system to deal with any mistakes. I wouldn’t recommend this for production code, but it’s good for really fast prototyping.

4. What is one piece of advice you can give to new programmers?

Don’t make it too complicated! Gratuitous use of advanced language features may seem cool, but can be murder to understand, debug and change. Good code is clean, clear, easy to understand, but still abstract and generic. Oh, and syntax is important: the most heated arguments about the Haskell design related to syntax rather than semantics; and the single most contentious issues was comments. I think we did a reasonable job there.

5. Do you see the increased interest in FP in industry reflected in your students interest in FP?

Yes, but it takes time for changes to be reflected in the curriculum and we need to get the message through to both students and faculty (who can be surprisingly conservative). One way to feed this through is by running advanced Masters courses with direct industrial links that can then pull through from the undergraduate level. If anyone is interested/willing to help with this, I’d love to get in touch!

6. What would you like to ask the community?

What are the key remaining obstacles to wider spread adoption of functional techniques, and how can we work together to break these down/create new opportunities?

Also, please consider applying for one of our eight 7th Century PhD studentships (and/or tell anyone who might be interested). They’re open to students of any nationality, and have a deadline of March 31st. Please contact me if you’re interested in applying.

Know how to break down the obstacles to a wider adoption of Functional techniques? Tweet #whileitscompiling or @skillsmatter

Kevin will be speaking at the Functional Programming eXchange 2014 about ParaForming: Forming Parallel Functional Programs using Refactoring   

Tickets are available at Skills Matter

fpx-2014-1000x300px

 

Functional Programming eXchange 2012 @skillsmatter

Image

Today Skills Matter brought to the London developer community our third annual Functional Programming eXchange.  This one day, one track conference featured talks, open-space discussions and brainstorming on the latest ideas, best tools, and best practices in scala, clojure, haskell and F#.

Did you make it along?  Leave a comment and let us know what you thought of it!  Even better, you could write a blog post about it and leave a link to your post in the comments — we’ll Tweet about it in return.

If you aren’t in the UK, not in London, or just couldn’t make it, that’s OK.  We know nobody’s perfect.  Luckily, as with all our events the talks were recorded — all credit to our talented Skillscaster, Satyajit Saha, who has worked tirelessly to record and upload them faster than you can say “object-oriented”.  See below for links to the talks:

David Pollak on Visi.Pro bringing functional programming to the masses

Erik Hesselink on SilkApp: A Case Study in Creating Rich Internet Apps in Haskell

Loic Denuziere on FPish: leveraging F# and WebSharper in a large-scale web application

Kevin Wright on Akka at Zeebox: A case study

Andres Löh on Haskell for embedded domain-specific languages

Tomas Petricek on F#’s Type Providers In Depth

John Stevenson on Clojure made simple

Robert Rees on Who uses Clojure and why?

Bruce Durling on Clojure and Incanter for the Professional Programmer

and when you’re done with that goldmine of Functional Programming knowledge, you can see some photos from today’s eXchange here.