XCODX |

Elixir Online Compiler & Interpreter

Select Language
Online Code Compiler
Full HTML IDE
Py main.py
Program Output Ready
  Welcome to XCODX 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

About Elixir

Discord relays millions of concurrent voice and chat sessions on Elixir — a vivid demonstration of why this language exists. Created by José Valim in 2012, Elixir layers approachable, Ruby-inspired syntax over the Erlang virtual machine (BEAM), inheriting thirty years of battle-tested concurrency and fault tolerance. Recent releases have been ambitious: version 1.18 (late 2024) shipped set-theoretic type checking that catches type errors at compile time without annotations, and 1.19 extended it further. The Phoenix web framework and LiveView keep Elixir near the top of developer-satisfaction surveys year after year. On this page you get a live Elixir terminal: scripts run instantly, IO.gets waits for your typed reply, and no local Erlang/OTP install is needed.

Hello World in Elixir

name = IO.gets("What's your name? ") |> String.trim()
IO.puts("Hey #{name}, let's pipe some data.")

count =
  IO.gets("How many squares do you want? ")
  |> String.trim()
  |> String.to_integer()

1..count
|> Enum.map(fn n -> {n, n * n} end)
|> Enum.each(fn {n, sq} -> IO.puts("#{n} squared is #{sq}") end)

total = 1..count |> Enum.map(&(&1 * &1)) |> Enum.sum()
IO.puts("They add up to #{total}.")

When to use Elixir

Elixir practice pays off for backend developers targeting Phoenix jobs — the framework consistently ranks among the most loved in Stack Overflow surveys, and companies from fintech to telecom hire for it. This page is a friction-free way to drill the idioms interviews probe: the pipe operator, pattern matching in function heads, recursion over lists, and Enum/Stream transformations. Students meeting functional programming or the actor model in a concurrency course can experiment with spawn, send, and receive semantics conceptually before setting up OTP applications locally.

Common questions

Does IO.gets support live typed input on this page?

Yes — the terminal is interactive, so IO.gets prints its prompt and blocks until you respond, returning your line (including the trailing newline, hence the customary String.trim). Multiple prompts in sequence work naturally, and IO.puts output streams to the screen the moment each expression evaluates.

What runs my code — compiled Elixir or a script?

Your file executes the way elixir script.exs runs code: compiled on the fly to BEAM bytecode and run on the Erlang VM. That means real processes, pattern matching, and the full standard library behave exactly as in production; you're just skipping the Mix project scaffolding around a single file.

Can I use Mix dependencies like Phoenix or Ecto here?

No — there's no Mix project or Hex package fetching in the sandbox, so frameworks and database libraries are out of scope. The complete standard library is available though: Enum, Stream, Map, GenServer and friends from OTP, Task, and Agent all work, which covers most learning and interview scenarios.

How Elixir runs on XCODX

Sandbox filename
main.ex
Entry point
single main source file
Editor grammar
ruby
Reading stdin
IO.gets()
Input delivery
live WebSocket stream
Prompt flushing
flush manually before reading input
Compile limit
10 s
Run limit
3 s batch · up to 3 min live
Memory
256 MB per stage
Max source
50,000 characters

Default program on this page

IO.puts "Hello from Elixir!"
IO.puts "Welcome to XCODX Online Compiler!"
message = "Elixir is functional!"
IO.puts message