Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I do web programming with Lisp or Scheme?

Tags:

lisp

scheme

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.

like image 988
Castro Avatar asked Aug 14 '09 01:08

Castro


People also ask

Is lisp good for web development?

For web development as for any other task, one can leverage Common Lisp's advantages: the unmatched REPL that even helps to interact with a running web app, the exception handling system, performance, the ability to build a self-contained executable, stability, good threads story, strong typing, etc.

Is JavaScript based on Lisp?

Yes, JavaScript is a Lisp.

Is clojure better than Common Lisp?

Clojure is really your better bet. It is highly practical with a good community and excellent Java interop. You never have to worry about finding a good library. The syntax is also a bit more easily parsable than CL.


4 Answers

Racket has everything that you need. See the Racket 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 (Racket package distribution tool).

UPDATE: Racket now comes with DB support, works with several DBs including mysql.

like image 101
Eli Barzilay Avatar answered Oct 17 '22 06:10

Eli Barzilay


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.

like image 29
Mike Mazur Avatar answered Oct 17 '22 08:10

Mike Mazur


You can do web development with guile scheme. Its standard library includes the (sxml simple) module that is very useful for html generation, manipulation, and parsing. The guile-www library adds support for http, cgi, etc. The guile-dbi library provides access to MySQL and other databases. With these building blocks, you can implement everything from simple cgi scripts to web applications with their own HTTP server.

like image 18
gcbenison Avatar answered Oct 17 '22 07:10

gcbenison


Try Weblocks, a Common Lisp web framework:

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

like image 15
Leslie P. Polzer Avatar answered Oct 17 '22 06:10

Leslie P. Polzer