From Ruby to Elixir
Unleash the Full Potential of Functional Programming
by: Stephen Bussey
Published | 2024-05-01 |
---|---|
Internal code | sbelixir |
Print status | In Print |
Pages | 222 |
User level | Beginner |
Keywords | elixir, beam, phoenix, liveview, ruby, functional programming, rails, erlang, web applications, web programming, concurrency |
Related titles |
|
ISBN | 9798888650318 |
Other ISBN |
Channel epub: 9798888650745 Channel PDF: 9798888650752 Safari: 9798888650738 |
BISACs | COM051010 COMPUTERS / Programming Languages / GeneralCOM051410 COMPUTERS / Programming Languages / RubyCOM051410 COMPUTERS / Programming Languages / Ruby |
Highlight
Elixir will change the way you think about programming. Use your Ruby experience to quickly get up to speed so you can see what all of the buzz is about. Go from zero to production applications that are reliable, fast, and scalable. Learn Elixir syntax and pattern matching to conquer the basics. Then move onto Elixir’s unique process model that offers a world-class way to go parallel without fear. Finally, use the most common libraries like Ecto, Phoenix, and Oban to build a real-world SMS application. Now’s the time. Dive in and learn Elixir.
Description
Whether you’re a seasoned Ruby developer looking to expand your skill set or a programming beginner looking for a solid foundation in Elixir, this book has what you need to get up to speed quickly. Elixir is a functional language with a fairly small footprint. This makes it easier to learn and put into production than other languages. Plus, it’s built on forty-year-old foundations that give your applications rock-solid stability.
The first part of this book is all about developing expertise in the language. Learn about the core data types, build application data structures, enumerate over data, and use pattern matching to control the flow of an application. Elixir has an amazing process model that allows for (actually) easy parallel processing. Learn how to tap into this process model so you can leverage that power yourself.
The second part of this book builds a real-world application using the most important libraries in a web developer’s toolbox. Each library is compared to its similar Ruby library so you’ll quickly see similarities and differences. We’ll use Ecto, Phoenix, and Oban to build a SMS application powered by Twilio.
What are you waiting for? Tap into your Ruby knowledge and start building scalable Elixir applications today.
Contents and Extracts
- Introduction
- Fundamentals of Elixir
- Why Elixir? Why Now? excerpt
- The Joy of Ruby
- The Case for Elixir
- Erlang, OTP, Elixir, and Friends
- Install Elixir on Your Computer
- Write Your First Elixir Code
- Wrapping Up
- New Language, New Syntax
- The Big Picture
- Data Types
- Operators
- Module and Function Basics
- Fun with Functions
- Capturing Functions
- Advanced Module Keywords
- Compile Time vs. Runtime
- Wrapping Up
- Working with Data
- Lists—Not Arrays
- Maps—Your Data Layer Foundation
- Implementing Data Structures
- Enumerating Data Structures
- Wrapping Up
- Pattern Matching Your Way to Success excerpt
- Pattern Matching Basics
- Use Patterns for Control Flow
- Level Up Your Functions
- Wrapping Up
- GenServers: Build Cities, Not Skyscrapers
- Parallelism vs. Concurrency
- Explore Elixir Processes excerpt
- Go Parallel with GenServers
- Be Parallel, Be Cautious
- Build Cities, Not Skyscrapers
- Wrapping Up
- Why Elixir? Why Now? excerpt
- Tools of the Trade
- Persisting Data with Ecto
- What Will We Build?
- The Foundations of Ecto
- Write an Ecto Schema
- Use Migrations to Create Database Tables
- Use Changesets to Persist Data
- Query Data with Ecto.Query
- Put Everything in a Context
- Wrapping Up
- Serving Requests with Phoenix
- Explore the Foundations of Phoenix
- Route Requests Through Phoenix
- Serve Requests with Phoenix Controllers
- Manage Static Assets
- Use Components to Keep Your User Interface Clean
- Phoenix Is More Than Controllers
- Wrapping Up
- Outbound HTTP Requests with Req
- Decide on Which HTTP Client to Use
- Prep Your Project for Req
- Use Req to Make Requests
- See Your App in Action
- Wrapping Up
- Asynchronous Jobs with Oban
- Understand Async Job Systems
- Explore Asynchronous Jobs in Elixir
- Implement an Oban Worker
- More About Oban
- Wrapping Up
- Testing Elixir
- Create Your First Test
- Test an Ecto Query
- Test External API Requests
- Test Phoenix Requests
- Test Oban Jobs
- Wrapping Up
- The Future of Elixir
- Deployment and Observability
- Real-Time Apps with LiveView
- GraphQL with Absinthe
- Machine Learning with Nx and Bumblebee
- Type Systems
- Wrapping Up
- The End of Our Journey
- Persisting Data with Ecto