XCODX |

Pony 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 Pony

Pony is an actor-model language with a type system that mathematically rules out data races: its reference capabilities tell the compiler exactly which code can read or write each object, so concurrent programs that compile are free of races by construction, with no locks and no stop-the-world garbage collection pauses. Designed by Sylvan Clebsch and developed openly since 2015, Pony found early adopters in low-latency stream processing, notably Wallaroo Labs' data platform. It compiles through LLVM to fast native code. The language is niche but intellectually rich, and this page removes the setup cost entirely: your Pony program compiles and runs in a live terminal with output from every actor streaming as it executes.

Hello World in Pony

actor Counter
  let _env: Env
  let _name: String

  new create(env: Env, name: String) =>
    _env = env
    _name = name

  be count_to(limit: U32) =>
    var i: U32 = 1
    while i <= limit do
      _env.out.print(_name + " says " + i.string())
      i = i + 1
    end

actor Main
  new create(env: Env) =>
    env.out.print("Actors starting...")
    let a = Counter(env, "alpha")
    let b = Counter(env, "beta")
    a.count_to(3)
    b.count_to(3)

When to use Pony

Pony's natural audience is developers studying concurrency theory: its reference capabilities (iso, val, ref, and friends) are the most complete industrial implementation of capability-based race prevention, making it a common case study in graduate PL seminars alongside Rust's borrow checker. Engineers building low-latency financial or streaming systems evaluate it for lock-free actor pipelines, following Wallaroo's example. It also serves language designers mining ideas, and Rust programmers who want to compare how two different type systems achieve data-race freedom test equivalent snippets here.

Common questions

Can Pony programs read interactive input on this page?

Yes, though Pony makes it deliberately explicit: stdin is accessed through env.input by registering an InputNotify object whose apply method receives data asynchronously as you type into the live terminal. There is no blocking read-line call, because blocking would violate the actor model; input arrives as messages, like everything else in Pony.

What does the compiler actually guarantee about my concurrent code?

If it compiles, it is free of data races: reference capabilities ensure no two actors can simultaneously hold mutable access to the same object. Pony is also exception-safe in the sense that behaviors cannot crash the whole program with unhandled errors. It does not prevent logical race conditions like message-ordering assumptions, only memory-level races.

Which toolchain runs my code, and can I use external packages?

Programs are built with ponyc, the reference LLVM-based compiler, as a single-file compilation that automatically includes the built-in standard library packages you import, such as collections and time. The corral package manager and third-party dependencies are not available in the sandbox, but standard library coverage is sufficient for actor experiments and algorithm work.

How Pony runs on XCODX

Sandbox filename
main.pony
Entry point
single main source file
Editor grammar
plain text — no highlighter ships for this language
Reading stdin
no standard input construct
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

actor Main
  new create(env: Env) =>
    env.out.print("Hello from Pony!")
    env.out.print("Welcome to XCODX Online Compiler!")

The Pony compiler streams each build phase to stdout with no redirection. Those lines are filtered out of the output pane so only your program prints.