TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Modern approach to web application development with Common Lisp

44 点作者 kung-fu-master超过 14 年前
Recently, we have started developing web application with Django. Everything is wonderful, but Python is not Lisp and I feel uncomfortable with Python. In the sense that with Python &#38; Django I am restricted. I can't build eDSL to describe application workflows, eDSL for DB access, etc.<p>I want to try rewrite it from scratch in Common Lisp. What web technologies stack to use?<p>SproutCore + Hunchentoot + MongoDB is it right choice?

12 条评论

vog超过 14 年前
Personally, I'd leverage on PostgreSQL rather than MongoDB, because I think relational databases are still the best fit for the majority of modern web applications.<p>Unless, of course, you have a really simple schema so that you want to use the DB as a mere persistence layer. Or you know from the beginning that you'll have to scale really huge. But then, you'd need a highly customized framework anyway, which would somewhat defeat the purpose of writing a general purpose framework in the spirit of Django.<p>Also, PostgreSQL is allows to be <i>extended from inside</i>, thus working much in the spirit of Lisp. It can be extended with plain C code, but has also language support for pgSQL, Perl, Python and Tcl:<p><a href="http://www.postgresql.org/docs/current/static/server-programming.html" rel="nofollow">http://www.postgresql.org/docs/current/static/server-program...</a><p>Unfortunately, language support for Lisp languages is missing yet, but this might be only a matter of time (and would be really great).
评论 #1903726 未加载
Zak超过 14 年前
With any luck, mahmud will be here to talk about real-world CL web development. He's been using CL for web stuff in his startup for a couple years, I think.<p>Another approach for people who are just trying to get something done rather than write a framework to consider is to use CL to do the interesting bits and something else for the web frontend. I've built a couple webapps in CL that would simply have been easier in Rails.
评论 #1903752 未加载
gracchus超过 14 年前
Hunchentoot is a bit odd, but works well. In particular, the fact that handlers (think, like prefix-matching dispatch functions) are global, rather than per-listener. There is, in general, an apparent tendency to use <i>var</i> globals for expediency's sake, but they tend to infiltrate code, and make things harder to debug.<p>I concur with other commentators that PostgreSQL is worth looking at. I wrote the postgres bindings for what is now CL-SQL many years ago (hi stringbot!), and postgres is fast and reliable (aside from SBCL having interrupt hander sensitivities during ffi calls), though again, the CL-SQL interface is littered with globals, the connection pooling is a bit .. unusual .. and the reader macro syntax probably a pretty bad idea, all in all. If hunchentoot and cl-sql were mildly rewritten with an eye towards looking more like, for example, Java's JDBC and Servlet interfaces, you would have a simple base environment where you could reap most of the big CL wins immediately (DSLs, CLOS, coding closer to the speed of thought, etc.)<p>The 'IMHO' sources are kicking around here: they suffered a bit from WebObjects envy (hey, it was the 90's..) and do somewhat suboptimal handling of session state. It's still not clear to me how OO you really want to get with the server-side representation of a page, especially in light of all the nice JS client-side component kits that are around.<p>Mull.
macmac超过 14 年前
How about going 3/4 of the way to Common Lisp and try Clojure instead. Great lightweight web + mongo libs + all the java libs.
评论 #1903799 未加载
stringbot超过 14 年前
Back in the day (around the turn of the century) I worked for a startup building a web application using Common Lisp. We used a framework called IMHO, which was developed in-house by a couple of the lead developers. IMHO seems to have been deprecated, per <a href="http://www.cliki.net/IMHO" rel="nofollow">http://www.cliki.net/IMHO</a> and the source code is nowhere to be found. I am still in touch with the authors, so maybe I can encourage them to make it more available.<p>Using Lisp for a web dev platform was pretty nice. I was a support engineer in those days and I always found it useful to be able to pull up a console and inspect the actual running sessions to debug problems in production.
gibsonf1超过 14 年前
We've been using Portable Allegroserve + mysql (running on SBCL on EC2) with very good results.
评论 #1904757 未加载
评论 #1905551 未加载
smanek超过 14 年前
I'd hesitate about MongoDB - I'm not aware of a mature Mongo-backed ORM, for starters. Personally, I like <a href="http://marijnhaverbeke.nl/postmodern/" rel="nofollow">http://marijnhaverbeke.nl/postmodern/</a>.
评论 #1903771 未加载
vii超过 14 年前
How about tpd2? If you're comfortable rewriting everything from scratch, at least you'll be working from a high performance foundation -- <a href="http://github.com/vii/teepeedee2/tree/master" rel="nofollow">http://github.com/vii/teepeedee2/tree/master</a><p>Weblocks is a very good concept if you're willing to get your head round it, and work within its worldview (which is about displaying widgets rather than manually generating HTML).<p>Everybody uses parenscript, which is a great concept.
评论 #1904501 未加载
WalterGR超过 14 年前
<i>SproutCore + Hunchentoot + MongoDB is it right choice?</i><p>Even then you're not yet off to the races. In particular, Hunchentoot's session management capabilities are anemic out of the box.<p>I haven't seen any drop-in replacements, so you're looking at reinventing at the very least this extremely core part of any web development stack.<p>Hunchentoot also doesn't have any built-in capabilities for handling updates to the website's source code.
评论 #1904539 未加载
sedachv超过 14 年前
Take a look at RESTAS, I think it has some good ideas, and doesn't try to force you to do too many things in certain ways, unlike many other CL web frameworks: <a href="http://restas.lisper.ru/en/" rel="nofollow">http://restas.lisper.ru/en/</a>
pge超过 14 年前
as someone who has written webapps in both lisp and python, I would recommend sticking with python. you have to choose the right tool for the job and get comfortable working with different languages. I am a huge fan of CL, but if you go down that road for a webapp, you will spend a lot of time filling in gaps in the framework instead of focusing on the functionality of your app.<p>Django may be the wrong tool for the job in your case. If so, I recommend exploring some of the more flexible python frameworks like pylons before making the switch to common lisp.
gruseom超过 14 年前
If you're building web apps in CL you should take a close look at Parenscript.