Gol*_*den 11 lisp web-applications common-lisp
我有C#和JavaScript方面的经验,并且在过去的几年里一直在使用Node.js. 基本上,我对这种环境非常有信心,但是一种语言一直引起我的注意:LISP.鉴于其最小的语言概念,我觉得LISP的表现力令人印象深刻且非常吸引人.它与jQuery基本相同:用更少的东西做更多;-)
不幸的是,我对LISP的经验或多或少是理论上的,而且有些玩弄,但不是严肃的编程.
现在我想改变它,但我绝对致力于Web应用程序开发(因此Node.js).我的问题不是学习LISP作为一种语言,我的问题是我不知道在哪里以及如何从"Hello LISP world"应用程序开始,该应用程序不是基于控制台的,而是基于Web的.
所以,我的问题基本上是:如何在LISP中编写类似于以下Node.js应用程序的服务器端Web应用程序
var http = require('http');
http.createServer(function (req, res) {
res.end('Hello world!');
}).listen(3000);
Run Code Online (Sandbox Code Playgroud)
不需要大量的框架和额外的库和东西等等?
经验丰富的LISP程序员如何解决这个问题?任何提示?
hua*_*uan 21
(ql:quickload "hunchentoot")
(hunchentoot:start
(make-instance 'hunchentoot:easy-acceptor :port 3000))
(hunchentoot:define-easy-handler (foo :uri "/bar") (name)
(format nil "Hello~@[ ~A~]!" name))
Run Code Online (Sandbox Code Playgroud)
然后访问
http://127.0.0.1:3000/bar?name=World
Run Code Online (Sandbox Code Playgroud)