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.
Emacs Lisp is the language that makes GNU Emacs less an editor than an operating environment: every keybinding, mode, and package, from Magit to Org-mode, is elisp, and the editor's forty-plus years of extensibility rest on it. It is a real Lisp dialect with dynamic and lexical binding, macros, and an enormous built-in function library, and since Emacs 28 it can even native-compile to machine code. You do not need Emacs open to run it: this page executes your script in batch mode inside a live terminal, where message output streams instantly and read-string actually pauses to accept the line you type, making it a genuine playground for learning elisp fundamentals.
;; Emacs Lisp running in batch mode
(defun square (n) (* n n))
(defun fizzbuzz (n)
(cond ((zerop (mod n 15)) "FizzBuzz")
((zerop (mod n 3)) "Fizz")
((zerop (mod n 5)) "Buzz")
(t (number-to-string n))))
(message "Hello from Emacs Lisp!")
(dolist (n '(1 2 3 4 5))
(message "%d squared is %d" n (square n)))
(message "FizzBuzz 1..15: %s"
(mapconcat #'fizzbuzz (number-sequence 1 15) " "))
(let ((name (read-string "What is your name? ")))
(message "Happy hacking, %s!" name))
The audience here is anyone customizing Emacs: developers debugging a snippet from their init.el, package authors testing a function in isolation, and Org-mode power users prototyping helpers before pasting them into their config. It also works as a general Lisp teaching tool, since defun, let, cond, and mapconcat demonstrate core functional idioms without installing SBCL or Racket. Interview-style exercises in list processing map naturally onto elisp, and longtime Vim users curious about the other side can inspect what Emacs configuration code actually looks like.
Yes. In batch mode, minibuffer-reading functions like read-string fall back to standard input, and because this page attaches a real terminal, the call blocks until you type a line. That lets configuration snippets that normally ask questions in the minibuffer run interactively, with (message ...) providing the streaming output channel.
The file runs under Emacs in batch (script) mode, the same headless mechanism used for building packages and running elisp test suites in CI. Everything about the language works: buffers can be created and manipulated in memory, string and list functions behave normally, and only window, frame, and display operations are meaningless without a UI.
Yes, and this surprises newcomers: buffers are just in-memory text objects, so with-temp-buffer, insert, goto-char, and re-search-forward all work headlessly. That makes batch elisp genuinely useful for text processing experiments, and it is how many packages implement parsing internally. You simply print results with message or princ instead of viewing the buffer.
main.elcommonlispread-string; Emacs Lisp
(message "Hello from Emacs Lisp!")
(message "Welcome to XCODX Online Compiler!")
;; List operations
(let ((numbers '(1 2 3 4 5)))
(message "Numbers: %s" numbers)
(message "Sum: %d" (apply #'+ numbers))
(message "Doubled: %s" (mapcar (lambda (x) (* x 2)) numbers)))
Emacs echoes its output on both the pty and stderr. The duplicate copy is collapsed so each line appears once.