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.
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.
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.
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}.")
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.
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.
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.
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.
main.exrubyIO.gets()IO.puts "Hello from Elixir!"
IO.puts "Welcome to XCODX Online Compiler!"
message = "Elixir is functional!"
IO.puts message