schedule Dec 15th 04:00 PM - 04:45 PM place Crystal 2 people 14 Interested

Easy concurrency is one of the main prophesied benefits of the modern functional programming (FP) languages. But the implementation of concurrency differs widely between different FP languages. In this talk, we shall explore the methods and primitives of concurrency across three FP languages: Haskell, Erlang, and Clojure (with core.async).

We shall learn about and compare the trade-offs between

  • the green threads and STM channels oriented concurrency of Haskell
  • everything-is-a-process and message-passing actor pattern of Erlang
  • macro-based state machine code transformation of Clojure/core.async
 
6 favorite thumb_down thumb_up 0 comments visibility_off  Remove from Watchlist visibility  Add to Watchlist
 

Outline/structure of the Session

  1. Threads and Green Threads - 5 min
    1. OS threads as basics of concurrency
    2. Green threads as cheaper alternative to OS threads
  2. Locks, Channels and Messages - 5 min
    1. Inter-thread communication with shared memory
    2. Lock for synchronization
    3. Channels and messages as extension of locks
  3. Actor Model - 8 min
    1. What are Actors in Erlang
    2. Mailboxes and message passing
    3. Memory layout of actors
  4. Software Transactional Memory (STM) - 8 min
    1. What is STM in Haskell
    2. Blocking and retries in STM
    3. STM based channels
  5. State Machine Transformation - 8 min
    1. Deep walking macros in Clojure
    2. Transforming to Static single assignment form
    3. core.async channels
  6. Actor Model vs. CSP (Communicating Sequential Processes) - 5 min
  7. Q&A - 5 min

Learning Outcome

  • Audience will learn and understand the various methods of implementing concurrency in functional programming languages.
  • Audience will become familiar with pro and cons of different concurrency models.
  • Audience will be able to make right choices when using FP for implementing concurrent programs.

Target Audience

People who are interested in learning and implementing concurrent programs in functional programming languages.

Prerequisite

No prerequisites of knowing the languages used in the talk as this talk does not focus on language syntax much. However, the audience must have familiarity with the basics of concurrency primitives like threads, locks and schedulers.

schedule Submitted 3 months ago

Comments Subscribe to Comments

comment Comment on this Submission

  • Liked Srihari Sriraman
    keyboard_arrow_down

    Srihari Sriraman - Generative Testing Patterns

    Srihari Sriraman
    Srihari Sriraman
    Partner, Engineer
    nilenso
    schedule 3 months ago
    Sold Out!
    45 Mins
    Talk
    Intermediate

    Tests are good. Generative tests are better. But we don't write them often enough. Why not?

    Generative testing isn't new; John Hughes' QuickCheck is now implemented in 30 languages. Yet, it is still not an every day tool for most software teams. Why not?

    I have seen that maintaining a generative, or simulation testing suite can require the full-time attention of a few senior engineers. And over time, the tests become complex, brittle, ineffective, and hard to diagnose.

    But isn't generative testing supposed to make testing simpler, and more effective?

    I believe that it requires a rather different paradigm of thought from what we're used to with traditional testing. And recognising this paradigm shift can help us leverage it effectively.

    I'll discuss a holistic perspective of generative testing to elucidate this thought paradigm.

    Using a practical scenario, I'll discuss the patterns that emerge from this thinking, and how they address the concerns of making generative tests more effective, and maintainable.

  • Liked Nitin Misra
    keyboard_arrow_down

    Nitin Misra - Background Processing in Elixir with GenStage

    Nitin Misra
    Nitin Misra
    Product Engineer
    Scripbox
    schedule 2 months ago
    Sold Out!
    45 Mins
    Talk
    Intermediate

    We recently started working on a new Elixir project and had the need for a background processing system.

    We decided to build our own background processing system in Elixir.

    This talk describes why and how we built our own background processing system in Elixir.

    How we use Elixir's GenStage package for adding back-pressure between the producer and consumer stages and how we add support for custom rate-limiting between several pipelines.

  • Liked Kiran Gangadharan
    keyboard_arrow_down

    Kiran Gangadharan / Udit Kumar - The Road to a Masterless Multi-node Distributed System in Elixir

    45 Mins
    Talk
    Intermediate

    In this talk, we will cover our journey from the base to the summit of a masterless multi-node distributed system in Elixir. We’ll talk about the challenges faced, decisions made and how they shaped/evolved the architecture.

  • Liked Govind Krishna Joshi
    keyboard_arrow_down

    Govind Krishna Joshi - DSLs for Free

    Govind Krishna Joshi
    Govind Krishna Joshi
    Engineer
    nilenso
    schedule 3 months ago
    Sold Out!
    45 Mins
    Case Study
    Intermediate

    DSLs allow us to express our code in verbs and nouns that describe our domain. This helps keeping business logic clean of implementation specific details, and allows for more readable code. Few languages have support for easily defining DSLs, for example macros in clojure/lisp, metaprogramming in ruby, but these techniques are not portable to other languages. Free monads is a way to convert a functor into monads, and allow us to create a structure for our desired computation, which can be interpreted later. This also allows us to decouple the definition of a DSL from its interpretation. In this talk we explore the use of Free monads to easily define DSLs and their interpreters.