Compile U source to C, WebAssembly, or portable binaries over HTTP. No SDK, no account — just curl.
https://compiler.ulanguage.org
| endpoint | what it does |
|---|---|
| GET/health | Service status, available targets, limits |
| POST/compile | Compile U source → C, WASM, or binary |
| POST/run | Compile + execute, return stdout |
| POST/upload | Upload a .zip of source files → transpile + compile |
# Send U source, get C back as JSON printf 'f main() -> I\n\tr => 42\n' | \ curl -s -X POST -H 'Content-Type: text/plain' \ 'https://compiler.ulanguage.org/compile?format=c' \ --data-binary @- | python3 -m json.tool
# Cosmopolitan APE — runs on macOS, Linux, Windows printf 'f main() -> I\n\tr => 42\n' | \ curl -s -X POST -H 'Content-Type: text/plain' \ 'https://compiler.ulanguage.org/compile?format=binary&target=portable' \ --data-binary @- -o hello.com chmod +x hello.com ./hello.com # → 42
printf 'f main() -> I\n\tr => 42\n' | \
curl -s -X POST -H 'Content-Type: text/plain' \
'https://compiler.ulanguage.org/compile?format=wasm' \
--data-binary @- -o hello.wasm
# Server compiles, runs, returns stdout + exit code curl -s -X POST -H 'Content-Type: application/json' \ 'https://compiler.ulanguage.org/run' \ -d '{"source": "f main() -> I\n\tlog(\"hello\")\n\tr => 0"}' | python3 -m json.tool # Response: # { # "compiled": true, # "output": "hello\n", # "exit_code": 0 # }
Send a .zip containing .u, .php, .py, .js, or .ts files.
Non-U files are transpiled to U automatically. All U files are concatenated in dependency order and compiled.
# Upload a zip of PHP files, get back the U translation curl -s -X POST 'https://compiler.ulanguage.org/upload?action=transpile' -F 'file=@myproject.zip' | python3 -m json.tool # Response: # { # "u_source": "// Transpiled from ...", # "files": ["main.u", "utils.u"], # "files_count": 2, # "transpiled_from": ["main.php", "utils.php"] # }
# Upload zip → transpile → compile → download binary curl -s -X POST 'https://compiler.ulanguage.org/upload?format=binary&target=portable' -F 'file=@myproject.zip' -o myproject.com chmod +x myproject.com ./myproject.com
# Zip your .u files and compile them together zip project.zip src/*.u curl -s -X POST 'https://compiler.ulanguage.org/upload?format=c' -F 'file=@project.zip' | python3 -c " import sys, json; d = json.load(sys.stdin) print(d['files_count'], 'files compiled') open('output.c','w').write(d['c']) "
# You can also POST the zip bytes directly curl -s -X POST -H 'Content-Type: application/zip' 'https://compiler.ulanguage.org/upload?format=c' --data-binary @project.zip | python3 -m json.tool
| param | values | default |
|---|---|---|
| action | compile · transpile | compile |
| format | c · binary · wasm · portable | c |
| target | native · portable · windows | native |
Supported file types in the zip: .u (compiled directly), .php .js .ts .py (transpiled to U first).
Maximum zip size: 2 MB. Files are processed in dependency order.
| param | values | default |
|---|---|---|
| format | c · wasm · binary | binary |
| target | native · portable · windows | native |
| stdlib | 0 · 1 | 0 |
| inline | 0 · 1 (inline runtime into C) | 0 |
The body is your U source code. Two content types accepted:
| Content-Type | body format |
|---|---|
| text/plain | Raw U source (the playground uses this) |
| application/json | {"source": "f main() -> I\n\tr => 42"} |
For format=c: JSON with {"c": "...", "errors": [], "warnings": []}.
For format=binary or format=wasm: raw binary (set -o file in curl).
For /run: JSON with {"compiled": true, "output": "...", "exit_code": 0}.
| Source size | 256 KB |
| Compile timeout | 15 seconds |
| Run timeout | 5 seconds |
| Rate limit | 15 requests / minute per IP |
| Concurrent | 3 compilations |
curl -s https://compiler.ulanguage.org/health | python3 -m json.tool
# Shows: gcc, tcc, cosmocc, wat2wasm availability
# Get C with runtime inlined, compile locally printf 'f main() -> I\n\tr => 42\n' | \ curl -s -X POST -H 'Content-Type: text/plain' \ 'https://compiler.ulanguage.org/compile?format=c&inline=1' \ --data-binary @- | python3 -c " import sys, json c = json.load(sys.stdin)['c'] open('prog.c','w').write(c) print('wrote', len(c), 'bytes') " gcc -O2 -o prog prog.c -lm ./prog
The compiler is open source. Self-host: git clone the repo,
cd compiler && python3 -m u2c.server 8081.