Jolt – 会说 C 的 Clojure
Jolt – Clojure that speaks C

原始链接: https://jolt-lang.net/

此 Clojure 实现提供用于绑定共享库的原生 C FFI,被数据库和 HTTP 库使用;支持带静态链接依赖的提前编译独立二进制文件;提供可编译自身的自托管编译器,目标为 Scheme/JavaScript;提供 JVM 风格的操作系统线程并发以及 core.async;具有不可变持久集合及 transient;并广泛兼容 Clojure,包括惰性 seq、transducer、多方法、协议、元数据、命名空间、eval 和 reader。

Hacker News 讨论了 Jolt,一种以 C 为目标、支持 FFI 的 Clojure 语言,旨在运行许多 JVM 上的 Clojure 库。评论将其与 jank(一种支持 C/C++ 互操作的原生 Clojure 方言)比较;jank 的作者指出差异,包括 jolt 的 AI 辅助开发和缺乏披露。Jolt 的作者为 AI 使用辩护,称项目有 AI 政策,并强调代码质量、规格和测试。随后围绕大型代码库能否被完全理解、模块化设计和 LLM 辩护展开辩论;一些用户称赞 jolt,而另一些批评其不可读的 README 和 Makefile。最后一条评论提到还有几个无关的同名 Jolt 项目。
相关文章

原文

Native C FFI

Bind any C shared library: declare it, wrap functions with defcfn, call them with Clojure values. The db library reaches SQLite and Postgres this way; http-client binds OpenSSL and zlib.

Standalone Binaries

jolt build ahead-of-time compiles a project (runtime, standard library, app, and its deps) into a single self-contained executable, with C dependencies linked statically. No Chez, no JVM, no source needed to run it.

Self-Hosted Compiler

Reads Clojure, analyzes it to a host-neutral IR, emits Scheme, and runs it: on Chez natively, or on Gambit compiled to JavaScript. The compiler is written in Clojure and compiles itself; Chez runs interpreted and compiled code identically, so the REPL and a built binary behave the same.

Real Concurrency

future/promise/agent/pmap run on OS threads over a shared heap, matching JVM semantics. core.async provides channels and go blocks.

Persistent Data Structures

Immutable vectors (32-way tries), cons lists, and HAMT maps/sets with Clojure value semantics. Transients are real mutable scratch collections.

Clojure-Compatible

Lazy/infinite seqs, transducers, destructuring, multimethods, protocols/records, metadata, namespaces, runtime eval, and the full reader.

联系我们 contact @ memedata.com