Three Hello Worlds

The classic first program in any language is, of course the “Hello World” program. Here then, are three different version of “Hello World” written in PLT Scheme.

Console based (from Teach Yourself Scheme in Fixnum Days):

  (display "Hello, World!")

Web based (example program that comes with PLT Scheme servlet library):

(require (lib "")
         (lib "" "web-server"))

(unit/sig () (import servlet^)

  (define the-text "Hello, Web!")

  `(html (head (title ,the-text))
         (body ([bgcolor "white"])
               (p ,the-text))))

And finally, GUI Based (written by me):

(define greeting "Hello world!")
(define frame (instantiate frame% (greeting)))
(define msg (instantiate message% (greeting frame)))
(send frame show #t)

I still don’t know what the hell I’m doing, but it’s a start right?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s