Handling and Compositing complex side effects in Clojure with Sanity

At Helpshift, we face managing complexity of these side effects which touch 10s of different systems. Each side effect poses a failure scenario which can lead to it's own business decision. Compounded failures pose even more complexity. To add to the problems we extending the codebase to add new business logic regularly.

I will present a solution which is a combination of Clojure and FP following techniques. We will also discuss how ideas when combined together can create an elegant solution,

1. Data - Side effects definition as data

2. Almost no syntax - Minimal definition

3. Many functions for one DS - Multiple execution and failure recovery modes for side effects

 
 

Outline/Structure of the Talk

  • Introduction to Clojure and how we do side effects
  • Some patterns that emerged at Helpshift when doing side effects
  • All patterns lead to a singular problem of Mudball collecting state
  • A solution using simple constructs
  • It's usage patterns and how it's better than previous patterns
  • How it survives the test of production woes
  • Alternatives which provide similar solutions and comparisions

Learning Outcome

  • It is totally possible to tame the Mudball of state that get's in the way mostly while doing IO. In the process we learn of the different patterns of doing IO and computations.

Target Audience

Clojure or FP practitioners

schedule Submitted 3 weeks ago

Public Feedback

comment Suggest improvements to the Speaker

  • Liked Aaron W Hsu
    keyboard_arrow_down

    Aaron W Hsu - Programming Obesity: A Code Health Epidemic

    45 Mins
    Keynote
    Beginner

    Programs are getting fat. They're becoming slow. They're taking up more computing resources. They're getting harder to maintain and more complex from the ground up. Layer upon layer of sophistication is causing us to lose our ability to predict what software will do. Where's that bug? Why is everything going so slowly? Am I even using the right data structures? Where's that important point in the documentation again?

    What's happened to us? In this meta-dive into the nature of our approach to programming, we will explore some of the dangers of our current approaches to programming and the how/why of our current programming obesity problem. We will look at real case studies and see just how bad the situation can be.

    But we will also explore how we can battle these sources of obesity. In this passionate plea for code that we can gain control over again, we will look at examples of how we can return to a state of high-performance on all levels, from code size to code scalability. We will look at the principles that can help us to reach leaner, more efficient, more usable, less buggy code. We will hopefully find some light at the end of the tunnel, and how we can change our outlook on programming to push ourselves towards code that benefits not only ourselves, but also those that will come after us.

  • Liked Anne Ogborn
    keyboard_arrow_down

    Anne Ogborn - Introduction to Logic Programming and SWI-Prolog

    Anne Ogborn
    Anne Ogborn
    Software Engineer
    Hasura.io
    schedule 3 weeks ago
    Sold Out!
    480 Mins
    Workshop
    Beginner

    As machine learning matures, it is becoming obvious that we need explainable solutions. As functional programming matures it becomes obvious that we need inference and nondeterminism. And linked open data demands reasoning. This all day workshop will introduce the logic programming paradigm, in which programs are expressed as a set of logical rules and executed by finding proofs of queries.

    SWI-Prolog is the most highly developed and widely used language for logic programming.

    The language, which has been in continuous use in academic research settings since it's invention in 1972, provides unparalleled power. Many problems which would be difficult to express in other languages are simple in SWI-Prolog. SWI-Prolog is a 'batteries included' modern language, ready for real world tasks like web development and process control.

    In this dynamic hands on workshop we'll learn the basics of SWI-Prolog, and look at some of the amazing things it can do.

  • Liked Nikhil More
    keyboard_arrow_down

    Nikhil More - Do you OOP in Elixir?

    Nikhil More
    Nikhil More
    Sr. Engineer
    Volansys
    schedule 4 weeks ago
    Sold Out!
    20 Mins
    Experience Report
    Beginner

    One of the strategies being adopted by RoR or Java software developers in adopting Elixir is they have not yet adapted themselves to unlearn the OOP in developing the web systems. This has caused OOP concepts to creep into full fledged Elixir systems. This presentation seeks to highlight these subtle points that need to be avoided to make the code more FP and less OOP.

  • Liked Sandesh Soni
    keyboard_arrow_down

    Sandesh Soni - Build Tetris Game with Elixir and Phoenix LiveView. Full day workshop.

    Sandesh Soni
    Sandesh Soni
    Full-stack developer
    Formulae.io
    schedule 3 weeks ago
    Sold Out!
    480 Mins
    Workshop
    Beginner

    Phoenix LiveView provides ability to build web application without any custom javascript.
    You can write all the code on Backend server and the connection is alive and stateful.

    In this workshop, you will build Tetris App in Elixir and Phoenix LiveView. The aim of this workshop is give more hands-on Elixir experience and cover various functions and syntax.

  • Liked Aditya Giri
    keyboard_arrow_down

    Aditya Giri - Elixir and WebAssembly

    Aditya Giri
    Aditya Giri
    Student
    University of London
    schedule 3 weeks ago
    Sold Out!
    20 Mins
    Talk
    Beginner

    WebAssembly is one of the new technologies around the block that has vast areas still to be explored. I'd like to give a talk explaining what the WebAssembly is, what are the possibilities that you can cover with the help of WebAssembly, how does Elixir and BEAM VM fit into the equation and how to interoperate between Elixir and WebAssembly.

  • Liked Sandesh Soni
    keyboard_arrow_down

    Sandesh Soni - build Tetris without single line of javascript code. My experience using Elixir & Phoenix LiveView

    Sandesh Soni
    Sandesh Soni
    Full-stack developer
    Formulae.io
    schedule 2 weeks ago
    Sold Out!
    45 Mins
    Case Study
    Beginner

    I will share my experience how I built this Tetris game without writing a single line of custom javascript code. All the code is written in Elixir and Phoenix LiveView.

    I have implemented this web-app here http://tetris-kachori.gigalixirapp.com/

  • Liked Suvrat Apte
    keyboard_arrow_down

    Suvrat Apte - How debuggers work in Lispy languages

    Suvrat Apte
    Suvrat Apte
    Backend Engineer
    Helpshift
    schedule 3 weeks ago
    Sold Out!
    45 Mins
    Talk
    Intermediate

    Debuggers are one of the most essential tools for any kind of development.

    Debuggers in Lispy languages make use of Lisp's homoiconicity. They are a bit different from debuggers for languages like C or Java.

    This kind of information is usually not needed in day to day development and hence it remains hidden.

    In this talk, I will take Clojure's cider-debug as an example and explain how it uses homoiconicity. Along with cider-debug, I will also talk about REPLs and how REPL client-server communication happens (with nREPL as an example).