XCODX |

Common Lisp 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 Common Lisp

Common Lisp is the ANSI-standardized descendant of the original Lisp, one of the oldest high-level languages still in everyday use; the standard was ratified in 1994 and has stayed stable ever since. It is a multi-paradigm language that blends functional, procedural, and object-oriented styles, with a famously flexible macro system and an interactive condition-and-restart system for handling errors. XCODX runs Common Lisp through SBCL (Steel Bank Common Lisp), a mature, high-performance compiler that turns your code into native machine code. The language treats code as data through s-expressions, which is exactly what makes its macros so expressive. Here you can run standard Common Lisp in a cloud sandbox without installing SBCL or configuring a Lisp environment.

Hello World in Common Lisp

;; Common Lisp (SBCL)
(format t "What is your name? ")
(finish-output)
(let ((name (read-line *standard-input* nil "stranger")))
  (format t "Hello, ~a!~%" name))

(format t "Squares: ~a~%"
        (loop for n from 1 to 5 collect (* n n)))

When to use Common Lisp

Common Lisp is a good fit when you want a highly dynamic, interactive language with metaprogramming that few others match, backed by a compiler fast enough for serious work. It has a long history in symbolic AI, computer algebra, and complex rule-based systems where flexibility pays off. Choose it when you value a stable standard and the freedom to reshape the language with macros. It is less suited to teams that need a large ready-made package ecosystem or predictable, low-level memory control.

Common questions

Can I load libraries with Quicklisp?

No. Quicklisp and ASDF cannot fetch anything, because the sandbox has no network access and nothing extra is installed on disk. You are working with the ANSI Common Lisp standard library that SBCL provides — sequences, hash-tables, CLOS, format, and the like — but no third-party systems.

How do I read input from the user in Common Lisp?

(read-line) returns one line as a string; pass end-of-file handling like (read-line *standard-input* nil "") so reaching the end of input does not raise an error. On XCODX, type into the live terminal — the program blocks at read-line until you press Enter — or paste into the Stdin Box first, closing the stream with Ctrl+D. To read a Lisp value directly, use (read).

Why doesn't my prompt appear before I type?

Standard output is buffered, so a (format t ...) prompt may not show until the buffer flushes. Call (finish-output), or (force-output), right after printing the prompt and before read-line so the text appears first.

Does this support CLOS, macros, and the condition system?

Yes. SBCL implements full ANSI Common Lisp, so the object system (CLOS), defmacro, generic functions, and conditions and restarts all work. What is missing is only the external package ecosystem, not the language itself.

How do I read a number instead of text?

Read the line as a string and convert it, for example (parse-integer (read-line) :junk-allowed t), or use (read) which parses a numeric literal directly. parse-integer is safer when the input might contain stray characters.

Which Lisp implementation and version is this?

It is SBCL, and the exact version is shown in the badge next to the editor. No signup or local install is needed, and every run starts from a clean image with no persistent files.

How Common Lisp runs on XCODX

Sandbox filename
main.lisp
Entry point
single main source file
Editor grammar
commonlisp
Reading stdin
(read)
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

(format t "Hello from Common Lisp!~%")
(format t "Welcome to XCODX Online Compiler!~%")