• This repository has been archived on 18/Jul/2020
  • Stars
    star
    217
  • Rank 182,446 (Top 4 %)
  • Language
    OCaml
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sorry about the name

Grenchman

Fast invocation of Clojure code over nREPL.

To install, download the appropriate binary from https://leiningen.org/grench.html and place it on your path. If downloads for your platform are not provided you can compile your own; see "Building" below.

Usage

Grenchman has five main commands:

  • grench eval "(+ 12 49)" - evals given form
  • grench main my.main.ns/entry-point arg1 arg2 - runs existing defn
  • grench repl or grench repl :connect $PORT - connects a repl
  • grench load path/to/file.clj - load a file
  • grench lein test - runs a Leiningen task

Running with no arguments will read code from stdin to accomodate shebangs.

The first four commands connect to a running nREPL project server in order to avoid JVM startup time. The simplest way to start a project nREPL server is to run lein trampoline repl :headless from the project directory in another shell. All non-lein grench invocations from inside the project directory will use that nREPL, but by setting the GRENCH_PORT environment variable you can connect to it from outside.

Leiningen

The grench lein subcommand is the exception to this; it connects to a Leiningen nREPL server rather than a project nREPL. It looks for the port in ~/.lein/repl-port or $LEIN_REPL_PORT; you can launch this server using lein repl :headless from outside a project directory.

Using Grenchman avoids waiting for Leiningen's JVM to start, but project JVMs are still launched like normal when necessary if Leiningen can't find a running project nREPL server. Note that this goes through Leiningen by looking for .nrepl-port and doesn't check $GRENCH_PORT.

Currently the Leiningen integration requires Leiningen 2.3.3 or newer. If you get no output from grench lein ... but your Leiningen process emits an java.io.FileNotFoundException: project.clj error message, upgrading Leiningen should fix it.

Building

Building grenchman typically requires compiling the whole OCaml toolchain (two compilers, two standard libraries, a package manager, and a handful of other third-party libraries) from scratch and can take up to an hour. Please use the precompiled binaries if possible.

You will need to install opam and OCaml 4.x to be able to build Grenchman. You'll also need libffi as well as libreadline-dev (sometimes called readline-devel on RPM systems).

If you're not sure whether you have 4.x installed or not, you can check with:

$ opam switch list
# If your system compiler is 4.x or above, you're ready to go.
# Otherwise, issue the following command:
$ opam switch 4.04.0
# Don't forget to add ~/.opam/4.04.0/bin/ to your $PATH

$ sudo apt install ocaml ocaml-native-compilers opam camlp4 aspcud \
    libreadline-dev libffi-dev

To build, run the following commands:

$ git clone [email protected]:technomancy/grenchman.git grenchman
$ cd grenchman
$ opam install ocamlfind core async ctypes ctypes-foreign
$ ocamlbuild -use-ocamlfind -lflags -cclib,-lreadline grench.native
$ ln -s $PWD/grench.native ~/bin/grench # or somewhere on your $PATH

Gotchas

By default Leiningen uses compilation settings which trade long-term performance for boot speed. With Grenchman you have long-running nREPL processes which start rarely, so you should disable this by putting :jvm-opts [] in your :user profile.

Tasks for all projects will share the same Leiningen instance, so projects with have conflicting plugins or hooks may behave unpredictably.

If Grenchman cannot connect on the port specified, it will terminate with an exit code of 111, which may be useful for scripting it.

License

Copyright Β© 2013, 2017 Phil Hagelberg and contributors. Bencode implementation by Prashanth Mundkur. Licensed under the GNU General Public License, version 3 or later. See COPYING for details.

More Repositories

1

leiningen

Moved to Codeberg; this is a convenience mirror
Clojure
7,293
star
2

emacs-starter-kit

[ARCHIVED] this is ancient history
2,865
star
3

slamhound

Slamhound rips your namespace form apart and reconstructs it.
Clojure
473
star
4

robert-hooke

Hooke your Clojure functions!
Clojure
359
star
5

mire

Mire is a simple MUD written in Clojure
Shell
171
star
6

syme

Instant collaboration on GitHub projects.
Clojure
146
star
7

atreus-firmware

Firmware for the Atreus keyboard
Emacs Lisp
92
star
8

serializable-fn

Serializable functions in Clojure
Clojure
85
star
9

clojure-http-client

An HTTP client for Clojure (DEPRECATED)
Clojure
84
star
10

Garrett

A playground for Android Mirah development
Mirah
84
star
11

rinari

Rinari Is Not A Rails IDE (no longer updated; see eschulte's fork)
Emacs Lisp
66
star
12

lein-scalac

Clojure
54
star
13

conspire

A real-time collaborative editing platform built on Git.
Ruby
46
star
14

lein-licenses

List the license of each of your dependencies.
Clojure
44
star
15

skaro

comparative lispology
Scheme
42
star
16

lein-heroku

Experimental Leiningen plugin for managing Heroku apps
Clojure
42
star
17

radagast

Radagast is a simplistic test coverage tool.
Clojure
41
star
18

cooper

HyperCard-ish in Racket
Racket
39
star
19

erythrina

Basically ido for X, I guess?
OCaml
39
star
20

bludgeon

Bludgeon is a tool which will tell you if a given library is so large that you could bludgeon someone to death with a printout of it.
Ruby
37
star
21

bus-scheme

a Scheme written in Ruby, but implemented on the bus!
Ruby
37
star
22

nrepl-discover

proof-of-concept middleware for auto-discovery of nrepl ops
Clojure
36
star
23

lein.el

A no-startup-delay eshell replacement for the `lein` bash script.
Emacs Lisp
30
star
24

zossima

Jump to definition in Ruby driven by a live process
Emacs Lisp
30
star
25

lein-tar

Create tarballs from Leiningen projects.
Clojure
25
star
26

calandria

Unix in voxel-world
Lua
25
star
27

limit-break

Basic REPL breakpoints.
Clojure
25
star
28

javert

inspector
Clojure
24
star
29

orestes

the ultimate yak shave
C
23
star
30

relax.el

Interact with CouchDB databases from within Emacs, with ease!
Emacs Lisp
21
star
31

ri.el

An interface to RI (Ruby documentation) for Emacs
Emacs Lisp
19
star
32

circleci.el

Show build output from CircleCI builds inside Emacs
Emacs Lisp
19
star
33

lein-xml

All those parentheses got you down? How about some XML?
Clojure
17
star
34

ferrante

Locative Android app in Mirah
Shell
16
star
35

harker

Rails deployments via RubyGems. Because a package manager is a terrible thing to waste.
Ruby
14
star
36

lein-release

Tar up a Leiningen project along with some other handy directories
Clojure
13
star
37

corkscrew

Proof-of-concept build system for Clojure.
Clojure
12
star
38

seajure

The web site for Seajure, the Seattle Clojure Group
Clojure
12
star
39

metaverse

Parallel universes for namespaces
Clojure
12
star
40

lein-play

Play a sound when your tests pass or fail.
Clojure
12
star
41

super-explorer

2D tile exploring game
Racket
12
star
42

chortles

Calculate the magnitude of a given laugh
Clojure
12
star
43

lein-precate

You know, the opposite of deprecate.
Clojure
12
star
44

concourse

A web app for coordinating gatherings. Written in Compojure.
Clojure
10
star
45

paredit-screencast

9
star
46

server-socket

Clojure server-socket library spun off from monolithic contrib
Clojure
9
star
47

pindah

Moved to mirah organization
Ruby
7
star
48

lein-retest

Run only the test namespaces which failed last time around.
Clojure
5
star
49

lein-thrush

I guess technically it should be lein-comp; oops
Clojure
4
star
50

prometheus

XMPP heater
Erlang
4
star
51

lein-clean-m2

A Leiningen plugin to clean the local repository of unused artifacts.
Clojure
3
star
52

sokoban

push
Ruby
3
star
53

quickbeam

Access git trees.
Clojure
3
star
54

sketchbook

Some Processing sketches
Clojure
3
star
55

thai-type

Typing tutor for Thai
Racket
3
star
56

commodore-night-vision

Emacs Lisp
2
star
57

drainbot

Drain Heroku apps to IRC channels
Clojure
2
star
58

lein-blacklist

A Leiningen plugin to blacklist specific namespaces from being required.
Clojure
2
star
59

lein-survey

A survey of Leiningen users as a web app
Clojure
2
star
60

rcirc-ucomplete

Unambiguous completion for rcirc
Emacs Lisp
1
star
61

ss-calandria

A game using the minetest engine to teach programming and other technical skills
Lua
1
star
62

lein-standalone-repl

Clojure
1
star
63

swarm-go

Go, written by swarming
Clojure
1
star
64

squisserks

squisserks
Racket
1
star
65

clojars-verify

Verify checksums of Clojars artifacts
Clojure
1
star
66

lein-profiles

Profiles, backported from Leiningen 2 for your enjoyment.
Clojure
1
star
67

rodney-leonard-stubbs

The simplest stubs
Clojure
1
star
68

lein-assoc

A higher-order Leiningen task to run tasks with ad-hoc project keys.
Clojure
1
star