0Pricing
Erlang OTP: Distributed & Fault-Tolerant Systems Programming · درس

مقدمة إلى Erlang والآلة الافتراضية

استكشف الآلة الافتراضية لـ Erlang (BEAM) والصياغة الأساسية وأنواع البيانات وعقلية البرمجة الوظيفية اللازمة لتطوير Erlang

مقدمة إلى Erlang والآلة الافتراضية درس مجاني في Erlang OTP: Distributed & Fault-Tolerant Systems Programming على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Erlang OTP: Distributed & Fault-Tolerant Systems Programming، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Erlang OTP: Distributed & Fault-Tolerant Systems Programming 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

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.

الأسئلة الشائعة

هل درس «مقدمة إلى Erlang والآلة الافتراضية» مجاني؟

نعم — نص درس «مقدمة إلى Erlang والآلة الافتراضية» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Erlang OTP: Distributed & Fault-Tolerant Systems Programming، انتقل إلى CoddyKit PRO. تتضمن دورة Erlang OTP: Distributed & Fault-Tolerant Systems Programming 4 دروس في المجموع.

ماذا ستتعلم في «مقدمة إلى Erlang والآلة الافتراضية»؟

استكشف الآلة الافتراضية لـ Erlang (BEAM) والصياغة الأساسية وأنواع البيانات وعقلية البرمجة الوظيفية اللازمة لتطوير Erlang تتمرن على Erlang OTP: Distributed & Fault-Tolerant Systems Programming مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Erlang OTP: Distributed & Fault-Tolerant Systems Programming؟

لا تُشترط خبرة سابقة. Erlang OTP: Distributed & Fault-Tolerant Systems Programming على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «مقدمة إلى Erlang والآلة الافتراضية»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Erlang OTP: Distributed & Fault-Tolerant Systems Programming هذا؟

نعم. كل درس في Erlang OTP: Distributed & Fault-Tolerant Systems Programming يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. مقدمة إلى Erlang والآلة الافتراضية
  2. عمليات Erlang وتبادل الرسائل
  3. أنماط التزامن الأساسية
  4. مطابقة الأنماط وعبارات الحراسة
← العودة إلى Erlang OTP: Distributed & Fault-Tolerant Systems Programming