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.
Elixir is a dynamically typed, functional language that runs on the Erlang virtual machine, the BEAM. It was created by Jose Valim, who started the project in 2011 to pair a friendlier syntax and modern tooling with Erlang's concurrency and fault-tolerance model. Programs are built from lightweight processes that share no memory and communicate by passing messages, which makes fault-tolerant, highly concurrent systems the language's natural domain. Elixir is best known for the Phoenix web framework and runs in production at companies such as Discord, Pinterest, and Bleacher Report. On XCODX, Elixir runs in a cloud sandbox as a script, so you can try the language and its standard library without installing Erlang or the Mix build tool.
# Elixir script on the BEAM: read a line, then work with a range
name = IO.gets("What is your name? ") |> String.trim()
IO.puts("Hello, #{name}!")
sum = Enum.sum(1..10)
IO.puts("Sum of 1..10 is #{sum}")
Elixir is a strong choice when you need to handle many simultaneous connections with predictable latency and stay up under partial failure, such as chat systems, messaging backends, IoT fleets, and live dashboards. The BEAM's supervision trees let parts of a system crash and restart without taking the whole thing down. The Phoenix framework and its LiveView feature build interactive web apps without much client-side JavaScript. It is a weaker fit for CPU-bound number crunching, where the BEAM is slower than native-code or JVM options.
IO.gets/1 reads one line from standard input including the trailing newline, so pair it with String.trim/1; IO.read(:stdio, :all) reads the whole stream at once. On XCODX you can type into the live terminal, which pauses until you press Enter, or paste into the Stdin Box up front, and Ctrl+D closes the stream so :all returns.
No. The sandbox runs a single script with the elixir command and has no network access, so there is no mix project, no mix.exs, and no Hex download. You get the standard library, such as Kernel, Enum, String, and IO, but packages like Phoenix or Ecto are unavailable.
Not for short programs. A script evaluates top-level expressions directly, so you can call IO.puts and Enum functions without a module. Reach for defmodule when you want named functions, structs, or behaviours.
Yes, for in-memory concurrency. spawn, send and receive, Task, and Agent all work within a single run because the BEAM is running underneath. What you cannot do is talk to other nodes or the network, and nothing persists after the run ends.
No, it runs a plain script evaluated by the elixir runtime. There is no application supervision tree to configure and no build step you control, so frameworks that expect a Mix project structure will not load.
The Elixir version, along with the underlying Erlang/OTP version, is shown in the badge next to the editor. It is free with no signup and no local install, and each run executes in a fresh sandbox with no saved state.
main.exrubyIO.gets()IO.puts "Hello from Elixir!"
IO.puts "Welcome to XCODX Online Compiler!"
message = "Elixir is functional!"
IO.puts message