98

是否有可以用作“最佳实践”示例的中型 Clojure 示例应用程序,以及查看此类应用程序在代码和代码组织方面的外观的好方法?Web 应用程序对我来说特别有趣,但最重要的是该程序可以做一些通常有用的事情(例如博客、错误跟踪、CMS),而不是我从未在现实中实现过的数学运算世界(解决 N 皇后问题、模拟生活、生成斐波那契数列,以及函数编程语言的常见票价)。

谢谢!

4

14 回答 14

42

I recommend cow-blog by Brian Carper. According to the author it was written with your purpose in mind.

于 2009-12-14T16:48:26.317 回答
19

如果您浏览clojure-contrib源代码,您可以看到库是如何在 clojure 中实现的。

您还可以在同一源代码树下签出“ ClojureScript ”。

允许用非常小的 Clojure 子集编写的代码自动转换为 JavaScript。

ClojureScript 翻译器是一个完整的 Clojure 应用程序。

如果您还没有的话,我还建议您查看 Stewart Halloway 的Port of Practical Common Lisp 示例到 Clojure 。

于 2008-11-30T19:45:29.100 回答
15

Take a look at Compojure. It's a web framework written in Clojure, so it allows you to write and run (on an embedded Jetty) useful web apps in Clojure, and also serves as a good example of a sizable chunk of real-world Clojure code.

It's under active development and has a helpful Google Group.

于 2009-02-11T10:14:36.250 回答
10

查看 Clojure 的作者 Rich Hickey 编写的 ant 演示:

http://clojure.googlegroups.com/web/ants.clj

这里有一些很好的说明,可以将它与 emacs 开发环境一起设置:

http://riddell.us/clojure

另请查看与此代码一起使用的 Rich 的演示文稿:

http://blip.tv/file/812787

于 2008-11-30T20:34:14.337 回答
7

Clojure itself is a good example of Clojure best practices. Read towards the bottom of Core.clj, good stuff.

于 2009-07-16T16:59:52.677 回答
6

http://4clojure.com

4Clojure is an open source website where you can solve interactive fill-in-the-blank Clojure problems.

于 2011-05-06T20:54:58.580 回答
5

I think that Compojure is probably the best way to go for an example. I doubt it's a "medium sized" example, but there's probably subsections of it that are small that would work. At least, that's going to be my approach. smiles

Also, check out

http://github.com/technomancy/mire/tree/master

which is a small m.u.d. client prototype built in clojure, the advantage being that it's totally self-contained, and probably pretty simple, including the concepts involved. Documentation, eh, it's jus' alright, but the concepts in the code tie very closely to the action elements of the M.U.D. that runs easily.

于 2009-07-23T16:59:06.277 回答
5

We're two years on from this question and, whilst that's still early in the cycle for a language, Clojure is definitely being used for serious production work. At World Singles, we have several thousand lines of Clojure in production that handle all sorts of general purpose tasks in our web platform - I blogged about this in my Real World Clojure series.

For some reasonably large open source projects - not exactly applications, but high-profile infrastructure - you could look at Storm from Twitter and Cascalog from BackType (now part of Twitter). 4clojure.com has been mentioned as an open source web application, that's worth a look too, but note the new github repo for 4clojure.

于 2011-11-24T03:15:20.850 回答
3

A positive sign: there is an article on InfoQ about "one of the first published reports of Clojure being used in a large-scale production deployment." It doesn't appear to be open, but at least it is a sign of Clojure being used in a mission critical application in the real production world. A big step for the Clojure community.

于 2009-02-02T20:33:13.790 回答
2

http://code.google.com/p/lighttexteditor/

You could try light text editor

于 2009-07-16T15:33:51.133 回答
1

You can take a look here: http://bitbucket.org/kumarshantanu/blogjure/overview/

It is a tiny blog application written using Hibernate, Compojure and StringTemplate that actually works!

于 2009-10-15T12:41:12.657 回答
1

I can only recommend you to check out Pedestal, a very promising web framework, both server-side and client-side (where it facilitates ClojureScript). The gui stuff is a bit hard to grasp, but quite much the way it should be done to stay sane in a large app.

于 2013-09-16T07:18:10.243 回答
1

edge is a moderately sized application showcasing structuring an application with Clojure, ClojureScript, Component, Yada, Aero, and Boot.

于 2017-05-01T05:01:21.963 回答
0

Clojure is still too young and a moving target to have medium sized applications with available source code yet.

于 2008-12-05T13:44:30.290 回答