Skip to content

pebrc/planck

 
 

Repository files navigation

Planck

A stand-alone ClojureScript REPL for macOS and Linux based on JavaScriptCore.

Home page: planck-repl.org

Installing

On macOS:

$ brew install planck

On Ubuntu:

sudo add-apt-repository ppa:mfikes/planck
sudo apt-get update
sudo apt-get install planck

For other Linux distros, see Building below.

Using

Launch Planck by entering planck at the terminal.

Get help on command-line options by issuing planck -h.

For more details, see the Planck User Guide.

Ported Clojure Functionality

It is possible to write Clojure-idiomatic scripts like the following:

(require '[planck.core :refer [line-seq with-open]]
         '[planck.io :as io]
         '[planck.shell :as shell])

(with-open [rdr (io/reader "input.txt")]
  (doseq [line (line-seq rdr)]
    (println (count line))))

(shell/sh "say" "done")

Many of the familiar functions and macros unique to Clojure have been ported:

clojure.core/ -> planck.core/

eval, file-seq, line-seq, intern, ns-resolve, read, read-line, read-string, resolve, slurp, spit, with-open

clojure.java.io/ -> planck.io/

as-file, as-url, delete-file, file, input-stream, make-input-stream, make-output-stream, make-reader, make-writer, output-stream, reader, resource, writer

clojure.java.shell/ -> planck.shell/

sh, with-sh-dir, with-sh-env

Building

Build Status

Prerequisites

See Building Wiki for setting up OS-specific build tooling and dependencies.

Pre-made build environments for various environments are available in build-envs.

Compiling

$ script/build

The resulting binary will be planck-c/build/planck.

Specify -fast to quickly build a development version that skips Closure optimization:

$ script/build -fast

If you specify -Sdeps or -R<alias>, it will be passed through to the underlying clojure command during the build process. This can be used to specify a ClojureScript dep to use.

Tests

$ script/test

License

Copyright © 2015–2018 Mike Fikes and Contributors

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Stand-alone ClojureScript REPL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 52.6%
  • Clojure 37.1%
  • Shell 6.7%
  • CSS 1.4%
  • Ruby 1.1%
  • CMake 0.7%
  • Other 0.4%