XCODX |

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

Haskell's purity compressed into single bytes is the pitch for Husk, a functional golfing language designed in 2017 by Code Golf Stack Exchange members Leo and Zgarb. A Husk program is an expression built from combinators over a custom codepage; the language is lazy, so infinite lists are routine, and it performs its own type inference to decide how overloaded built-ins should behave for the inputs at hand. That inference is Husk's signature trick: one symbol can mean different sensible things at different types, letting programs stay short without ambiguity. The interpreter itself is written in Haskell. XCODX runs it in a real terminal with zero installation, so lazy programs that consume stdin receive whatever you type mid-execution.

Hello World in Husk

"Hello, World!"
How it works: a Husk program is a function applied to its inputs, and its result is printed. A bare string literal is a constant function, so the program evaluates to the greeting and Husk outputs it directly.

When to use Husk

Husk excels at Code Golf Stack Exchange challenges involving sequences, number theory, and anything naturally phrased as a lazy pipeline, where an infinite list plus a filter and an index beats explicit loops by many bytes. It is also one of the best languages for demonstrating type-directed overloading and laziness to students who found Haskell's syntax a barrier, since each Husk built-in is a tiny, inspectable case study in polymorphism.

Common questions

How does Husk decide what an overloaded built-in does?

Through type inference over the whole program. Each built-in carries several typed behaviors, and Husk searches for a consistent assignment that matches the declared or inferred input types, preferring earlier-listed alternatives. The result is that one codepage character can cover string, list, and numeric variants at once, which is a major source of Husk's byte savings.

Is Husk related to Haskell?

Closely, in spirit and implementation. The interpreter is written in Haskell, the language is purely functional and lazy, and many built-ins mirror Prelude functions like folds, scans, and zips. But Husk is not embedded Haskell: it has its own single-byte codepage, its own inference engine tuned for golf, and implicit argument handling that no Haskell program has.

How does Husk stack up against Jelly and 05AB1E?

It trades a smaller built-in library for stronger composition. On list-processing and mathematical challenges Husk frequently matches or beats them because laziness and higher-order combinators fit those problems naturally. On string tasks the dictionary compression in Jelly and 05AB1E usually wins. Husk answers also tend to be unusually readable once you know the codepage, which golfers appreciate when writing explanations.

How Husk runs on XCODX

Sandbox filename
main.husk
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

"Hello from Husk!"