Hello World Scheme

Recently, I wanted to learn the Scheme language. Let’s see how to print “Hello World” using chibi-scheme.

I wanted to use the fastest Scheme compiler because, why not? According to awesome-scheme, it’s Chez scheme[^1]. Chez Scheme doesn’t yet support ARM based Macs. So, I picked chibi-scheme as my scheme compiler. The documentation is so sparse that there is not even “Hello World” example.

I had to look through the source code of chibi-Scheme on its github repository to cobble together our “Hello World” example.

; hello-world.scm

(import (Scheme base) (scheme write))

(display "Hello World!")
(newline)

You can the file as chibi-Scheme hello-world.scm. You can use either .scm or .ss as scheme file extensions.

Why scheme?

I’ve wanted to experiment with Lisp-like language for a lot of time. I feel I broke through my mental barrier to write Lisp sometime ago. So I am just trying out Scheme now. May be I’ll switch to Racket or Clojure after while, but for now, I am starting my journey with Scheme.

Currently I am working through The Little Schemer book. It’s quite a dry book. but it’s full of code examples. They teach Scheme by making you write lots of little programs. Since I have experience with functional programming language likes Haskell and Scala, understanding recursion has been easy so far.