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.
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.
;; 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)))
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.
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.
(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).
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.
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.
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.
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.
main.lispcommonlisp(read)(format t "Hello from Common Lisp!~%")
(format t "Welcome to XCODX Online Compiler!~%")