Introduction to Concurrency in Haskell
Haskell is widely known as a functional programming language which is great to write pure (non I/O) code and immutable data structures. But it is not well known that it has a great support for a wide variety of concurrency models too.
In this talk we shall explore the various concurrency models and primitives supported by Haskell including green threads, mutable variables, channels and software transactional memory. We shall see how the purity, laziness, and the strong type system of Haskell come together, and help write clean and modular concurrent code. We shall explore these by writing a mutli-user chat server with support for private and channel chatting.
Outline/Structure of the Demonstration
- Demo of the chat server, then walk through the code while explaining the following
- Threads
- Mutable variables and using them for inter thread communication
- Go style channels
- Asynchronous exception handling
- Software transactional memory: transactional variables and transactional channels
- High level design of concurrent programs in Haskell
Learning Outcome
The audience will learn about the various concurrency models and primitives in Haskell and how to use them well to design concurrent programs.
Target Audience
People interested in writing backend concurrent programs in Haskell
Links
Code for the chat server on github
Previous talks:
ReactJS workshop in Meta Refresh 2015
"A taste of Clojure" talk in DevCamp 2010
Reference text:
schedule Submitted 5 years ago
People who liked this proposal, also liked:
-
keyboard_arrow_down
Morten Kromberg / Jay Foad - Array Oriented Functional Programming with Dyalog
480 Mins
Workshop
Beginner
Dyalog is a modern, array-first, multi-paradigm programming language, which supports functional, object-oriented and imperative programming based on an APL language kernel. During the morning and early afternoon, Dyalog's functional language guru John Scholes will introduce the fundamentals of functional programming in APL. At the end of the day, Dyalog CTO Morten Kromberg will round off with an application development session, showing how a simple web application with a HTML5/JS front-end and a RESTful web service can be used to deliver the power of APL to end users, or as embeddable components for other application tools. The "hands on" sections of the workshop can be followed under Mac OS X, Linux, or Microsoft Windows.
-
keyboard_arrow_down
Tanmai Gopal - Haskell In Production
45 Mins
Experience Report
Intermediate
From the perspective of one of the few companies in the country using Haskell in production (hasura.io), we will talk about the journey of using Haskell as a programming language to build and maintain real world software.
From the burden of choosing a language that probably has a single digit number of active developers in the country, to
the joys of a small team churning out code that just keeps on working.
We'll go over how we created a team, organized work ("software development practices"), architecting code, tooling up, testing, performance tweaking and finally deploying a Haskell codebase. We hope that Haskell developers with some prior experience will be able to take away
something new about the Haskell ecosystem, and those interested in just functional programming will see tangible value in how certain features unique to Haskell have an impact.
Expect a case study, a review of some cutting-edge tools and how to use them, and some Haskell code samples that will make you grunt in geeky approval. -
keyboard_arrow_down
Akshay Gupta - Modeling a game with melody recognition and machine training using ClojureScript and real instruments
45 Mins
Demonstration
Beginner
Being great at a first-person shooter game requires a lot of hand-eye coordination and skill with the mouse. Being great at an MMORPG requires a working knowledge of a vast variety of keyboard shortcuts. Being great at a fighting game requires speed and skill with the gamepad.
The underlying philosophy behind this experiment is to showcase that you can potentially take the input to any stringed instrument (with a pickup) lying around in your house, to use to design a game that requires as much skill (if not more) as playing any other game with any other kind of input device. By treating the instrument as a game controller, and moving the onus of deriving quality from the playing into the system, we can harness some of the basic qualities – speed and melody – of the instrument to make our game more interesting and a lot more unique and fun.
The idea is to go as far away from being a Guitar Hero derivative as possible, and closer to a system that treats it as just another input device. The game should not be about playing guitars or any kind of music, but should be about playing any other regular game. Unlike other Musical Instrument Games™, we want ours to work for anyone, anywhere. So we're going to use a simple semi-electric guitar plugged into the microphone line-in and demonstrate this on the browser using the Web Audio Interface.
We'll go through a few papers and look at implementing some of the algorithms to pitch / note detect in near real-time, process the input to make sense of it, run it through a few simple constraints and algorithms to recognise what a melody might be like and eventually explore how we can make the system intelligent enough to train itself based on the player and the styles so that we can generate smarter and harder levels for our game. -
keyboard_arrow_down
Ravi Mohan - Building a General Game Playing Engine with OCaml and Erlang
90 Mins
Experience Report
Beginner
"General Game Playing is the design of artificial intelligence programs that play more than one game" Wikipedia [1]
In other words, one program has to be able to play (and win!) multiple games ( Chess, checkers, Go, Othello etc).
Summary: This experience report is about my "Forever Project" [2,3,4] to build such a system in OCaml, and the problems (theoretical and practical) and will include a demo of the program, warts and all.
Detail: GGP is an active CS research area [5]Annual competitions are held every year where ggp programs compete against each other[6], playing games which they have never seen before (the rules are supplied as an input file for the system to consume five minutes before the match begins).Over the last year, in my non-existent spare time, I've been building a GGP engine to compete in a GGP competition.
Most such engines are written in Java, C++ etc.. I'm using OCaml for the game playing agent, and Manoj is building the backend in Erlang.As mentioned above this is our "Forever Project" We've made some decent progress.
Come, see, laugh, jeer!
-
keyboard_arrow_down
Nivedita Priyadarshini / Srihari Sriraman - Building an Experimentation Platform in Clojure
Nivedita PriyadarshiniSoftware DevelopernilensoSrihari SriramanPartner, Engineernilensoschedule 5 years ago
45 Mins
Experience Report
Intermediate
Here's a markdown version of this proposal: https://gist.github.com/ssrihari/1cad915e7ef22ce61b54
Over the last year and half at Staples SparX, we built a multivariate testing platform as a service. It satisfies an SLA of 10ms at 99.9th percentile, services all of Staples' experimentation from a single machine, is simulation tested, and is written in Clojure.
We'll give an introduction to the Experimentation domain, design of experiments and our battle in attaining statistical significance with constrained traffic. We will share our experiences in loading and reporting over months of data in Datomic, using Clojure to grow a resilient postgres cluster, using a homegrown jdbc driver, interesting anecdotes, and OLAP solutions with ETL built in Clojure using core.async. Expect to see references to google white papers, latency and network graphs, histograms, comparison tables and an eyeful of clojure code.
-
keyboard_arrow_down
Srihari Sriraman - Carnatic music synthesis in Clojure
45 Mins
Demonstration
Beginner
Here's a markdown version of this proposal: https://gist.github.com/ssrihari/b25ddda331ec220663de
I'm building a carnatic music (south indian classical music) synthesizer using Clojure and Overtone. Here's the library I'm building.
Carnatic music is different fundamentally in the movements of pitch ('Gamakams'), and needs to be modelled differently than most MIDI music out there today. The library now, can understand prescriptive carnatic music notation, build finer abstractions from that, and play back a not-so-terrible synth version with a plethora of configurable inputs.
The concept of 'Gamakam' (the transitions between notes) is central, so I'll go into it's guts and show how the library piggybacks on recent work on PASR (pitch-attack-sustain-release) and Dual-PASR ('stage' and 'dance' PASR components) transcriptions. I'll also put forth a path I see for fully synthetic carnatic music based on machine learning 'Ragams' (melodic modes).
I'll give a detailed demo of the synthetic music on the repl through the talk, and do a live voice vs synth comparison in the end.