Retour aux cours
AI019 Professionnel

Programmer en Elixir

Un guide complet sur la programmation fonctionnelle et concurrente avec Elixir. Il aborde la transition du penser orienté objet vers le penser fonctionnel, le pattern matching, l'immutabilité, le modèle d'acteur pour la concurrence, et la construction de systèmes distribués robustes avec OTP.

4.8
30.0h
981 étudiants
10 lessons
0 j'aime
Intelligence Artificielle
Commencer à apprendre

Aperçu du cours

📚 Résumé du contenu

Un guide complet sur la programmation fonctionnelle et concurrente avec Elixir. Il couvre la transition de la pensée orientée objet vers une approche fonctionnelle, le pattern matching, l'immutabilité, le modèle d'acteur pour la concurrence, et la construction de systèmes distribués robustes avec OTP.

Maîtrisez l'art de créer des systèmes concurrents résilients grâce à la beauté de la programmation fonctionnelle.

Auteur : Dave Thomas

Remerciements : José Valim, Corey Haines, Bruce Tate, Jessica Kerr, Anthony Eden, Chad Fowler, Kim Shrier, Candace Cunningham, et Potomac Indexing.

🎯 Objectifs d'apprentissage

  1. Comparer le modèle de transformation des données d’Elixir avec la programmation basée sur l’état classique.
  2. Configurer l’interpréteur interactif Elixir (IEx) et exécuter du code Elixir via des scripts et la compilation.
  3. Appliquer l’opérateur de correspondance (=), l’opérateur d’épinglage (^) et le joker (_) pour déstructurer et valider les données.
  4. Expliquer les implications théoriques et pratiques de l’immutabilité sur les performances et la gestion de la mémoire.
  5. Identifier et utiliser les types intégrés d’Elixir, notamment les types Valeur, Système et Collection.
  6. Appliquer les règles d’environnement des variables et l’expression with pour gérer des transformations complexes des données.
  7. Créer et appeler des fonctions anonymes en utilisant à la fois la notation standard et la notation de capture (&).
  8. Implémenter des fonctions nommées au sein de modules en utilisant le pattern matching et la récursivité pour gérer une logique complexe.
  9. Appliquer les clauses de garde et les paramètres par défaut pour contrôler le flux d’exécution des fonctions.
  10. Désassembler et construire des listes : Utiliser le pattern matching tête/queue pour naviguer dans et construire des structures de liste récursives.

Leçons

Lesson

This lesson introduces Elixir as a functional language focused on data transformation, emphasizing the importance of immutability and the use of the pipe operator for clean, predictable code. Students will also learn how Elixir’s actor-based concurrency model uses isolated processes and message passing to ensure thread safety and system scalability.

This lesson introduces the functional paradigm of Elixir, focusing on the core concept of data immutability and the use of pattern matching over variable mutation. Students will learn how to perform data transformations to create new values rather than modifying existing ones, ensuring predictable and thread-safe code.

This lesson explores foundational functional programming in Elixir, focusing on anonymous and named functions, module encapsulation, and the use of the pipe operator for data transformation. Students will also learn to leverage pattern matching and the `with` expression to handle complex, multi-step logic safely and effectively.

AI019: Recursive Lists and Data Structures (Lesson 4) explores the recursive nature of linked lists in Elixir, focusing on head-tail decomposition and the implementation of custom recursive functions. Students will learn to identify base cases, utilize the cons operator, and apply recursive patterns to perform efficient list operations.

This lesson explores the differences between greedy processing with the Enum module and lazy processing with the Stream module in Elixir. Students will learn to implement the Enumerable protocol and apply these concepts to perform memory-efficient data transformations and advanced string processing.

This lesson explores advanced Elixir control flow, focusing on pattern matching with case expressions, guard clauses, and the use of the with construct for error handling. Students will also learn to manage project structures using Mix and improve code quality through professional tooling like Credo and Dialyzer.

This lesson explores how to maintain persistent state in Elixir using recursive functions and Tail-Call Optimization (TCO) to keep processes alive. Students will learn to manage process lifecycles, handle message passing, and implement deterministic communication patterns in concurrent systems.

This lesson explores the fundamentals of the Open Telecom Platform (OTP) in Elixir, focusing on how behaviors, supervision trees, and I/O messaging enable the creation of fault-tolerant, distributed applications. Students will learn to implement GenServers and leverage the Error Kernel philosophy to build robust systems that effectively manage process lifecycles and inter-node communication.

This lesson explores advanced OTP architectures and the Five-Question Framework to achieve high-reliability state management in Elixir. Students will learn to design robust supervision trees and distributed systems by systematically defining environment constraints, focal points, and fault-tolerance strategies.

This lesson explores Elixir’s metaprogramming capabilities, focusing on how the language's homoiconic nature allows source code to be treated as data via the Abstract Syntax Tree (AST). Students will learn to design extensible software using protocols and macros while evaluating how static analysis tools like Dialyzer provide type safety without sacrificing dynamic flexibility.