views:

1728

answers:

10

I usually write web apps in PHP, Ruby or Perl. I am starting the study of Scheme and I want to try some web project with this language. But I can't find what is the best environment for this.

I am looking for the following features:

  • A simple way of get the request parameters (something like: get-get #key, get-post #key, get-cookie #key).
  • Mysql access.
  • HTML Form generators, processing, validators, etc.
  • Helpers for filter user input data (something like htmlentities, escape variables for put in queries, etc).
  • FLOSS.
  • And GNU/Linux friendly.

So, thanks in advance to all replies.

+6  A: 

This may be what you are looking for.

http://www.plt-scheme.org/

http://docs.plt-scheme.org/web-server/index.html

http://common-lisp.net/project/cl-weblocks/

Unknown
A description of the links would be nice.
musicfreak
+9  A: 

You may want to have a look at Clojure:

Clojure is a dynamic programming language that targets the Java Virtual Machine. [...] Clojure provides easy access to the Java frameworks, with optional type hints and type inference, to ensure that calls to Java can avoid reflection.

Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system.

Interop with Java is straightforward in Clojure, so you can re-use any existing Java libraries as you need. I'm sure there are plenty that are useful for web development.

clojure-contrib has an SQL API, and there is ClojureQL as well, which should cover your DB access needs.

There is a web framework for Clojure called Compojure under development. There may be others, too.

Clojure's source is available on github under the EPL. Getting it running on Linux is easy; I just clone the git repos and run ant.

Mike Mazur
Thanks for the reply. I don't have any experience with Java. Is a requirement for clojure setup or use?
Castro
I don't think Java is a requirement; you'll be able to get started with Clojure just fine.
Mike Mazur
Clojure runs on a JVM so you'll need to have one installed. Experience with the Java class library is definitely a plus once you get outside of Clojure's built-in types.
wm_eddie
+19  A: 

PLT Scheme has everything that you need. See the PLT web server tutorial and then the documentation. The web server has been around for a while, and it has a lot of features. Probably the only thing that is not included is a mysql interface, but that exists as a package on PLaneT (the PLT Scheme package distribution tool).

Eli Barzilay
Seconded. The continuation interface is interesting too -- don't worry if it looks confusing though; the rest of the servlet interface still works without it. Wasn't aware of the mysql interface, I'll check that out, thanks!
Aaron
A: 

Clojure would be perfect for this. With some very short, clean code, you can implement some very complex applications, such as blogs or forums.

Imagist
+4  A: 

Paul Graham (and friends) made a lisp dialect specifically for writing basic web applications. It's called Arc, and you can get it at arclanguage.org.

It's probably not suited for really big complex websites and I'm not sure what state it's database support is at but Paul Graham knows how to write web applications in lisp, so Arc will make the HTTP/HTML part easy for you while you spend most of your brain cycles learning the lisp way.

wm_eddie
Should be Arc, not Ark.
JasonFruit
Ah Thanks. I fixed it.
wm_eddie
+3  A: 

I use my own, customized version of Scheme, derived from MzScheme. It has a new, simple web-application framework, a built-in web-server (not the one that comes with MzScheme) and ODBC libraries. (http://spark-scheme.wikispot.org/Web%5Fapplications). The documentation may not be exhaustive, as this is more of a personal tool. But there are lots of sample code in the code repository.

Vijay Mathew
+6  A: 

Try Weblocks, a Common Lisp web framework:

http://weblocks.viridian-project.de/

skypher
+4  A: 

Hi,

Gambit Scheme has its own solution to web apps as well. It uses the Spork framework, based o the Black Hole module system (both by Per Eckerdal).

Andrew Whaley has an initial tutorial on how to get Gambit, Black Hole and Spork running a web app under Apache using mod_proxy. You might want to take a look at that.

On a (possibly) related note, Gambit will also compile your stuff to C and then to an executable, if you feel so inclined.

malvim
+2  A: 

Weblocks is nice tool for building web apps in Common Lisp, but a bit too heavy-weight for me.

We use the following stack:

  • OpenMCL (open source Lisp, very nice)

  • Portable Allegroserve (web server, HTML generator)

  • Our own Rails-like tools for doing Ajaxy stuff

  • A variety of CL libraries like cl-json, cl-smtp, md5

mtraven
+2  A: 

If you are interested in Common Lisp to be exact and do not want to go the weblocks route I would recommend the following setup:

  1. Use SBCL on Linux but with multiple thread support
  2. Use Hunchentoot as a web server which will provide you with all the server processing required including sessions and cookies
  3. Use ClSql to communicate with MySql it has ample documentation and is very stable.
  4. For the HTMl generation you can use Dr Edi Weitz Cl-WHO (very well documented).

Note all the above are under GPL or similar license (one that works more for lisp programs)

Mackram