Ribbit's R4RS Repl with type checks

This is the R4RS compliant REPL in Javascript in only KB. The whole repl logic is contained inside the repl_r4rs_tc.js file. Check out the examples below to see what it is capable of!

If you are wondering how we acheived such a small size, see our papers here

If you want to see a smaller version without type checks, click here.

To interact with the REPL, type your scheme code below and press enter. You can also click on any of the examples, and they will be run in the REPL.

Examples

Click on any example to run it in the REPL

;; Type checking included
(+ "foo" 3)
(define (fact n)
  (if (= n 0)
    1
    (* n (fact (- n 1)))))
(fact 10)
(define (fib x) 
  (if (< x 2)
    x 
    (+ (fib (- x 1)) 
       (fib (- x 2)))))
(fib 10)
(apply
  +
  (map 
    (lambda (x) (* x x))
    '(0 1 2 3 4 5 6 7 8 9 10)))
(define cont #f)
(+ 2 
  (call/cc 
    (lambda (k) 
      (set! cont k) 
      4)))
(cont 10)
(define x 42)
(define 
  favorite 
  '(my favorite number is))
`(,@favorite ,x)