核心亮点
- 两阶段构建: 先编译为C++,再编译为原生二进制文件
- 出色的C++互操作: 可以直接调用C++标准库和任意C++代码
- nREPL服务器: 用jank自身编写,支持NeoVim/Conjure和Emacs/CIDER
- 类型DSL: 自定义语法描述复杂C++类型(模板、指针、引用等)
- 垃圾回收稳定性: 6周时间解决GC问题
- LLVM 22兼容: 解决上游API变更带来的性能回归(启动时间从1分钟降至1秒)
- 社区支持: Clojurists Together赞助,Github sponsors支持
技术细节
"The new nREPL is crazy fun to play around with. Works seamlessly with my editor (NeoVim + Conjure). It's hard to describe the experience of compiling C++ code interactively - I'm so used to long edit-compile-run loops and debuggers that it feels disorienting (in a good way!)"
— Matthew Perry, early jank nREPL adopter
jank允许在ns宏中直接include C++头文件,并使用:refer-global引用全局符号:
(ns foo
(:include "gl/gl.h")
(:refer-global :only [glClear GL_COLOR_BUFFER_BIT]))
(defn clear! []
(glClear GL_COLOR_BUFFER_BIT))
分类标签
下一步计划
作者计划在Q2专注于性能优化,建立持续基准测试,目标是让jank在性能上接近原生C++。