Patheos

BuddhistCatholicContemplativeEvangelicalGeneral ChristianHinduJewishLatter-day SaintMuslimNew VisionsProgressive Christian

Beliefs

Topics

Columnists

Resource Library

Research Tools

Video

Podcasts

Thought Readers

Faith In Media Tracker

Newsletters

Ad-Free & Subscriber Log-In Subscription Support

Patheos

Ad-Free & Subscriber Log-In Subscription Support

Follow Patheos Patheos on Facebook Patheos on YouTube

Cry 'Woof'

Tools for Learning Clojure, Part III: Nightcode

Last updated on: June 14, 2014 at 3:00 am   by willduquette

Tools for Learning Clojure, Part III: Nightcode 2014-06-12T19:53:38-05:00 willduquette

LOGO Patheos Explore the world's faith through different perspectives on religion and spirituality! Patheos has the views of the prevalent religions and spiritualities of the world.

In Part I, I talked about Clojure and the need for a convenient “REPL”: a piece of software that lets you type input at the language engine and see its responses. In Part II I talked about Leiningen, a very cool tool that not only gives you a good REPL but also automates many other tedious aspects of development. (I find myself wishing very strongly that TCL, my usual language, had something like it.)

So at the end of Part II, it looked like I had a solution: Leiningen gives me the REPL and I can use any editor I happen to like. But wait! All is not rainbows and unicorns. At home I use a Mac; but at work I use a Windows machine. I’m looking for a solution that works well on both platforms.

When working with a REPL, I often find myself fixing bugs and making other changes in the editor and then pasting them into the REPL. This works great on the Mac. I can use any editor I like, and easily paste my edits into a Leiningen REPL running in a Terminal window. It’s not ideal—I’d like better integration between the editor and the REPL—but it’s workable.

Not so on Windows.

Leiningen is a command-line tool; and on Windows it’s accessed via a batch file designed to run in a normal Windows “command shell”—what we used to call a DOS window. This leads to two problems. First, on Windows I use an environment called MinGW which gives me a terminal window with a UNIX-like “bash” shell. The UNIX programming environment is a delightful place to work, and I’ve been using it on one platform or another for decades (including the Mac—OS X is UNIX underneath). Using MinGW also happens to be the easiest way to perform some of the development tasks we need to perform on Windows.

Unfortunately, the Leiningen “lein.bat” file doesn’t work properly when executed in a bash environment. In order to use it, I need to pop up a Windows command shell window in addition to my usual bash shell window.

The second problem is that pasting text into a command shell window is too annoying for words. Those of you of a certain age will remember running DOS programs like WordStar and WordPerfect and Lotus 123. The command shell window is designed to let you run old programs like that; and since those programs expect to handle the standard Control-X, Control-V and Control-C keys themselves, you can’t use them to paste text into the command-line. Instead, you have to select a menu item of a submenu of the window menu, which gets old really fast. Copying text out of the command shell is equally annoying.

Once I realized this, I went looking for the next killer Clojure app: a simple “IDE” (Integrated Development Environment) that supports Leiningen directly. There are a number of these; both Eclipse and IntelliJ (two of the most popular Java IDEs) have Clojure plugins, for example. But these tools aren’t simple; they are more of a way of life, and all I’m wanting to do at the moment is play with Clojure.

And then I tried Nightcode. Here’s a picture (click on it to see it larger):

I’d glanced at Nightcode earlier, and had passed over it. It looked a little clunky: lots of buttons, no pretty icons, no proper menus. And when I tried it, I discovered that it is a little clunky; but it works and works well. First of all, it supports Leiningen natively. It can create new project trees, and it can work with project trees created using Leiningen from the command line. It has a built-in REPL (two, in fact) that works quite nicely, and a syntax-highlighting editor that’s just capable enough to keep me from going nuts.

Looking at the picture above, you can see four areas. In the upper left is the project workspace. Here’s where you view your project tree; to edit a file, click on it in the project tree. In the upper right is the editor. In the lower right is an all-purpose pane that’s used to display information to the user; it is also the main REPL window. In other words, I can be looking at the code in the editor, and calling it interactively in the REPL, all in one place. The buttons at the top of the scrolling pane allow you to run your program, compile it and run it in as a REPL, build it, and so forth.

The lower left is another REPL; it might be attached to the instance of Clojure in which Nightcode is running, I’m not sure. I mostly use it to see if some function name I want to use is going to shadow one of the built-in functions.

I picked up Nightcode a couple of weeks ago, and spent most of that day working on some Clojure code in it. It was a fun, remarkably pleasant experience; and I’m still happy with it a couple of weeks later.

Nightcode isn’t the ultimate Clojure programming environment; if I were using it all day every day for production work I’d want something beefier. For casual use, though, it’s easy to use, easy to get started with, and doesn’t try to take over your life.

Recommended.

Woof Guide to Technology

clojure

leiningen

nightcode

tcl/tk

Previous Post



June 13, 2014

Wondrous Love, by Blue Highway

Next Post



June 15, 2014 Lumen Fidei: The Pursuit of the Good, the True, and the Beautiful


Browse Our Archives

Select a Category Admin App o' the Morning Ask the Dogmat Believing Thomas Bits of Fiction Blasts from the Past Bootstrapping the Interior Life Catholic Mom Christian Living Deep Thoughts from the Doghouse Dominicana Evangelii Gaudium Interviews It Was A Dark and Stormy Night Links to This and That Lumen Fidei Meme Watch On Writing Operation Gratitude Pedant Errant Photography Quill Random Barkings S'Mary's World Shakers of Salt Software Development The Dog Whistler The Dogmat Sez Third Orders Thomas Aquinas Uncategorized Vikings at Dinos Woof Guide to Cinema Woof Guide to History Woof Guide to Literature Woof Guide to Obscure Catholic Music Woof Guide to Philosophy Woof Guide to Popular Music Woof Guide to Technology Woof Guide to Theology Words I Wish I'd Written Works For Me

Select a Month September 2016 August 2016 June 2016 May 2016 April 2016 March 2016 February 2016 January 2016 December 2015 November 2015 October 2015 September 2015 August 2015 July 2015 June 2015 May 2015 April 2015 March 2015 February 2015 January 2015 December 2014 November 2014 October 2014 September 2014 August 2014 July 2014 June 2014 May 2014 April 2014 March 2014 February 2014 January 2014 December 2013 November 2013 October 2013


Follow Us!

Follow Us on Facebook Follow Us on Twitter



TAKE THE

Religious Wisdom Quiz

Who is frequently described as "the fool" in Proverbs?

Select your answer to see how you score.

A king One who is wealthy One who hates wisdom A foreigner

Related posts from Cry 'Woof'

Catholic

Second Look: Amazon Echo after One Week

Cry 'Woof'

Catholic

First Look: Amazon Echo, or Alexa Tells You...

Cry 'Woof'

Catholic

Kindle and the Calibre App

Cry 'Woof'

Catholic

Quill v0.4.0

Cry 'Woof'

TRENDING AT PATHEOS Catholic

Rejecting Doom: Christian Hope And Human Action

Christianity is a religion of hope. We are to have hope and...

It’s What Comes From Within Which Matters

One of the most difficult things for us to understand is why...

Why I Choose the Eucharist Over the Sermon

Choose the Eucharist, Not the Sermon What are we supposed to get...

5 Design Elements Found in Spiritually Rooted Homes

Putting Spirituality Into Home Decor Our homes are more than our living...

Credo: A Story of God Told with the...

About 10 years ago, I began to imagine a personal "Credo" that...

The Anatomy of Divine Revelation in Catholic Thought

The claim that God has made Himself known to human beings is...

view all Catholic blogs

Patheos on Facebook Patheos on YouTube

Ad-Free & Subscriber Log-In Subscription Support

Copyright 2008-2026, Patheos. All rights reserved.

Subscription Support Ad-Free & Subscriber Log-In

Follow Patheos Patheos on Facebook Patheos on YouTube