0Pricing
Erlang OTP: Distributed & Fault-Tolerant Systems Programming · Lezione

Introduzione a Erlang e alla VM

Esplori la Erlang Virtual Machine (BEAM), la sintassi di base, i tipi di dati e la mentalità della programmazione funzionale necessaria per sviluppare in Erlang

Introduzione a Erlang e alla VM è una lezione Erlang OTP: Distributed & Fault-Tolerant Systems Programming gratuita su CoddyKit. Questa è la lezione 1 di 4. Puoi leggere la lezione completa qui gratuitamente — poi esercitati direttamente nel browser con un editor di codice integrato e un tutor IA disponibile 24/7. Fa parte del percorso di apprendimento Erlang OTP: Distributed & Fault-Tolerant Systems Programming, e i tuoi progressi si sincronizzano tra il web e l'app CoddyKit. Il corso Erlang OTP: Distributed & Fault-Tolerant Systems Programming include 4 lezioni in totale.

Parti di questa lezione non sono ancora state tradotte e vengono mostrate in inglese.

Meet Erlang: Built for Reliability

Erlang, built by Ericsson for systems that must never go down, is a functional language for fault-tolerant, concurrent, distributed apps.

The Power of BEAM

Erlang runs on the BEAM virtual machine, which manages millions of lightweight processes — the foundation of its concurrency and fault tolerance.

Your First Erlang Code

Time for Hello World. Erlang code lives in modules (.erl files) that declare a name and export functions by name and arity.

-module(hello_world).
-export([start/0]).

start() ->
    io:format("Hello, Erlang!~n").

The Erlang Shell: Your Playground

The Erlang shell (start it with erl) lets you type expressions and see results instantly. Remember to end each with a dot.

Variables: Single Assignment

Erlang variables start uppercase and use single assignment: once bound, a value cannot change in scope. That immutability prevents whole bug classes.

-module(variables).
-export([show/0]).

show() ->
    X = 10,
    Y = X * 2,
    io:format("X is: ~w~n", [X]),
    io:format("Y is: ~w~n", [Y]).

Basic Types: Atoms & More

Core types: atoms (lowercase named constants like ok), numbers (integers and floats), and booleans, which are just the atoms true and false.

-module(basic_types).
-export([display/0]).

display() ->
    Status = ok,
    Count = 42,
    Pi = 3.14159,
    IsActive = true,
    io:format("Status: ~w~n", [Status]),
    io:format("Count: ~w~n", [Count]),
    io:format("Pi: ~w~n", [Pi]),
    io:format("Is Active: ~w~n", [IsActive]).

Tuples: Fixed Collections

A tuple groups a fixed set of elements in curly braces, like {ok, Value}. It is immutable — build a new one to "change" it.

-module(tuples).
-export([show/0]).

show() ->
    Person = {person, "Alice", 30, female},
    Coordinate = {x, 10, y, 20},
    io:format("Person: ~w~n", [Person]),
    io:format("Coordinate: ~w~n", [Coordinate]).

Lists: Flexible Sequences

A list in square brackets holds any number of ordered elements. You process it recursively as a Head (first item) and Tail (the rest).

-module(lists_example).
-export([show/0]).

show() ->
    Numbers = [1, 2, 3, 4, 5],
    Colors = [red, green, blue],
    MixedList = [atom_name, 123, {tuple, 1}],
    io:format("Numbers: ~w~n", [Numbers]),
    io:format("Colors: ~w~n", [Colors]),
    io:format("Mixed: ~w~n", [MixedList]).

Thinking Functionally

Erlang is functional: data is immutable, functions avoid side effects, and functions are first-class values you pass around freely.

Quick Check: Erlang Basics

Let's test your understanding of basic Erlang concepts.

Which of the following statements about Erlang's core features are TRUE?

Recap: Erlang Basics

Recap: Erlang targets fault-tolerant concurrency on the BEAM, with modules, single-assignment variables, and core types like atoms, tuples, and lists.

Domande Frequenti

La lezione «Introduzione a Erlang e alla VM» è gratuita?

Sì — il testo completo di «Introduzione a Erlang e alla VM» è gratuito qui sul web. Per esercitarvi in modo interattivo (un editor di codice integrato e un tutor IA 24/7) e sbloccare il resto del corso Erlang OTP: Distributed & Fault-Tolerant Systems Programming, passa a CoddyKit PRO. Il corso Erlang OTP: Distributed & Fault-Tolerant Systems Programming include 4 lezioni in totale.

Cosa imparerò in «Introduzione a Erlang e alla VM»?

Esplori la Erlang Virtual Machine (BEAM), la sintassi di base, i tipi di dati e la mentalità della programmazione funzionale necessaria per sviluppare in Erlang Eserciti Erlang OTP: Distributed & Fault-Tolerant Systems Programming con codice pratico che esegui direttamente nel browser, e un tutor IA 24/7 risponde alle tue domande mentre lavori sulla lezione.

Ho bisogno di esperienza per iniziare Erlang OTP: Distributed & Fault-Tolerant Systems Programming?

Non è richiesta alcuna esperienza precedente. Erlang OTP: Distributed & Fault-Tolerant Systems Programming su CoddyKit è strutturato per principianti e studenti avanzati, quindi puoi iniziare da qui o dall'inizio e procedere al tuo ritmo. Questa è la lezione 1 di 4.

Quanto tempo richiede la lezione «Introduzione a Erlang e alla VM»?

La maggior parte delle lezioni CoddyKit richiede circa 5–10 minuti. Ogni lezione è breve e interattiva, quindi fai progressi costanti e riprendi esattamente da dove hai lasciato su web e app.

Posso scrivere ed eseguire codice in questa lezione Erlang OTP: Distributed & Fault-Tolerant Systems Programming?

Sì. Ogni lezione Erlang OTP: Distributed & Fault-Tolerant Systems Programming include un editor di codice integrato, quindi scrivi ed esegui codice reale direttamente nel tuo browser e ricevi feedback istantaneo dall'IA — nessuna configurazione locale necessaria.

Tutte le lezioni di questo corso

  1. Introduzione a Erlang e alla VM
  2. Processi e messaggistica in Erlang
  3. Pattern fondamentali di concorrenza
  4. Pattern matching e guard
← Torna a Erlang OTP: Distributed & Fault-Tolerant Systems Programming