Karthik Divi
·3 min read

Erlang Online Compiler - Run Erlang Code Directly in Your Browser

Erlang was built at Ericsson in the 1980s to handle telephone switches. The requirements were wild: the system could never go down, it had to handle thousands of concurrent calls, and you needed to update the code while it was running. Those constraints shaped a language that's unlike almost anything else.

Decades later, WhatsApp used Erlang to serve 900 million users with a tiny engineering team. Discord uses it. RabbitMQ is built on it. The BEAM VM that Erlang runs on is still one of the best runtimes for concurrent, fault-tolerant systems.

But installing Erlang/OTP locally is not quick. It's a full platform, not just a compiler. If you want to try the language or test a snippet, an Erlang online compiler is the fastest path.

How Erlang thinks about problems

Erlang doesn't have objects. It doesn't have threads in the traditional sense. Instead, it has lightweight processes that communicate by sending messages to each other. Each process has its own memory. If one crashes, the others keep running. That's the core idea.

Here's a taste. Try this in OneCompiler's Erlang environment:

-module(main).
-export([main/0]).

% A simple temperature converter using pattern matching
convert({celsius, Temp}) ->
    {fahrenheit, Temp * 9 / 5 + 32};
convert({fahrenheit, Temp}) ->
    {celsius, (Temp - 32) * 5 / 9};
convert(_) ->
    {error, "Unknown format"}.

format_result({Type, Value}) ->
    io:format("~w: ~.1f~n", [Type, Value]).

main() ->
    Temps = [{celsius, 0}, {celsius, 100}, {fahrenheit, 72}, {fahrenheit, 212}],
    io:format("Temperature conversions:~n"),
    lists:foreach(
        fun(T) ->
            Result = convert(T),
            io:format("  ~w -> ", [T]),
            format_result(Result)
        end,
        Temps
    ).

Pattern matching on tuples. No if/else. Each clause of convert handles a specific shape of input. The function just declares what it does for each case. Erlang is full of this kind of clarity.

The OTP factor

What makes Erlang hard to set up locally isn't just the compiler. It's OTP (Open Telecom Platform), the framework that comes with Erlang and provides supervision trees, gen_servers, and all the building blocks for fault-tolerant applications. OTP is what makes Erlang, Erlang. But it also means the install is heavy.

For learning the language fundamentals, pattern matching, recursion, list operations, message syntax, you don't need OTP on your machine. An online compiler handles it.

Running Erlang online with OneCompiler

OneCompiler gives you a working Erlang environment with no setup. Write a module, export your functions, run it. The things that make it practical:

  • Instant compilation and output, good for iterating on pattern matching logic
  • Share links when you want to show someone a working example
  • Works from any browser, any OS, no Erlang install needed
  • Starts clean every time, no stale state from previous sessions

Who this is for

If you're curious about Erlang after hearing about its concurrency model, start here. If you're already an Erlang developer and need to test something quick without spinning up a project, this works. If you're learning for an interview or comparing it to Elixir, running code in the browser beats reading documentation.

Run Erlang online on OneCompiler