Phoenix is an Elixir web framework for building productive, reliable applications with the performance to take on the modern computing world. Together, we’ll review what makes Phoenix great and how it uses Elixir to optimize code for performance – without sacrificing programmer productivity. Along the way, we’ll see neat features like live-reload and generators and how Phoenix’s realtime layer takes on the modern web.
Throughout history, the needs of the consumer, hardware limitations, and the capabilities of languages have set a pendulum in motion. At one side, the pendulum dictates that user interfaces be glorified forms with simple request-response semantics. At other times, the pendulum swings to the opposite extreme, and user interfaces become rich and dynamic, but they leave the programmer to deal with increasingly high technical mountains.
This pendulum dictates what compromises must be made at the user interface, but more interestingly, it determines how resources are consumed and allocated on the server, the language choices that impact each layer of an application, and the way we think of generic terms like "server" and "connection".
This talk will focus on the movement of the pendulum. We'll look at what forces in the industry set the pendulum into motion at each point. Finally, we'll look at why Elixir is succeeding in the face of the most recent and dramatic pendulum swing to date.
With Phoenix 1.0 out recently, it's time to look ahead! Together, we'll outline what's next for Phoenix 1.1, then explore some exciting new features that take Phoenix to another level of modern web development.
This talk will be in dialog with Avdi Grimm's book "Confident Ruby". It will also be a distant echo of Kent Beck's book "Smalltalk Best Practice Patterns". We'll talk about what confidence looks like in code, and how to achieve it. We'll look at examples of non-confident code in Ruby, briefly look at how to make them less timid, and then spend quality time with them in Elixir.
Confidence is reflected in code which clearly states its intention. It means removing the clutter of conditionals and error handling which obscure meaning and flow. Elixir provides many language-level constructs to make confident code the natural path to follow. Pattern matching, multi-clause functions, guard clauses, and protocols all foster code confidence. Tagged tuples provide significant, non-nil return values, and structs provide a form of type system. We'll introduce each of these and show how they can work together to even greater effect. We'll work up to supervision trees, the ultimate trump card in confident Elixir code.
Let's look at a quick example involving inserting a new record into a database. In Ruby, we might use the ActiveRecord save method, which returns boolean true on success and false on error. This pushes us toward a branching conditional.
When it comes to releasing your Elixir app, there are a couple of ways to handle it with pros and cons to each. I created Exrm and Conform to simplify this process and provide a path for using the Erlang VM's capability for performing hot upgrades/downgrades.
In case you aren't familiar with it, Exrm (Elixir Release Manager) is a library which at it's core exposes a mix task (`mix release`) which builds your Elixir application and packages it as a tarball for easy deployment. By default it contains everything you need to run your application, including the Erlang runtime. It is highly configurable though, and can allow you to build cross-compiled releases for platforms like the RaspberryPi, and much more.
Conform is a configuration management library inspired by cuttlefish (a library built by Basho for Riak), and is designed to allow you to expose a simple init-style configuration file in production, defined by a schema, which contains translation to common data types, custom transformations of your own design, and validation rules (such as valid ranges, etc).
The purpose of this talk will be to walk you through taking a simple Phoenix application, defining a configuration schema with Conform, building and deploying a release with Exrm, configuring the release, and handling a simple upgrade/downgrade scenario. I will also talk briefly about using Exrm without Conform, and things to keep in mind during development when targeting releases for deployment.
In this talk we'll build a custom visual programming language that compiles down to Elixir modules. The language will be focused on generating chatbots atop an XMPP server, but the concept more broadly involves building a Rules Engine that generates runtime-configurable output based on input documents. We'll define an Abstract Syntax Tree for a custom language, a compiler that translates that AST into Elixir modules, and a UI for building the AST directly (i.e. no parser - this is not a text-based language). We'll also walk through the supporting web application that handles storing the AST as it's built.
Conflict-free Replicated Data Types (CRDTs) are a hot new datatype in distributed programming that promise coordination-free and always eventually-consistent writes. Most of the stuff you will read about them is limited to the context of high-end distributed databases, but CRDT's are more flexible and shouldn't be limited to this field. In the talk, I will demonstrate how CRDT's are great for applications that have partial connectivity (including websites): updates can be applied locally, and when communication is possible, you can send the data back up, and the data will remain consistent even in the most byzantine (or apocalyptic) scenarios. There are even scenarios that can support multiple simultaneous editors.
Beyond that, I will also demonstrate how Elixir's metaprogramming can be used to compose complex models out of CRDT's that themselves exhibit the same exact features. I will also exhibit some newer CRDT features, such as shared-context and delta-operation CRDT's to overcome some of the shortcomings of older CRDT's.
I plan to keep the talk light on theory (the academic literature is sufficient for that).
We will walk through the development of a voice survey application using Phoenix, MySql, and the open source Asterisk PBX. We will build a simple web interface to create survey questions and display the results of completed surveys. We will build an Asterisk AGI application that reads the configured questions to a caller and accept touch tone responses which will be saved for later viewing in the Phoenix application. We will then demonstrate the application.
The lines of connectivity extend beyond the web browser and into almost every device we own. Mobile phones, sensors, and wearable tech are only as powerful as the platform that interconnects them. The Phoenix Framework is that platform and goes beyond the web by providing an abstract of connectivity through channels. Together, we'll explore how to connect iOS, Mac OS, and Apple Watch to Phoenix using the ObjC channel adapter. To tie it all together, we'll see how we can seamlessly start a motorcycle from an Apple Watch, stream ride stats using an iPhone, and display this data on a Mac OS App. Phoenix is defining a new web. Let's find out what's possible.
You want to perform integration tests on your development computer. As part of testing, you want a 3rd-party sandbox server to send its notifications to your computer, but, alas, your computer is behind a firewall.
In this session, you will learn how to set up an EC2 instance managed by Phoenix to relay communications bidirectionally between the sandbox and your development computer. See how a Phoenix channel eliminates polling and how an Elixir distribution primitive sets up the channel through the firewall.