Web Development
<-Return to all blogs
Proto REPL: A new Clojure REPL for the Atom Editor
I’d like to introduce a new Clojure REPL, Proto REPL, that I created as a plugin to the Atom editor. Proto REPL lets you develop Clojure applications in Atom using an interactive REPL driven development experience.
nn
nn
Proto REPL Features
nn
- n
- Send blocks of code or selections from an editor tab to the REPL for execution.
- Display documentation or code of selected functions and namespaces.
- Easy, fast reloading of all the Clojure code in a project.
- Jump to the definition of any Clojure Var with a single key press. This even works with libraries and clojure.core functions.
- Run a single test, all tests in a namespace, or all tests in a project.
- A tool bar provides button click access to common REPL capabilities.
n
n
n
n
n
n
nn
Atom makes it super easy to install new packages. Just run
apm install proto-repl
after installing the Atom editor to try it out. You’ll need Java (a Clojure dependency) and Leiningen(a Clojure build tool) installed to use it.nn
Try it out with the Proto REPL Demo project.
nn
Why a new REPL?
nn
The future of software development going to be interactive. You’ll be connected to your running code in a way that makes it easy to understand what’s going on. Clojure gives me an experience like that today. Using a REPL let’s you easily experiment with small bits of code giving you immediate feedback. It makes you incredibly productive.
nn
For various reasons I’ve decided to look for alternatives to my current Clojure development approach. I currently use Sublime Text with Sublime REPL to do Clojure development. Building Proto REPL in the Atom editor allowed me to replicate that experience but offered new capabilities I didn’t have with Sublime Text.
nn
Visualizations in the Mist
nn
The future of interactive development is going to be visual. The REPL of the future will look more like Gorilla REPL, a notebook style REPL, than the terminal style REPLs we use today. Gorilla REPL is an interesting tool in the same vein as Mathematica Notebooks or IPython Notebooks. It gives you a futuristic REPL experience in which the output of a command might produce a number, a table, a bar chart, or even a map of a spatial area.
nn
Gorilla REPL is great for creating documents but as a REPL for normal development it has limited interaction between your editor and the REPL. Gorilla REPL and a REPL in your editor can run on the same JVM and access code in your project but you can’t send code from your editor directly for display in Gorilla REPL. (Unless I missed this capability somehow.) Your editor and the browser window in which Gorilla REPL runs are two separate applications. This limits how close you can get to a single unified experience. Gorilla REPL is a very useful tool but would benefit from tighter editor integration. However, I’m convinced that Gorilla REPL’s approach of visual output in the web browser is the right one.
nn
The Browser is Your Editor
nn
ATOM is a new-ish editor from Github built on top of Chromium, the open source web browser on which Google Chrome is based. To over-simplify things it’s a text editor built on top of a web browser. You can write packages to extend it in JavaScript. You have access to the Chrome Developer Tools so you can set break points or profile your Atom plugin code. Because ATOM is at its heart a web browser that means you can use the combination of HTML/CSS/JavaScript right in your editor for visualizations or displaying whatever you want.
nn
My goal for the initial version of Proto REPL was to provide feature parity with my REPL setup in Sublime Text. It doesn’t take full advantage of the visual capabilities of Atom yet. Proto REPL barely dips its toes in the visualization and interactive capabilities. When you execute a block of Clojure code in Proto REPL the block is highlighted in yellow for a fraction of a second to give you visual feedback of what was executed. This is done by temporarily applying a background color change with CSS. This simple change was something I couldn’t easily do in Sublime Text but was trivial to do in Atom.
nn
I’m planning to start experimenting with capturing output from the REPL and displaying the results visually in ATOM. I’m hoping that a future version of Proto REPL can offer something a bit more visual.
nn
Links
nn
n
Functional Programming for the Functionally Challenged (Like Me) – Part 1
This is the first post in a series dedicated to presenting solutions to common challenges that developers encounter when moving from an imperative programming approach to functional programming (FP). I will present a series of problems and provide solutions in both Java and Elixir, a functional language running on the Erlang VM.
Functional Programming for the Functionally Challenged (Like Me) – Intro
By now you have probably heard all the hype about functional programming (FP) and may have even dipped your toe in the water by trying out one of the other Lisp dialects. Maybe you have experimented with some of the functional elements of Scala, Ruby, Python, or one of the newer languages.
Improving Java Math Performance with Jafama
Jafama is a Java library that provides fast numeric operations that are replacements for the methods on java.lang.Math. Jafama (Java Fast Math) consists of fast – but not sloppy – counterparts of java.lang.Math treatments, plus additional ones. They are usually about 2-4 (up to 15) times faster, with about 1e-15 accuracy, and handle special cases (NaN, etc.).
Determining the Winding of a Polygon Given as a Set of Ordered Points
When working with spatial data one often needs to work with polygons to demarcate bounding areas. One important concept related to this is winding, which defines the relative order in which the vertex points of a polygon are listed. Winding can be either clockwise (CW) or counter-clockwise (anti-clockwise) (CCW), referring to the direction in which we pass through the vertices while looking down at the coordinate plane.
Message Functions
One common functionality for software is the need to provide human readable text messages. This is true of native applications, web applications, and many back-end systems. For applications with a user interface there is often a requirement that these messages be localized, that is, provided to the user in the user’s native language.
Technology Radar 2014
We’re releasing our first Technology Radar. A Technology Radar, pioneered by ThoughtWorks, is a list of the techniques, tools, platforms, languages, and frameworks divided into recommendation levels: Adopt, Trial, Assess and Hold. It’s mostly a list of things we find useful and interesting.
DRY Up Your Vagrant Files
In this post we describe our experience applying the DRY principle while using a Vagrant file to launch a Riak cluster on Amazon Web Services (AWS) Elastic Compute Cloud (EC2).
Efficient Delegation Using the Objective C Reflection API
In this post we describe how to replace boilerplate delegation methods with two methods using the reflection API of Objective C.
Announcing VDD Core
In this post we roll out VDD Core, a Clojure open source library.