[plt-scheme] Choosing language in PLT Scheme

From: John Clements (clements at brinckerhoff.org)
Date: Tue Jan 19 15:05:04 EST 2010

On Jan 19, 2010, at 10:13 AM, Slobodan Blazeski wrote:

> Coming from cl and after learning some Scheme I want to write some real world program in it and the PLT Scheme looks like a the best choice on windows with its nice and modern ide and ability to deploy the application as single executable which is a gift from heaven for me. However I'm completely confused about what language represent in PLT Scheme, is it posible to mix them and which one of them should I use for my application (R5RS, R6RS , Pretty Big, Swindle etc) .
> At minimum I would need fallowing for my application:
> 1. PLT HTTP server  
> 2. OO support (like TinyCLOS or something like that).
> 3. Some database bindings (like SqlLite, MySql, Postgre or whatever RDBMS flavor is available)
> JSON-RPC would be nice but if its not available I'm ready to get my hands dirty and write it myself.
> So my questions are:
> What language should I choose ?  
> How to include all those needed *libraries* ? 
> How do you organize application that is split into several files? (something like common lisp asdf)

The docs included with drscheme (press F1 for help) probably include most of the answers, but it can be nice to have things to search for.

1) You probably want the "module" language, and your files should begin with 

#lang scheme

2) cf. "require". So, you might write:

(require scheme/web-server
         (planet foozle/mysql))

... if only there was a "foozle/mysql" package.  You can check planet.plt-scheme.org to find out what kinds of external libraries are available

Also, OO support is built in.  I betcha there's something good in the "PLT Guide" (part of the built-in docs).

3) You can break your project into files, and then require one from another.

E.G.: if the file "core.ss" contained this:

#lang scheme

(provide the-number)

(define the-number 6)

... and the file "user.ss" contained this:

#lang scheme

(require "core.ss")

(printf "the number is: ~v\n" the-number)

... and they're both in the same directory, this should print out "the number is 6".

Caveat: I haven't run any of this code. I'm sure it's full of bugs.

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20100119/53df41e6/attachment.p7s>

Posted on the users mailing list.