Skip to content

Instantly share code, notes, and snippets.

@mfikes
Last active December 24, 2015 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfikes/9503aa2555aac1cafaf4 to your computer and use it in GitHub Desktop.
Save mfikes/9503aa2555aac1cafaf4 to your computer and use it in GitHub Desktop.
ClojureScript command line apps

In the ClojureScript announcement, Rich shows running some AOT-compiled ClojureScript in Node to enumerate the files in a directory.

See him do it here: https://youtu.be/tVooR-dF_Ag?t=3882

Now with bootstrap, you can do that dynamically right on the command line, change your mind and change the directory you enumerate, revise the code to use println vs. prn, etc. Try this:

planck -e"(require 'planck.core)" -e'(run! (comp println :path) (planck.core/file-seq "/tmp"))'

Note that this is being done on the spot without starting up the JVM-based compiler. In other words, we can have our cake and eat it too these days!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment