Proto REPL now uses nREPL for communication with the Clojure process. Originally, communication was entirely via standard input and output. It would send code to the Clojure process the same way you would type Clojure code into a terminal based Clojure REPL. It was very basic but it worked surprisingly well for the initial version. The change to use nREPL brings with it a few new features like the ability to connect to a remote Clojure process, interrupt long running commands, and capture the value of executed code and redirect it for other purposes. That last feature is especially important in fulfilling one of the original goals of integrating visualizations.
Another improvement to Proto REPL was making its REPL display area act more like a real REPL. Proto REPL took the initial shortcut of directing all output to an Atom text editor window. You could modify anything and there was no place to enter new code for evaluation. The REPL display portion of Proto REPL has been updated to behave more like a traditional REPL. You enter new forms for evaluation at the bottom area. The results are displayed above that. It supports a history of your past evaluations as well.
Proto REPL has had some internal changes that make it easier to extend. Another package can now register itself with Proto REPL via Code Execution Extensions. This allows the creation of packages that extend Proto REPL and add visualizations or other new capabilities.
Proto REPL Charts is a new Atom package that uses that feature to display tables and graphs of results from executed Clojure Code. Proto REPL Charts supports scatter graphs, line graphs, bar charts, other custom graphs, and tables of data. Once Proto REPL Charts is installed you can execute code like this …
… to display a bar chart like this inside Atom:
Proto REPL added some improvements to interactivity through integration with Atom Ink, an Atom package for building interactive IDE components in Atom. Proto REPL currently uses it for displaying results of executed operations inline (next to the code that was executed). The pretty printed version of the result is available by expanding the inline display.
The inline display becomes very useful when combined with Automatic Evaluation Mode. Automatic Evaluation Mode evaluates every top level form in a specified file as you type. When you work in Clojure you typically move around a file making changes and sending various forms to be re-evaluated at the REPL. Automatic evaluation removes the need for the extra step of manually re-evaluating blocks of code. You just write the code and you immediately see the results. Most Clojure code can be stateless with zero side effects so it’s safe to run over and over. Code with side effects can be run in the traditional way.
See the following gif for a demo. You can even combine Proto REPL Charts with this so your graphs are immediately updated as you type.
Inline display of results, automatic evaluation, and Proto REPL Charts are all about removing the impediments when coding. They’re attempts to make it easier to see what you’re building.
I’ve been really pleased with how much positive feedback and support Proto REPL has received. The Proto REPL page at Atom reports more than 2,400 downloads so far. There have been many suggestions for improvement, issues filed, and some quality improvements submitted as pull requests including the ability to remotely connect to another nREPL server. Here are some recent quotes from Proto REPL users.
This is really great. Your repl plus parinfer just made Atom a serious Clojure/Clojurescript editor.
HUGE work has been done since I last tried out the proto-repl Clojure package for Atom. Amazing work!
This is really exciting! I already find it easier to use than light table, in terms of starting a repl and getting evaluation going.
This is still just the beginning. The foundation is there for being able to use Proto REPL to do real development work but there are still many areas in which the experience could be improved. These are some of the future possibilities.
- Increased integration with Atom Ink. Atom Ink is in the early stages of development. As Atom Ink improves so will Proto REPL.
- Adding the ability to save and view values captured across the execution of an algorithm.
- More visualizations and ways to visualize algorithms or different kinds of data.
- New features like refactoring support or improved code completion
If you’re interested in helping to improve Proto REPL please take a look at the issues. You can volunteer or ask questions there about the best way to contribute.