Git Product home page Git Product logo

clojupyter's Introduction

clojupyter

A Jupyter kernel for Clojure. This will let you run Clojure code from the Jupyter console and notebook.

clojupyter

Installation

  1. git clone https://github.com/roryk/clojupyter
  2. cd clojupyter
  3. make
  4. make install

This will install a clojupyter executable and a configuration file to tell Jupyter how to use clojupyter in from jupyter's user kernel location ( ~/.local/share/jupyter/kernels on linux and ~/Library/Jupyter/kernels on Mac).

run the REPL with:

jupyter-console --kernel=clojure

or the notebook with:

jupyter-notebook

and select the Clojure kernel.

The Docker way

A Docker image is also made to make the installation easier, and isolate the environment cleaner. What you need to do is:

  1. Install Docker based on your platform.
  2. Run docker run --rm -p 8888:8888 kxxoling/jupyter-clojure-docker to have clojupyter installed on your OS.

The first time you start a container would pull the Docker image, which takes time.

More specificated introduction and usage guide is on the home page of the Docker image.

Installation on Windows

All these following commands must run in bash (recommend git bash)

  1. Install MinGW, install packages: mingw32-base, mingw-developer-toolkit
  2. Add the absolute path of 'MinGW/bin' to the path system environment variable.
  3. Rename 'MinGW/bin/mingw32-make.exe' to 'MinGW/bin/make.exe'
  4. git clone https://github.com/roryk/clojupyter
  5. cd clojupyter
  6. make
  7. Copy two files 'clojupyter/resources/kernel.json' and 'clojupyter/bin/clojupyter' to the folder '%APPDATA%/jupyter/kernels/clojure' (create folder if missing)
  8. Edit 'kernel.json' line 2:

"argv": ["bash", "full-path-to-APPDATA/clojupyter/bin/clojupyter", "{connection_file}"]

If you want run jupyter in cmd, replace "bash" to the full path of bash.exe

Removing the stale OSX kernel cache

Recently clojupyter was renamed from ipython-clojure because clojupyter is more accurate and, more importantly, sounds cooler. OSX caches the kernels you choose in $USER/Library/jupyter/kernels, so it will look for ipython-clojure even if you've installed the new version. Remove the clojure directory in there and it will pick up the clojupyter executable instead if you're having some troubles after installing.

To Do:

  • Shut down cleanly.
  • Do syntax checking. It currently returns nil on unbalanced form. Borrow cider-nrepl middleware for this.
  • Allow controls from Jupyter, including timeout and what classes of stack frames to show.
  • Test (implement?) interrupt handling. Default middleware for interruptible-eval is loaded.
  • Implement file load. Use cider-nrepl middleware.

Collaboration

If you submit a pull request that ends up getting merged, we will give you commit access.

clojupyter's People

Contributors

bemxself avatar kxxoling avatar luojieshun avatar paul-english avatar pcallier avatar pdenno avatar roryk avatar thomasjm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.