HCODX |

Online Erlang Compiler Runner (Editor, Interpreter)

Select Language
Online Code Compiler
Full HTML IDE
Py main.py
Program Output Ready
  Welcome to HCODX Online Compiler

  Quick Start:
  Ctrl+Enter  Run code
  Ctrl+S      Save / Download
  Ctrl+L      Clear output

  Select a language and start coding.
Success
Operation completed

Why Use Our Free Erlang?

Online Erlang Compiler with an Interactive Terminal

Compile and run Erlang code online instantly with HCODX. Our free cloud-based Erlang compiler supports real-time execution, standard input, syntax highlighting, and code download. No installation or configuration required. Start coding in Erlang now.

Instant Execution

Run Erlang instantly without installing any IDEs or configuring environments. Our cloud-based Erlang handles libraries, runtimes, and dependencies automatically so you can focus on writing code.

Perfect for Learning

Whether you are studying algorithms in Erlang, practicing data structures in Erlang, or exploring functional programming, our tool provides real-time stdout/stderr feedback with interactive standard input support.

Professional Features

  • Standard Input (stdin) support
  • 85+ programming languages
  • Syntax highlighting with themes
  • Zero-setup cloud environment
  • Download code as .erl
  • Real-time compilation & execution

Why developers use HCODX

HCODX is a free online compiler and code runner: write code in your browser, execute it on a cloud sandbox, and interact with your program through a live terminal. Students use it for coursework and interview practice; developers use it to test snippets in 85+ languages without setting up a local environment.

About Erlang

Ericsson engineers designed Erlang in 1986 to run telephone switches that were never allowed to stop — and that requirement produced a language decades ahead of its time. Lightweight processes, message passing, supervision trees, and hot code swapping let systems achieve legendary uptime; WhatsApp famously served hundreds of millions of users with a tiny Erlang team, and RabbitMQ, CouchDB, and much telecom infrastructure run on it today. The runtime (BEAM) is actively developed, with OTP 27 and 28 as recent releases. Erlang is also academically significant as the canonical actor-model language, cited in virtually every concurrency course. Here you can execute Erlang in a live terminal — io:get_line reads what you type mid-run, with zero toolchain setup.

Hello World in Erlang

main(_) ->
    Name = string:trim(io:get_line("What's your name? ")),
    io:format("Hello, ~s! Spawning a process for you.~n", [Name]),

    Parent = self(),
    spawn(fun() -> Parent ! {note, "delivered by a lightweight process"} end),
    receive
        {note, Msg} -> io:format("Message ~s~n", [Msg])
    end,

    {ok, [N]} = io:fread("Factorial of what number? ", "~d"),
    io:format("~b! = ~b~n", [N, fact(N)]).

fact(0) -> 1;
fact(N) when N > 0 -> N * fact(N - 1).

When to use Erlang

Erlang shows up in two career paths: distributed-systems engineering (messaging infrastructure like RabbitMQ, telecom, IoT backends) and as the foundation beneath Elixir, where understanding OTP concepts distinguishes senior candidates. Concurrency and programming-languages courses assign Erlang to teach the actor model, immutability, and pattern matching with guards — exactly the constructs you can drill on this page. It's also the fastest way to test recursion patterns, list comprehensions, and message-passing snippets from Armstrong's 'Programming Erlang' without configuring rebar3 or a local OTP release. HCODX is a free online Erlang editor, runner and interpreter — an IDE-grade compiler and playground to write and run code online, execute code with live output and live preview, no downloads or web server required.

Common questions

Can I type responses to io:get_line while the program runs?

Yes. io:get_line and io:fread block the running program until you enter a line in the terminal, and io:format output appears immediately beforehand — so prompts and answers interleave live, like an escript run in a local shell. Sequential interactive prompts work without any special handling.

How should I structure my code — module or escript style?

Write it script-style with a main/1 entry point, as in the example: execution starts at main and you can define additional functions below it with the usual clause-and-guard syntax. This mirrors how escript runs single files, so translating your code into a proper -module(...) later is mechanical.

Are OTP behaviours like gen_server available?

The standard library and OTP modules that ship with Erlang (lists, maps, string, ets, gen_server and other behaviours) are present — no external packages, no rebar3 dependencies, single file only. Full supervision-tree applications are awkward in one script, but you can absolutely exercise processes, messages, and ets tables.