Functional Programming eXchange experience report

You can become a serverless blackbelt. Enrol to my 4-week online workshop Production-Ready Serverless and gain hands-on experience building something from scratch using serverless technologies. At the end of the workshop, you should have a broader view of the challenges you will face as your serverless architecture matures and expands. You should also have a firm grasp on when serverless is a good fit for your system as well as common pitfalls you need to avoid. Sign up now and get 15% discount with the code yanprs15!

I attended the Functional Programming eXchange 15 last Thursday and it was a thoroughly enjoyable day.

Don’t worry if you weren’t one of the lucky 100 or so that made it, most of the talks are available online on SkillsMatter’s website, and here’s a high level summary of a couple of the talks.


Games and 3D Graphics in Arcadia

Tim Gardner started the conference with an awesome talk on Arcadia, a live coding environment for Clojure targeting Unity3D.

Throughout the talk, Tim demoed the power of Arcadia – being able to interactively modify a virtual world in Unity3D live, by writing Clojure code in a REPL (which is then compiled to MSIL using ClojureCLR).

And just to show how far you can push it, Tim did the entire demo in an Emacs window inside the Unity3D world it’s manipulating, which is projected onto an Oculus Rift headset. Why? Because you could! 

Jokes aside, it is rather impressive, and as Claudia mentioned in a conversation with Tim afterwards, the ability to script the scene itself is very valuable. Being able to drag-and-drop and click a few boxes here and there to edit things is great but very soon you realise you need automation as the number of objects in the scene grows, and that could be the gateway drug that gets Arcadia through the door.

Another interesting feature of Arcadia is the ability to serialize and save the current state of the scene, though Tim didn’t demo this so I don’t know how it works in practice. One caveat (that has caught many people out including myself..) with Unity3D is that whilst in play mode, changes you make to the scene are lost when you go back to edit mode.

Which is frustrating, because even though you’re able to learn and discover about the virtual world you’re building by being inside it and interact with and modify it as we go, we’re not able to keep the result of our tinkering and experimentation. You could painstakingly note down or remember every change you have made and then reapply them back in the edit mode, but remember we can only keep around 7 items in our head at a time.

As things stand, the play mode is more of a tool for validating your grand design, but it’s capable of being so much more. If there’s one thing I’ve learnt from Bret Victor, is that, creators need to see rapid feedbacks from their ideas. So if Arcadia is able to save and load the current state of a world then that’d a massive deal for me.  


Watch the talk here.


The lazy programmer’s guide to writing 1000’s of tests : An introduction to property based testing

This is a new talk from Scott Wlaschin on property-based testing with FsCheck. As ever, you can expect Scott’s usual blend of great humour and insightfulness.

In this talk, Scott gave a gentle introduction to property-based testing, and then outlined some techniques for choosing properties to test (which is usually the hard part when you first start writing property-based tests), and finished off by introducing model-based testing too.

I strongly recommend this talk, and you might also be interested in checking out these two posts by Scott too:

 A colleague of mine was so inspired by this talk, that he told me afterwards he plans to rewrite all of his unit tests for our payment gateway with Python’s adaptation of QuackCheck – Hypothesis!  


Watch the talk here.


Build your own effects

In this talk Jeremy Yallop demonstrated a way to manage side-effects using a new feature in OCaml (which should be available in the next major version) called effects. In traditional stack-based model, when an exception occurs the rest of the stacks are thrown away as the exception is captured and bubbled up: fpx15 This is the same with CPS (continuation passing style) code too.

Essentially exceptions is a way to short circuit program execution (either intentionally or unintentionally). All exception can tell you is that ‘something has gone wrong’, it’s a very limited one-way conversation.

With effects, you not only get the information about the effect, but also the rest of the stack as a continuation, so we can instead model resumable exceptions like the following:

(the above is constructed based on my recollection and syntax from this paper, so it’s likely not accurate, but should still give you a flavour of what you can do)

You can also easily model other effects, such as:

  • dynamic binding, e.g. when you detect an unbound variable, perform an effect whose handler would
    • binds a default value for the variable in the current context and;
    • invoke the continuation
  • yield and concurrency as described in this paper
  • state monad where state updates are performed as an effect

The big advantage of this approach is that it simplifies composition of different effects.

With Haskell’s monads for instance, this is done through monad transformers which is limited to a specific pair of monads and adds another layer of complexity.

With effects, you just add a clause in your match…with statement to handle a new effect alongside other effects and you’re done!


Unfortunately this talk was not recorded, but you can still get a flavour by looking at some of the examples in this paper.


Due to other commitments this weekend, I’m not able to cover the other talks here, but you can still watch them here.

All the talks were pretty good and worth watching, and if you’re looking to champion the adoption of functional programming in your organization then you should definitely watch Michael Newton’s talk – Functional Programming in an Imperative World. Michael presented lots of anecdotes from his experience promoting F# at 15Below. I saw another good talk on the topic by Jay Fields at QCon London this year on how he pushed the adoption of Clojure at DRW Trading, which is sadly not available on InfoQ yet but you can watch an older version of the talk here.


Next stop : NDC Oslo this week where I’ll be doing two talks on Wednesday:

  • A tour of the language landscape – a whirlwind tour through some of the languages on the fringe of mainstream and look at interesting ideas I have learnt from them, including Go, Rust, Erlang, F#, Elm, Clojure and maybe Idris
  • Modelling complex game economy with Neo4j – a case study of how we used Neo4j at Gamesys Social to model our MMORPG game Here Be Monsters, and used this model to help automate the process of balancing the game economy



Liked this article? Support me on Patreon and get direct help from me via a private Slack channel or 1-2-1 mentoring.
Subscribe to my newsletter

Hi, I’m Yan. I’m an AWS Serverless Hero and I help companies go faster for less by adopting serverless technologies successfully.

Are you struggling with serverless or need guidance on best practices? Do you want someone to review your architecture and help you avoid costly mistakes down the line? Whatever the case, I’m here to help.

Hire me.

Skill up your serverless game with this hands-on workshop.

My 4-week Production-Ready Serverless online workshop is back!

This course takes you through building a production-ready serverless web application from testing, deployment, security, all the way through to observability. The motivation for this course is to give you hands-on experience building something with serverless technologies while giving you a broader view of the challenges you will face as the architecture matures and expands.

We will start at the basics and give you a firm introduction to Lambda and all the relevant concepts and service features (including the latest announcements in 2020). And then gradually ramping up and cover a wide array of topics such as API security, testing strategies, CI/CD, secret management, and operational best practices for monitoring and troubleshooting.

If you enrol now you can also get 15% OFF with the promo code “yanprs15”.

Enrol now and SAVE 15%.

Check out my new podcast Real-World Serverless where I talk with engineers who are building amazing things with serverless technologies and discuss the real-world use cases and challenges they face. If you’re interested in what people are actually doing with serverless and what it’s really like to be working with serverless day-to-day, then this is the podcast for you.

Check out my new course, Learn you some Lambda best practice for great good! In this course, you will learn best practices for working with AWS Lambda in terms of performance, cost, security, scalability, resilience and observability. We will also cover latest features from re:Invent 2019 such as Provisioned Concurrency and Lambda Destinations. Enrol now and start learning!

Check out my video course, Complete Guide to AWS Step Functions. In this course, we’ll cover everything you need to know to use AWS Step Functions service effectively. There is something for everyone from beginners to more advanced users looking for design patterns and best practices. Enrol now and start learning!