Giter VIP home page Giter VIP logo

planck's Introduction

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 or plk at the terminal.

The plk script executes planck, while integrating with the clojure CLI tool to add support for deps.edn and classpath-affecting options such as -Aalias.

Get help on command-line options by issuing planck -h or plk -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, find-var, load-reader, load-string, line-seq, intern, ns-resolve, read, read-line, read-string, resolve, slurp, spit, with-open

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

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

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

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

Building

If using macOS or Ubuntu, you can install pre-built binaries as described above under "Installing". The instructions here can be used to build, test, and optionally install Planck on your machine.

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

Installing

The following will install Planck under the prefix /usr/local:

$ sudo script/install

If you'd like to install Planck under a different prefix, you may pass -p. For example:

$ sudo script/install -p /usr

License

Copyright ยฉ 2015โ€“2019 Mike Fikes and Contributors

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

planck's People

Contributors

anmonteiro avatar belaf avatar borkdude avatar chancerussell avatar crisptrutski avatar daemianmack avatar derekcuevas avatar devurandom avatar ericstewart avatar fstamour avatar grav avatar gsnewmark avatar haochenx avatar heylu avatar honzabrecka avatar jobez avatar johanatan avatar justone avatar metacritical avatar mfikes avatar mkremins avatar pebrc avatar razzius avatar ryfow avatar seanomlor avatar skuro avatar slipset avatar statonjr avatar terhechte avatar yogthos avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.