Show HN: Nightlight, an editor that runs inside Clojure projects
github.com
github.com
Nightlight is asking me to give up the comfort of Emacs: so what does it get me?
Perhaps nothing. But for me it would give me the fact that it's not Emacs.
I know that Emacs is considered the one and true way to do lisp, specially common lisp, but, for me, it's the reason I haven't started to do anything in that language.
Different people, different needs. It might cater someone else's needs.
And Emacs isn't the only way to do CL, it's just got really good support for all lisps: Paredit and SLIME are still some of the extensions against which all others are judged, with most lisps having a SLIME equivalent mode, give or take.
But what's so bad about Emacs?
The time you have to devote to learn it.
I get that when you are used to it and use it you get that time back, but I haven't had a job where I could use that, and when I had time I was more of a vi person.
On can go up so many learning cliffs until he gets tired of that and just yearns for interfaces that are similar to the ones already known or so easy that no learning is necessary to start using them.
Chris Granger's first video on LightTable: https://www.youtube.com/watch?v=7XUWpze_A_s Chris Granger's first blog post on LightTable: http://www.chris-granger.com/2012/04/12/light-table-a-new-id...
I don't like the idea of embedding it into a project. That doesn't make sense from a dependency tree way of looking at it.
Of course make sure it is turned off for production, but the same applies to ssh and vim.
Agreed on the dependency weirdness though. It does feel a bit like when that one guy keeps checking his Eclipse or Intellij config files into source controll. I hate that guy.
I think the embedding part is certainly a tradeoff. Once the development community settles on a best-practice for things like this, it becomes less of a danger of forgetting. For example, once this sort of config shows up by default in archetypes and boilerplate projects, I feel that the danger is reduced to the level of being manageable. And hopefully the port that the editor uses is blocked by default in the production environment. :)
One of the harder issues when I'm building microservices is stringing each service and dependency together and debugging. With this I could put together a full staging environment and log into each service to monitor and tweak problems I've found.
2. Limited hardware or access.
This is important because it's talking with Java Clojure not Clojurescript. Because it's entirely browser based, I could spin up an EC2 instance and load the editor on my phone. I can't do that with a regular Clojure environment in my phone.
IIRC, it does support connecting to a remote REPL like this.
As much as I want to like Pharo and am amazed by its fast progress, its integration story (to external data source like PostgreSQL) is pretty weak, currently. I'll be tracking the progress of this project to see how it goes, though I've yet to love Clojure.
I want to add that I think it's a beautiful approach to solving the problem; rather than implementing a complicated mechanism for interrogating the application state from a tool running in another process, the author is flipping that around and putting the editor inside application so that it has a very simple access to the application state. Love it.
Bodil's moved on to other things, I'm glad someone is moving forward with this kind of environment.
Edit: Tried the REPL but it felt quite buggy: http://recordit.co/ziDH1PrJvm.
EDIT: They are going to remain separate, here's what he wrote on the project site:
> Nightcode remains easier for beginners, because it's a standalone application with Leiningen and Boot built in, so they don't need to use the command line. Nightlight must be added to your project, but provides more power, so it may be more suitable for intermediate and advanced users.
Basically it's a library that runs a web server that serves a page which displays the contents of your source files in an editable text field, and saves/loads them by reading/writing directly to disk. This also means it should be much easier to implement the advanced IDE features of CIDER, since you don't need a plugin system and have full access both to the raw source code files and the project's very own JVM (which the IDE shares). Neat!
Although, I once again have to completely disagree with Oakes' choice of buttons in the toolbar (just like in Nightcode): I don't know any programmers who don't know the shortcuts for Save, Undo, and Redo by heart.
How? What makes it easier to implement code completion when the IDE is running inside your project's JVM? Clojure is still a dynamic language, which means you'll never fully know what vars make actual sense in a given context. For example what vars in the current context make sense as arguments to the function you're about to call, when you have no idea what the type signature of that function is (which may even be a variable). Unless, do you mean very simple context-less code completion? That's what CIDER does, and presumably Cursive too, but they just do it by asking the process on the other end of the nREPL server for more details, and the plugins for these have access to the same JVM.
You are wrong that it is context-less code completion. In fact, I use the same library that CIDER does: https://github.com/alexander-yakushev/compliment I pass the entire top-level form to the library so it can make intelligent choices about what to complete. Here's how it works: https://github.com/alexander-yakushev/compliment/wiki/Exampl...
(emphasis mine)
I don't come from a Lisp background, but I don't see why that would be something desirable at all. Does anyone know more about this?
Growing programs without the need to stop them is also very much in the Lisp tradition. See, e.g. the JPL remote bug in spaceship story [1].
[1] https://ti.arc.nasa.gov/m/pub-archive/176h/0176%20(Havelund)...
Last time i checked (4 months ago, with a hobby project) it felt already pretty mature.
(that would be the smalltalk way)