欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Clojure
小 |
小 (→IDE和Editor) |
||
(未显示1个用户的29个中间版本) | |||
第6行: | 第6行: | ||
==简介== | ==简介== | ||
− | Clojure 是一个面向[[Java Virtual Machine|JVM]] | + | [[文件:clojure-logo-120b.png|right]] |
+ | Clojure 是一个面向[[Java Virtual Machine|JVM]] 动态的通用编程语言,采用 Eclipse Public License 1.0 许可证。 | ||
[[Lisp]] 是一种编程语言,以表达性和功能强大著称,但人们通常认为它不太适合应用于一般情况。Clojure 是一种运行在 [[Java]]平台上的 Lisp 方言,它的出现彻底改变了这一现状。如今,在任何具备 Java 虚拟机的地方,您都可以利用 Lisp 的强大功能。 | [[Lisp]] 是一种编程语言,以表达性和功能强大著称,但人们通常认为它不太适合应用于一般情况。Clojure 是一种运行在 [[Java]]平台上的 Lisp 方言,它的出现彻底改变了这一现状。如今,在任何具备 Java 虚拟机的地方,您都可以利用 Lisp 的强大功能。 | ||
Clojure is about Data, [[Scala]] is about Types, [[Java]] is about Objects. | Clojure is about Data, [[Scala]] is about Types, [[Java]] is about Objects. | ||
− | |||
− | |||
[https://blog.cleancoder.com/uncle-bob/2019/08/22/WhyClojure.html Why Clojure?] | [https://blog.cleancoder.com/uncle-bob/2019/08/22/WhyClojure.html Why Clojure?] | ||
==版本== | ==版本== | ||
+ | [https://clojure.org/about/history A History of Clojure] | ||
==功能== | ==功能== | ||
− | == | + | ==编译器== |
+ | [[文件:SCI-logo.png|right|SCI]] | ||
*[https://github.com/clojure/clojure-clr ClojureCLR] 基于 Microsoft Dynamic Language Runtime (DLR) 和.NET Common Language Runtime (CLR),[[C Sharp|C#]] 和 Clojure 编写。 | *[https://github.com/clojure/clojure-clr ClojureCLR] 基于 Microsoft Dynamic Language Runtime (DLR) 和.NET Common Language Runtime (CLR),[[C Sharp|C#]] 和 Clojure 编写。 | ||
*[[ClojureScript]] | *[[ClojureScript]] | ||
+ | *[https://github.com/babashka/sci Small Clojure Interpreter (SCI)] | ||
==语言== | ==语言== | ||
+ | [[文件:Clojerl-logo.png|right|Clojerl]] | ||
*[https://github.com/clj-python/libpython-clj Python bindings for Clojure] | *[https://github.com/clj-python/libpython-clj Python bindings for Clojure] | ||
+ | *[https://www.clojerl.org/ clojerl: Clojure for the Erlang VM] | ||
由[[Clojure]]开发的编程语言: | 由[[Clojure]]开发的编程语言: | ||
*[https://github.com/jeaye/jank jank] | *[https://github.com/jeaye/jank jank] | ||
第33行: | 第37行: | ||
==指南== | ==指南== | ||
− | wget | + | 通过 [[Leiningen]] 安装是推荐方式 |
+ | |||
+ | [https://www.baeldung.com/clojure Introduction to Clojure] | ||
+ | wget https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0/clojure-1.8.0.jar | ||
java -cp clojure-1.8.0.jar clojure.main | java -cp clojure-1.8.0.jar clojure.main | ||
user=> (+ 1 2 3) | user=> (+ 1 2 3) | ||
第41行: | 第48行: | ||
user=> (hello) | user=> (hello) | ||
"Hello world" | "Hello world" | ||
− | 或使用 Leiningen REPL,它比 Clojure 自带的 REPL 好很多。 | + | 或使用 [[Leiningen]] REPL,它比 Clojure 自带的 REPL 好很多。 |
lein repl | lein repl | ||
Web应用启动: | Web应用启动: | ||
lein run 或 lein ring server | lein run 或 lein ring server | ||
+ | |||
+ | ==Evaluation== | ||
+ | [[文件:traditional-evaluation.png]] [[文件:clojure-evaluation.png]] | ||
==Windows== | ==Windows== | ||
第85行: | 第95行: | ||
==fn,def,defn== | ==fn,def,defn== | ||
[https://clojuredocs.org/clojure.core/fn fn] [https://clojuredocs.org/clojure.core/def def]和[https://clojuredocs.org/clojure.core/defn defn] | [https://clojuredocs.org/clojure.core/fn fn] [https://clojuredocs.org/clojure.core/def def]和[https://clojuredocs.org/clojure.core/defn defn] | ||
+ | |||
+ | defn builds on fn,defn是一个宏,它封装了def和fn的功能。 | ||
fn 创建一个匿名函数,fn 和 lambda 类似。 | fn 创建一个匿名函数,fn 和 lambda 类似。 | ||
第105行: | 第117行: | ||
==数据分析== | ==数据分析== | ||
− | + | 统计、数据分析和商业智能 | |
+ | *[[Incanter]] | ||
*[[Metabase]] | *[[Metabase]] | ||
第140行: | 第153行: | ||
==验证授权== | ==验证授权== | ||
+ | *[https://github.com/jgrodziski/keycloak-clojure keycloak-clojure] [[Keycloak]] [[文件:keycloak-plus-clojure.png|right]] | ||
*[[Friend]] | *[[Friend]] | ||
*[https://github.com/clojurewerkz/scrypt Clojure Scrypt Library] | *[https://github.com/clojurewerkz/scrypt Clojure Scrypt Library] | ||
第154行: | 第168行: | ||
===SQL=== | ===SQL=== | ||
*[https://github.com/korma/Korma Korma] Tasty SQL for Clojure | *[https://github.com/korma/Korma Korma] Tasty SQL for Clojure | ||
− | *[https://github.com/ | + | *[https://github.com/seancorfield/honeysql Honey SQL] Turn Clojure data structures into SQL |
*[https://github.com/krisajenkins/yesql yesql] https://github.com/krisajenkins/yesql | *[https://github.com/krisajenkins/yesql yesql] https://github.com/krisajenkins/yesql | ||
第197行: | 第211行: | ||
==IDE和Editor== | ==IDE和Editor== | ||
+ | *[[logseq]] 写作平台 | ||
+ | *[https://github.com/clojure-emacs/cider CIDER] extends [[GNU Emacs]] is the Clojure(Script) Interactive Development Environment that Rocks! | ||
*[[Light Table]] | *[[Light Table]] | ||
*[https://github.com/oakes/Nightcode Nightcode] | *[https://github.com/oakes/Nightcode Nightcode] | ||
第211行: | 第227行: | ||
==GUI== | ==GUI== | ||
*[https://github.com/daveray/seesaw Seesaw] | *[https://github.com/daveray/seesaw Seesaw] | ||
+ | *[https://github.com/cljfx/cljfx Cljfx] | ||
==项目== | ==项目== | ||
+ | [https://github.com/razum2um/awesome-clojure Awesome Clojure] [[image:awesome.png]] | ||
+ | [[文件:Status-logo.png|right|Status]] | ||
+ | *[https://github.com/clojure Clojure @ GitHub] | ||
*[https://github.com/clojurewerkz ClojureWerkz]团队开发了众多开源项目 | *[https://github.com/clojurewerkz ClojureWerkz]团队开发了众多开源项目 | ||
+ | *[https://github.com/status-im Status] A Mobile [[Ethereum]] Client. | ||
*[[Apache Storm]] | *[[Apache Storm]] | ||
*[https://github.com/Raynes/tryclojure tryclojure] | *[https://github.com/Raynes/tryclojure tryclojure] | ||
*[[ClojureScript]] | *[[ClojureScript]] | ||
+ | *[https://github.com/clojure/test.check test.check] [https://github.com/BurntSushi/quickcheck QuickCheck] for Clojure | ||
*[[incanter]] | *[[incanter]] | ||
*[[Ring]] | *[[Ring]] | ||
第232行: | 第254行: | ||
*[https://github.com/zcaudate/cronj cronj] cron for clojure | *[https://github.com/zcaudate/cronj cronj] cron for clojure | ||
*[https://github.com/kyleburton/clj-bloom clj-bloom] | *[https://github.com/kyleburton/clj-bloom clj-bloom] | ||
+ | *[https://github.com/cognitect Cognitect] [https://github.com/cognitect-labs Cognitect Labs] | ||
==文档== | ==文档== | ||
第258行: | 第281行: | ||
image:clojure-dev-process.png|开发工作流 | image:clojure-dev-process.png|开发工作流 | ||
image:cider-architecture.png|CIDER架构 | image:cider-architecture.png|CIDER架构 | ||
+ | image:re-frame-event-dispatch.png|re-frame | ||
+ | image:re-frame-handling-one-event.png|re-frame | ||
+ | image:re-frame-interceptors.png|re-freme拦截器 | ||
+ | image:transit-overview.png|Transit | ||
+ | image:logseq-graph.png|logseq | ||
+ | image:clojerl-windows.png|clojerl,Clojure on Erlang VM | ||
+ | |||
</gallery> | </gallery> | ||
==链接== | ==链接== | ||
*[http://clojure.org/ Clojure官网] | *[http://clojure.org/ Clojure官网] | ||
− | |||
*[http://qiujj.com/static/clojure-handbook.html Clojure Handbook] | *[http://qiujj.com/static/clojure-handbook.html Clojure Handbook] | ||
*[http://blog.cognitect.com/blog/?tag=Clojure Clojure Blog] | *[http://blog.cognitect.com/blog/?tag=Clojure Clojure Blog] | ||
*[http://planet.clojure.in/ Planet Clojure] | *[http://planet.clojure.in/ Planet Clojure] | ||
− | |||
*[https://clojars.org/ Clojars] | *[https://clojars.org/ Clojars] | ||
*[http://www.clojure-toolbox.com/ The Clojure Toolbox] | *[http://www.clojure-toolbox.com/ The Clojure Toolbox] |
2023年4月19日 (三) 07:55的最后版本
您可以在Wikipedia上了解到此条目的英文信息 Clojure Thanks, Wikipedia. |
Clojure
目录 |
[编辑] 简介
Clojure 是一个面向JVM 动态的通用编程语言,采用 Eclipse Public License 1.0 许可证。
Lisp 是一种编程语言,以表达性和功能强大著称,但人们通常认为它不太适合应用于一般情况。Clojure 是一种运行在 Java平台上的 Lisp 方言,它的出现彻底改变了这一现状。如今,在任何具备 Java 虚拟机的地方,您都可以利用 Lisp 的强大功能。
Clojure is about Data, Scala is about Types, Java is about Objects.
[编辑] 版本
[编辑] 功能
[编辑] 编译器
- ClojureCLR 基于 Microsoft Dynamic Language Runtime (DLR) 和.NET Common Language Runtime (CLR),C# 和 Clojure 编写。
- ClojureScript
- Small Clojure Interpreter (SCI)
[编辑] 语言
由Clojure开发的编程语言:
[编辑] 指南
通过 Leiningen 安装是推荐方式
wget https://repo1.maven.org/maven2/org/clojure/clojure/1.8.0/clojure-1.8.0.jar java -cp clojure-1.8.0.jar clojure.main user=> (+ 1 2 3) 6 user=> (def hello (fn [] "Hello world")) #'user/hello user=> (hello) "Hello world"
或使用 Leiningen REPL,它比 Clojure 自带的 REPL 好很多。
lein repl
Web应用启动:
lein run 或 lein ring server
[编辑] Evaluation
[编辑] Windows
C:\huihoo\clojure>powershell -noprofile -executionpolicy bypass -file .\win-install-1.10.1.469.ps1
PS C:\huihoo\clojure> clj -h
PS C:\huihoo\clojure> clj -r
Clojure 1.10.1 user=>
[编辑] Leiningen
使用leiningen工具来管理Clojure项目和Java配置。
brew install leiningen
或者获得 https://raw.github.com/technomancy/leiningen/preview/bin/lein 并放到 /bin 目录下,chmod 755
cd bin,执行 ./lein // 开始安装 Leiningen
lein help
lein help $TASK for details.
接着:
lein new start-clojure cd start-clojure lein repl 将获得一些jar,如: Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.jar ... user=> (println "Give me some Clojure!") Give me some Clojure! nil
[编辑] 插件
[编辑] fn,def,defn
defn builds on fn,defn是一个宏,它封装了def和fn的功能。
fn 创建一个匿名函数,fn 和 lambda 类似。
user=> (map (fn [x] (* x x)))
def 可以将一个匿名函数绑定到一个name上。
user=> (def my-function (fn [x] (* x x )))
defn 是 def 与 fn 的简写。
user=> (defn my-function [x] (* x x))
[编辑] Clojars
- Clojars: Clojure libraries
- Third-party templates
[编辑] 大数据
- Apache Storm
- Cascalog, 基于Apache Hadoop的数据处理。
- Onyx
- Sparkling - A Clojure API for Apache Spark
- PigPen Map-Reduce for Clojure
[编辑] 数据分析
统计、数据分析和商业智能
[编辑] 机器学习
- clj-ml
- deeplearning4j
- nurokit Toolkit for machine learning in Clojure.
- k9
[编辑] 计算机视觉
[编辑] 自然语言处理
[编辑] 消息通信
- Langohr
- Machine Head, a Clojure MQTT Client
- ZeroMQ Async
[编辑] 事件CEP
[编辑] 并行并发
- Clojure web server benchmarks
- pulsar: Actor model 实现
- core.async Go式轻量级线程,⻓得像同步的异步.
- Avout: Distributed State in Clojure
[编辑] 金融货币
- ClojureWerkz Money a Clojure Library to Work With Money
[编辑] 验证授权
- keycloak-clojure Keycloak
- Friend
- Clojure Scrypt Library
- Buddy - Security library for clojure.
[编辑] 数据库存储
- Datomic
- DataScript
- Clojure libraries for MongoDB, RabbitMQ, validations, Neo4J, ElasticSearch, Apache Cassandra, Riak, Memcached, stream processing
- hikari-cp 连接池
- clj-record 类似 Ruby on Rails ActiveRecord
- PuppetDB
[编辑] SQL
- Korma Tasty SQL for Clojure
- Honey SQL Turn Clojure data structures into SQL
- yesql https://github.com/krisajenkins/yesql
[编辑] PostgreSQL
[编辑] MongoDB
Clojure Monger, Monger @ GitHub
[编辑] Cassandra
- cassaforte 建议:暂不使用高版本Cassandar,因为可能不支持。
- alia: High performance Cassandra client for clojure
- hayt: CQL3 DSL for Clojure
[编辑] Redis
[编辑] HBase
[编辑] BI
[编辑] Elasticsearch
[编辑] Web HTTP
- ring
- Compojure
- clj-http
- http-kit
- aleph built on top of Netty
- Cheshire
- necessary-evil XML-RPC
- nginx-clojure
- Pedestal
- Hiccup
[编辑] RESTful API
- compojure-api with Compojure & Swagger
- liberator
- ring-swagger, Swagger Spec for Clojure Web Apps
- Sweet-Liberty
[编辑] IDE和Editor
- logseq 写作平台
- CIDER extends GNU Emacs is the Clojure(Script) Interactive Development Environment that Rocks!
- Light Table
- Nightcode
- Cursive IDE
- CCW IDE
- Nightcode
- clooj, a lightweight IDE for clojure
- Catnip, A web based Clojure IDE
- clojure-emacs for Emacs
- Clojure with Emacs
- SublimeREPL for SublimeText
- fireplace.vim: Clojure REPL support
[编辑] GUI
[编辑] 项目
- Clojure @ GitHub
- ClojureWerkz团队开发了众多开源项目
- Status A Mobile Ethereum Client.
- Apache Storm
- tryclojure
- ClojureScript
- test.check QuickCheck for Clojure
- incanter
- Ring
- Compojure
- CravenDB文档数据库
- CircleCI's frontend
- Enlive
- Conjure A Rails like framework for Clojure.
- Boot: Build tooling for Clojure
- cljsjs
- alda 音乐编程语言
- 用 overtone 来演奏歌曲
- schema 数据描述与验证
- Timbre 日志库
- cronj cron for clojure
- clj-bloom
- Cognitect Cognitect Labs
[编辑] 文档
[编辑] 图书
[编辑] 用户
- Cognitect, Clojue之父,Rich Hickey 是该公司Co-Founder & CTO。
- 花旗信用实时风险估值系统Java/Clojure后端(1500节点分布计算)花旗投资信用部实时风险计算系统,逻辑使用Clojure。
- Puppet: Puppet Server, Trapperkeeper, PuppetDB, Trapperkeeper Webserver Service
- 沃尔玛: “Our Clojure system just handled its first Walmart black Friday and came out without a scratch.” - Walmart Labs
- Riemann
- LeanCloud 采用了多种语言混合来构建整个后端系统,包括 Clojure、Java、Node.js、Scala 等。其中 Clojure 构建了整个网站门户、存储开放 API、推送、聊天等核心服务,Node.js构建了云端代码服务(类似应用代码托管),我们还使用 Scala 编写的 Spark 任务来处理离线数据分析,此外,还有大量的统计类 MapReduce 任务使用 Java 编写并运行在 Hadoop 集群上。不同服务之间使用 RESTful 协议、RPC 框架或者队列进行通信。
[编辑] 图集
[编辑] 链接
- Clojure官网
- Clojure Handbook
- Clojure Blog
- Planet Clojure
- Clojars
- The Clojure Toolbox
- ClojureDocs
- Grimoire - Community Clojure Documentation
- Clojure API 中文文档, Clojure API 文档的中文计划
- CrossClj: cross-referencing the Clojure ecosystem
- 4Clojure, 4clojure @ github
- A Brief Beginner's Guide To Clojure
- Data Sorcery with Clojure
- http://groups.google.com/group/clojure
- Clojure 语言的设计
- Clojure 编程语言
- FlightCaster秘笈——Clojure和Rails
- ClojureScript通过Javascript将Clojure引入到浏览器端
- Java 下一代: Groovy、Scala 和 Clojure
- 研究指出:Clojure、CoffeeScript和Haskell是表现力最强的通用语言
- Best In Class