Continue to Part 2: A Retrospective
My text editor journey began with Light Table. It’s not my first experience with the editor by a long shot, but this was the longest continuous streak I’ve spent exclusively editing with it (okay, technically I edited git messages in Vim because I forgot to assign
EDITOR to the command line
light app to launch the GUI). I’ve enjoyed a number of things about this editor and the plugins I’ve picked up, but we’ll get to the pros and cons in a bit - let’s start with basic information about the editor.
About Light Table
Watchers and Connections
The connections allow you to bind to different runtimes and environments to your REPLs or watches, as previously mentioned. Some of the defaults include an embedded or external browser, a local or remote Clojure REPL, the Light Table UI itself, Node, or Python. You can also include additional connections from the plugin manager or write your own for your favorite runtime.
Those familiar with Emacs will appreciate the fact of being able to fire up REPLs on the fly. Light Table’s REPLs are typically in Live mode - where you’ll get inline evaluation without performing any commands to eval your code. It’s quite a nice way to write your code if you’re working on an application in one of the supported languages.
Rather than using console logging or a dedicated debugger, Light Table lets you evaluate a line of code right there in the editor with a simple keychord. This is great for figuring out where your code is going to throw exceptions or return slightly incorrect values without breaking your focus. As mentioned before - just select the connection you want to eval against and it’s good to go.
Embeded Webkit Browser
Since Light Table is built on
node-webkit, it supports the ability to call up a browser right inside of the editor. This is great for working on a JS/ClojureScript application since you can control nearly every aspect of your code without even leaving your editor. The biggest caveat I’ve found with this feature I want to document, which I should’ve considered prior to attempting, was that if you enter a
Keybindings are super easy to manipulate for various parts of the editor, and the general behavior and functionality of the editor is just as easy to configure. Light Table’s architecture (and ClojureScript as a language) lend themselves well to creating an extensible and introspectable environment. Since the functionality is treated as data, it makes reconfiguring or extending the editor or platform quite simple in any language that can compile down to JS. Of course, you’ll almost always need a bit of ClojureScript to hook it into the platform, but much of that can be copypasta'ed from the web.
LT seems to borrow partially from Emacs and partially from Sublime Text as far as keymapping and behavior goes. Both keymapping and behaviors have
user files where all of the configuation belongs, much like Sublime. Similarly, both keymappings and behaviors are using ClojureScript to configure, manly maps - this is similar to how all Emacs scripting is done in Emacs Lisp.
Light Table’s plugin ecosystem is still pretty small but it seems to be growing slowly. Its plugin manage is built into the OS and as such makes management and discoverability fairly easy. That being said, the flat index listing of all packages and the search are not the greatest ways to find packages in my opinion, but it is better than what some other editors provide out of the box. Additionally some of the packages have many unseen dependencies or behind-the-scenes gotchas; however, these issues could be made more obvious with some UI tweaks, although complete resolution may be more involved.
One notable thing about the Light Table plugin system is that you also have access to any CodeMirror plugin, so long as there is a small adapter for it to be plugged into LT. Even Vim mode is one of these CodeMirror plugins; they’re quite common since reinventing the wheel would be a bit unnecessary, and CodeMirror has quite a few plugins already.
Light Table is largely capable and seems to contiously get more and more solid. Also, considering it was only open sourced a few months ago, it has made a lot of progress in a short time. If it continues picking up speed I have high hopes of LT becoming a premier choice for Clojure and ClojureScript development. It has some loose ends to tie up, but I’m looking forward to see what the future has in store for it.
Next post I’ll give a review of my experiences with Light Table, both good and bad.