Introduction to Erlang: Single Assignment and Pattern Matching
By
pasxizeis
Crackling crust, pillowy middle. The kind of bagel that earns a second cup of coffee.
Summary
This is part 2 of a series introducing Erlang, a functional programming language. The article focuses on two core concepts: single assignment (variables cannot be changed once bound) and pattern matching (the = operator performs pattern matching rather than traditional assignment). The content explains these concepts with code examples, showing how Erlang treats variables mathematically and how pattern matching works as a fundamental language mechanism.
Key quotes
· 3 pulledIn Erlang we should think variables in a mathematical sense of the term, which means that once you've bound a variable, you cannot change its value.
If you state that X is 5, then it will always be 5 (a variable is called bound if already contains a value, unbound otherwise)
In Erlang, the = operator does actually pattern matching
You might also wanna read
Building a Minimal RAG System from Scratch: PDF to Highlighted Answers in ~100 Lines of Python
A hands-on tutorial that builds the smallest functional RAG (Retrieval-Augmented Generation) system from scratch using about 100 lines of Py
Steve Jobs: Learning to program computers teaches you how to think
This article features a quote from Steve Jobs about the importance of learning computer programming, where he argues that coding teaches peo
tiny-vllm: An Open-Source C++ and CUDA LLM Inference Engine with Educational Course
This article presents tiny-vllm, an open-source project that provides both a full C++ and CUDA implementation of a high-performance LLM infe
Binary Search in Python: Iterative Implementation Using a While Loop
This article explains the Binary Search algorithm in Python, covering its iterative implementation using a while loop. It highlights that bi
How AI coding assistants are helping introverted junior developers bridge the experience gap
The article explores how AI coding assistants like GitHub Copilot and IBM's Bob are reshaping the experience of junior developers. It argues
thenewstack.io·3d agoHow to Install Sakai LMS on AlmaLinux VPS: A Step-by-Step Guide
This article provides a step-by-step technical guide for installing Sakai LMS (Learning Management System) on an AlmaLinux VPS. It covers th
blog.radwebhosting.com·3d ago