About the Racket compiler
A Lisp for building languages. Compiled online. Run Racket code in your browser with no install and no signup — the editor, the input and the output share one screen. Racket is executed by a remote runtime: your code is submitted to it and the output is returned to this page.
Press Run to execute the program, edit it and press Run again, or paste your own code over it. Everything you type stays in the page; the editor caches your work locally so a reload does not lose it.
A Racket example
This is the program the Racket editor opens with — run it as it is, then change it.
#lang racket
(displayln "Racket Demo")
(displayln "")
;; Student data structure
(struct student (name scores) #:transparent)
(define students
(list (student "Alice" '(92 88 95))
(student "Bob" '(87 91 83))
(student "Charlie" '(95 90 98))
(student "Diana" '(78 82 75))))
(define (average s)
(/ (apply + (student-scores s)) (length (student-scores s))))
(define (grade avg)
(cond [(>= avg 90) "A"] [(>= avg 80) "B"] [(>= avg 70) "C"] [else "D"]))
(displayln "Student Report:")
(displayln (make-string 40 #\-))
(define sorted (sort students > #:key average))
(for ([s sorted] [i (in-naturals 1)])
(printf " ~a. ~a ~a [~a]\n" i
(~a (student-name s) #:min-width 10)
(~r (average s) #:precision '(= 1))
(grade (average s))))
;; Fibonacci
(define (fib n)
The editor opens with the full program.
More Functional compilers
Browse all 109 languages — the same editor runs each of them, in the browser or on a shared runner.