[ANN] zprint 0.4.9 -- super fast startup with native image

186 views
Skip to first unread message

Kim Kinnear

unread,
May 17, 2018, 10:21:04 PM5/17/18
to Clojure
Announcing a new version of zprint, the Clojure source and data formatting tool (pretty-printer) which will format code and data for maximum visual clarity.   

You can get it here:


New features:
  1.  A native-image version of the zprint-filter, which takes Clojure source on stdin and produces formatted Clojure source on stdout.  It starts in <55ms on an old MacBook Air (faster than node.js), and runs much faster than the JVM.  See https://github.com/kkinnear/zprint/blob/master/doc/graalvm.md for details.  
  2. :max-length and :max-depth are now fully supported, and :max-length will also accept a vector of lengths, where the position in the vector indicates max-length for that depth. For example {:max-length [100 5 2 0]} would show you 100 of the top level things, 5 of each of those, 2 of each of those, and nothing below that.  Useful for getting an overview of a complex data structure.
  3. For repl use and lein-zprint, multithreaded operation is now on by default, yielding up to a 20% real-time performance improvement.
  4. End-of-line (inline) comments are now kept as inline comments.  Optionally, of course, but on by default.
  5. There is a style just for spec files {:style :spec}, which does a fine job on specs.  Though it does a pretty nice job without any guidance at all.
But the big deal is the startup speed with a native image.  Really quite amazing.


Didier

unread,
May 18, 2018, 2:42:24 PM5/18/18
to Clojure
Can it run on Linux too? Or MacOS only?

Kim Kinnear

unread,
May 18, 2018, 4:14:16 PM5/18/18
to Clojure
For Linux, you get a pre-built native image: zprintl-0.4.9.  Look in the "releases" section of zprint on GitHub.  

For the MacOS version, there is a bit more to do -- you have to download the .jar file (zprint-filter-0.4.9) from the same place along with the build.zprintm file, get graalvm and put it somewhere on your system, and run the build.zprintm script to build the zprintm-0.4.9 native image.
Reply all
Reply to author
Forward
0 new messages