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.
Racket calls itself a language for making languages — a Scheme descendant re-engineered by the PLT group into a platform where building a new #lang is a library exercise. That research pedigree translated into a teaching empire: 'How to Design Programs' and its student languages introduced program design to a generation of CS students, and Racket still anchors intro and programming-languages courses at Northeastern, Waterloo, Utah, and beyond. The current 8.x series runs on the Chez Scheme backend for a substantially faster runtime. It's also simply a pleasant modern Scheme with batteries: pattern matching, contracts, structs, and big standard libraries. Run Racket on this page in an interactive terminal — read-line takes your typed input live, no DrRacket required.
#lang racket
(display "What's your name? ")
(flush-output)
(define name (read-line))
(printf "Hello, ~a!\n" name)
(display "Enter integers separated by spaces: ")
(flush-output)
(define nums (map string->number (string-split (read-line))))
(printf "Sum: ~a\n" (apply + nums))
(printf "Squares: ~a\n" (map (lambda (n) (* n n)) nums))
(printf "Evens only: ~a\n" (filter even? nums))
(printf "Folded product: ~a\n" (foldl * 1 nums))
If your course uses 'How to Design Programs' or covers interpreters and continuations, Racket is your daily driver — and this page lets you run full #lang racket programs from any device when DrRacket isn't installed, such as a library computer or tablet keyboard setup. It's equally good for practicing the functional core that exams test: map/filter/foldl, recursion on lists, higher-order functions, and tail calls. Developers curious about language-oriented programming can prototype S-expression manipulation here before diving into Racket's macro system locally.
Yes — both block until you type input, because the program runs against a live terminal rather than a canned stdin. Call (flush-output) after display-ing a prompt without a newline so it appears before the pause. Sequential prompts, then computation, then more prompts all behave as expected.
Yes — a Racket source file begins with a #lang declaration that selects the language, and #lang racket is the standard full language. This is core to Racket's design: the same runtime hosts teaching languages, typed/racket, and user-defined languages. Omitting the line is the most common beginner error.
Programs here run under #lang racket with the main distribution's bundled collections; there is no raco pkg install for third-party packages. HtDP student languages are designed for DrRacket's UI, so translate exercises to plain Racket — usually just swapping (check-expect ...) for direct calls or simple equal? tests.
main.rktschemeread-line#lang racket
(displayln "Hello from Racket!")
(displayln "Welcome to XCODX Online Compiler!")