问题描述
Clojure 有几个 Web 框架
There are a few web frameworks for Clojure
还有一些用于处理某些 Web 开发子任务的库,例如
and also some libraries for dealing with certain web development subtasks, such as
- Enlive for templating
- Hiccup for templating
- Ring to handle lower level stuff with requests/responses
- ClojureQL for persistence (it doesn't seem very active, though)
还有数百个 Java 库可供使用.有些方面已经在这里和他们两个比较了一下.
There are also hundreds of Java libraries to be used. Some aspects were already discussed here and two of them compared a bit.
我想知道这些框架/组件在成熟度、范围、易于开发、Django/RoR 感觉等方面的比较如何.
I wonder how these frameworks/components compare in terms of maturity, scope, ease of development, Django/RoR feeling, etc.
推荐答案
当我第一次开始 Web 开发时,是使用 Clojure.我没有之前的网络开发经验.我一生都无法弄清楚 Compojure.我不知道从那时起初学者文档是否得到了改进(不是很久以前的),但当时我无法管理它.一位朋友向我推荐了 Mustache,在阅读了自述文件后,我能够将 http://try-clojure.org 放在一起 处于当前状态.所以,就易用性而言,我认为 Mustache 为我准备好了.
When I first started with web development, it was with Clojure. I had no prior experience with web development at all. I could not, for the life of me, figure Compojure out. I don't know if beginner documentation has been improved since then (it wasn't that long ago) or not, but at the time, I couldn't manage it. A friend pointed me to Moustache and after reading the README, I was able to throw together what is http://try-clojure.org in it's current state. So, as far as ease of use goes, I think Moustache takes the cake for me.
但是,如果这个已经存在那时,我可能会唱不同的曲子.
However, if this has existed at the time, I might be singing a different tune.
Conjure 看起来很酷,但与其他框架非常不同.鉴于我在 Web 开发方面的总体经验非常有限,我在这件事上没有太多发言权,但 Conjure 对我来说有点不受欢迎.只是感觉不对.可能只是我不习惯它做事的方式.
Conjure looks very cool, though very different from the other frameworks. Given my very limited experience with web development in general, I don't have much say in this matter, but Conjure feels kind of unclojurey to me. It just doesn't feel right. It may just be that I'm not used to the way it does things.
更新:我写这篇文章已经有一段时间了.很多事情都变了.已经没有多少人使用 Mustache 了,而且它也没有得到真正的积极维护,尽管它足够完整(并且足够简单)以至于它可能仍然有效,我现在建议改用 Compojure 或 Noir.这两个都是当前维护的框架,并且都非常擅长他们的工作.
UPDATE: It has been a while since I wrote this. Lots of things have changed. Not many people use Moustache anymore, and it isn't really actively maintained, though it was complete enough (and simple enough) that it probably still works, I'd now recommend going with Compojure or Noir instead. Both of these are currently maintained frameworks and both are excellent at their job.
更新 2:Noir 已被弃用一段时间,其大部分功能移至一个库中,该库旨在从名为 lib-noir.
UPDATE 2: Noir has been deprecated for quite a while and most of its functionality moved to a library designed to be used from compojure/other ring-based web frameworks called lib-noir.
这篇关于Clojure Web 框架的比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!