A practical guide to GenStage with a real-life use case.

schedule Nov 17th 05:00 PM - 05:45 PM place Sigma Hall 1 people 3 Attending

Elixir GenStage is a very interesting abstraction (behavior) and can be used very effectively to solve many complex problems that fall under supply-demand/back-pressure scenarios. One can solve such problems by writing minimal amount of code by using GenStage. Come and learn in detail about the wonders of this abstraction with a real-life use case in Warehouse automation.

 
1 favorite thumb_down thumb_up 0 comments visibility_off  Remove from Watchlist visibility  Add to Watchlist
 

Outline/structure of the Session

  • 15 min: What is GenStage abstraction from ground up?
  • 10 min: A real-life use case in Warehouse automation back pressure issue
  • 10 min: Using GenStage to solve such issues
  • 10 min: Wrap up and Q & A

Learning Outcome

Deeper understanding and appreciation of GenStage with a real-life use case.

Target Audience

Every Elixir enthusiast

schedule Submitted 2 months ago

Comments Subscribe to Comments

comment Comment on this Proposal

    • Liked Manuel Chakravarty
      keyboard_arrow_down

      Manuel Chakravarty - Haskell SpriteKit - a Purely Functional API for a Stateful Animation System and Physics Engine

      45 mins
      Demonstration
      Intermediate

      Graphics, animation, and games programming in Haskell faces a dilemma. We can either use existing frameworks with their highly imperative APIs (such as OpenGL, Cocos2D, or SpriteKit) or we waste a lot of energy trying to re-engineer those rather complex systems from scratch. Or, maybe, we can escape the dilemma. Instead of a Haskell program directly manipulating the mutable object-graph of existing high-level frameworks, we provide an API for purely functional transformations of a Haskell data structure, together with an adaptation layer that transcribes those transformations into edits of the mutable object-graph.

      I this talk, I will explain how I used this approach to architect a Haskell binding to the animation system and physics engine of Apple’s SpriteKit framework. I will discuss both how the binding is structured and how it achieves the translation of Haskell side changes to SpriteKit and vice versa, such that it is sufficiently efficient. Moreover, I will demonstrate by example how to use the Haskell library to implement a simple game.

    • Debasish Ghosh
      Debasish Ghosh
      Consultant
      IRadix Inc
      schedule 4 months ago
      Sold Out!
      45 mins
      Experience Report
      Intermediate

      Using a programming language that supports first class functional programming doesn’t necessarily imply that the code you write is functional. Functional programming has the nice properties of being compositional - you design smaller abstractions and then reuse them to build larger ones. You use the power of algebraic properties that these abstractions offer to build larger elements of your model out of smaller ones.

       However often we find that many code bases designed in a functional programming language are inherently imperative, especially when you are using a multi-paradigm language like Scala or Java. There’s nothing wrong with imperative code, but it lacks the niceties of expression based composition that makes reasoning about your code so much easier. Also assignments used in imperative code are inherent side-effects that are best avoided (or at least minimized) in an expression oriented language.

       In this session I will discuss some of my experiences of mining imperative code and refactoring them into functional patterns. You will be surprised to see how much functional goodness can be derived through functional thinking. Algebraic structures like Monoids, Monads and Kleislis are just buried within the reams of imperative statements crying to come out. In an exercise of half an hour we will liberate them and see how the code quality improves from the point of view of modularity, compositionality and simplicity.

    • Liked Aloïs Cochard
      keyboard_arrow_down

      Aloïs Cochard - The Tale of Troy

      45 mins
      Demonstration
      Beginner

      In recent years, the impact of functional programming on mainstream languages has grown significantly.

      After conquering server applications and distributed systems,
      the paradigm is now conquering the fields of web development and data analytics.

      So what remains? The land of system programming.

      When Mozilla did release the language Rust in 2012,
      it did immediately striked interest from functional programming enthusiasts due to it's strong emphasis on safety.

      Even though it currently lacks some advanced features like higher kinded types,
      it is built with functional programming principles as it's core.

      Like a Trojan horse (or the parasite mushroom after the language is named),
      Rust looks like the next C on the outside... while it might actually be closer to Haskell on the inside!

      Let's take a tour and discover an other side of system programming by learning together how to do functional programming in Rust.

    • Liked Calascibetta Romain
      keyboard_arrow_down

      Calascibetta Romain - Git under the hood with OCaml

      Calascibetta Romain
      Calascibetta Romain
      Independent
      OCaml Labs
      schedule 4 months ago
      Sold Out!
      45 mins
      Demonstration
      Intermediate

      Git is one of the most popular tool for a developper and a part of the power of Git is come from some functional concepts. So, it's obvious to implement the Git format with OCaml!

      This talk will present the functionnal concepts of Git (like the immutable tree) and show a practical implementation with OCaml step by step. Then, we will explain how can scale an OCaml code to compute a huge Git repository and understand by this way the power of OCaml (and the mix between the functionnal and the imperative way).

      At the end, we will show an example of the usability of Git with OCaml with a concrete application.

    • Liked Ravi Mohan
      keyboard_arrow_down

      Ravi Mohan - Predator: A Framework for Developing Programmatic Players for Complex Board Games

      Ravi Mohan
      Ravi Mohan
      CEO
      AxiomChoice
      schedule 5 months ago
      Sold Out!
      45 mins
      Experience Report
      Beginner

      Summary: An Experience Report on How I'm using Erlang and PureScript to create programmatic opponents aka 'bots' for complex boardgames I love to play but I can't find people to play with!

      The number of boardgames that you can whip out at a gathering and expect people to want play is very small.. Monopoly, Snakes and Ladders, and maybe, if you are *very* lucky, Settlers of Catan. And that's about it.


      Getting people to play these games is relatively easy.

      However the world of boardgames is *much* wider.

      There are literally tens of thousands of boardgames that simulate everything from very abstract geometry puzzles to ones that simulate complex economies and political situations.

      Some of the latter are used in very unexpected ways, e.g to train spies and military officers.

      Here is an example of an interesting game.

      A Distant Plain (by GMT Games) is a boardgame for 4 players that put them in the roles of the US military forces, the Afghan government, the Taliban, and Warlords/drug dealers, all competing for power in Afghanistan.

      ADP

      adpcards

      Here is another
      The War of the Ring, a game for 2 players.

      "In War of the Ring, one player takes control of the Free Peoples (FP), the other player controls Shadow Armies (SA). Initially, the Free People Nations are reluctant to take arms against Sauron, so they must be attacked by Sauron or persuaded by Gandalf or other Companions, before they start to fight properly ...."

      WarOfRings1

      And one more

      "The battle of Sekigahara, fought in 1600 at a crossroads in Japan, unified that nation under the Tokugawa family for more than 250 years.

      Sekigahara allows you to re-contest that war as Ishida Mitsunari, defender of a child heir, or Tokugawa Ieyasu, Japan's most powerful daimyo (feudal lord)."

      ."

      What these games have in common
      1. They are wonderful games, immersing you into their respective worlds.
      2. They have (relative to Snakes and Ladders or Monopoly) complex rulesets, which take effort and time to master.
      3. They are rarely played in India.
      4. Even when people own them, opponents are almost impossible to find and schedule.

      Which means that if you own these games and live in India, getting to actually play these games is close to impossible.

      Which is a problem.

      Being a programmer, I solve this problem by writing programmatic opponents (aka 'bots') to take the place of other players. This involves all kinds of interesting sub problems - game representation, logic processing for rules, building AI 'smarts' for your opponents, gui and event handling etc.

      Since I am doing this in my non existent spare time, I use time and effort saving languages with good capabilities for abstraction(aka functional languages!),

      In this case I use Erlang (originally Haskell, I'm using this project to learn Erlang) for the backend and PureScript for the front end.

      This talk is about the many challenges I faced in building automated game players (and extracting common frameworks/libraries) from them, while simultaneously learning two FP languages.

      Since this is an experience report, it is basically a list of lessons learned, victories *and defeats*, what worked *and what didn't work*.

      If you can't use FP at work, but are considering doing so on a personal project, or want to learn how to get going on an FP learning effort, you might benefit from my experience - both successes and failures