8 ms·
Show HN: Nightlight, an editor that runs inside Clojure projects
- pg_is_a_butt 10y agouh... what kind of project code doesn't run inside a project? you're all idiots.
- runeblaze 10y agoSomething more advanced yet similar to Nightcode is something I am definitely excited to try as an alternative to Emacs and Cursive. Also gotta try this with play-clj to see how the workflow plays out. Edit: Tried the REPL but it felt quite buggy: http://recordit.co/ziDH1PrJvm http://recordit.co/ziDH1PrJvm.
- yojex 10y agoIt's the same author, so I'm assuming that this is his spiritual continuation of Nightcode with a huge update. 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.
- meira 10y agoInteresting project. but I don't feel I'd use other editor than Emacs for clojure.
- qwertyuiop924 10y agoCIDER allow for many of the same features, IIRC. But you likely already knew that, and I'm primarily working in Scheme with Geiser, so what do I know?
- swalsh 10y agoThe possibilities of this thing blow my mind. Very cool idea.
- S4M 10y agoCan you give some examples of what you have in mind? I find this very intriguing but I can't think of anything it could do that would be impossible with hot reloading code.
- JamesLeonis 10y ago1. Cloud based development/debugging. 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.
- qwertyuiop924 10y ago...But can't you do that already with CIDR? (or SLIME/Geiser, for some of the other lisps). IIRC, it does support connecting to a remote REPL like this.
- BWStearns 10y agoI don't think it gives you a whole lot over emacs with figwheel set up but it does seem to minimize the barrier to entry (ie emacs no longer soft mandatory). I think if it grows a sublimetext style command pallet and shortcut arsenal it could very well be the default new-to-clojure experience. It could fill the role in the clojure ecosystem that Haskell for Mac does in haskell's ecosystem.
- qwertyuiop924 10y agoYeah. Well, I was thinking CIDER/SLIME/Geiser (they all provide similar services for their environments), but same idea.
- gravypod 10y agoI like the idea of a browser based IDE. I like the idea of an IDE for a lisp-like language that actually offers first-class auto-completion. 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.
- quantumhobbit 10y agoI could see embedding as a huge win as everything moves into the cloud. Just bake this into your project and push it to the test servers. Then log in and code. Imagine not having to connect your laptop to seventeen other "microservices" to be able to develop on something similar to the production environment. No more developing blind in your IDE and then falling back onto vim or nano when trying to play with a remote server. 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.
- hashkb 10y agoIs removing vi and SSH from production servers a common thing? How do you configure and operate them?
- kedean 10y agoThese days a lot of companies will have production systems launch from a configuration that is known to work as expected already, via QA processes. It'll be launched and configured with tools like chef, puppet, docker, and other buzzwordy technologies. When something needs to be changed, you edit the static configs, stored in a source control system, and let chef and company do the heavy lifting.
- qwertyuiop924 10y ago...But can't you do the same thing with any REPL? Run NREPL (Or your local equivalent in your Lisp dialect) on a port for internal use, and then just connect to your server with SLIME/CIDER/Geiser or whatever you non-emacs-using folk use (although why you would use another text editor for Lisp code is beyond me).
- sdegutis 10y agoThis is actually really creative and clever! In fact it's the first project of it's kind that I've ever heard of! 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.
- e12e 10y agoYou might want to have a look at LivelyKernel too: https://www.lively-kernel.org/ https://www.lively-kernel.org/
- sdegutis 10y ago> "More powerful editors like Cider and Cursive manage to do this with some very complex machinery that I could never duplicate. Instead, I decided to rethink the problem. Since Nightlight runs inside the same process as your project, code completion and other advanced features are trivial to implement." 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.
- gw 10y agoThe reason code completion is easier with this design is that I don't need to deal with any nREPL server; Nightlight can just go to the relevant namespace and ask for the available symbols. 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 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/Examples https://github.com/alexander-yakushev/compliment/wiki/Exampl...
- sdegutis 10y agoNeat! Better than nothing! Still not as context-aware as IntelliJ does (sometimes), but it's hard to beat Jetbrains, especially as a sole developer. Plus Clojure doesn't exactly make this easy by being dynamic from the bottom up. Assuming you're Oakes, nice job, and I'm looking forward to trying out Nightlight and will probably enjoy it as much as Nightcode :) that said, why the choice of those buttons in the toolbars? Ctrl-S and Ctrl-Z and Ctrl-Y are pretty commonly known.
- tunaoftheland 10y ago
- wmichelin 10y agoSomething is wrong with the SSL cert on https://sekao.net/nightlight/ https://sekao.net/nightlight/
- deleted 10y ago[deleted]
- agumonkey 10y agoVery metacircular of you. I bet 5$ that jmc is applauding.
- Jeaye 10y agoI would love to see if this works on Google App Engine. GAE has some strict requirements, as far as what its apps are allowed to do, but, up until now, it's been a pretty closed box when it comes to debugging. Something like this would be superb; official support for GAE would be even better.
- nothrabannosir 10y agoGAE is rolling out their next gen which is container based. No more restricted jvm, and debugging is much better (live ssh access). Just a heads up :)
- qwertyuiop924 10y agoI don't really see how the integration would be any better than what I'm getting already from Emacs: I can already patch the code live, etc, through a REPL, and run the code as I develop it. Nightlight is asking me to give up the comfort of Emacs: so what does it get me?
- tunaoftheland 10y agoI am ignorant of SLIME/CIDER (though I think I've used the latter with Clojure). Do they have access to the same memory space as the running application and the ability to interact with live application state? It seem that Nightlight has that as a goal. My (limited) understanding is that SLIME/CIDER run in a separate process from the application, thus requiring IPC back and forth between Emacs and the application runtime.
- qwertyuiop924 10y agoThat's true, but the practical effect (having access to application internals, interacting with live program state, the ability to connect to a live program and hotpatch it, even if it's running on a remote server (but you'll really want the source files if you're doing that, and you should be sure to upload the new sources/binary to the server you just hotpatched, or you'll be in for a shock when it reboots), and so on) is exactly the same, and they mostly share the same capabilities (AFAICT, Nightlight might have better autocomplete than SLIME/Geiser, but other than that, I can't think of anything).
- JaumeGreen 10y ago> 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.
- qwertyuiop924 10y ago
- slim 10y agoThis is amazing. Could you provide a "starter image" in the form of, say, an android .apk ? That would get me started on clojure very quickly (that would be the smalltalk way)
- samatman 10y agoVery cool. Looks like a spiritual successor to Catnip[0], which I made heavy use of when I was newer to Clojure. Bodil's moved on to other things, I'm glad someone is moving forward with this kind of environment. [0]: https://github.com/bodil/catnip https://github.com/bodil/catnip
- fedess 10y agoWish it credited Light Table as inspiration (http://lighttable.com/ http://lighttable.com/) :/ Even the term "instarepl" is taken from LT's creator, Chris Granger. Of course LT's inspiration is Smalltalk's IDE.
- azeirah 10y ago"Of course ..." is that really true though? From the very beginning, the very first demo, Chris Granger mentions that he got inspired by Bret Victor's Inventing on Principle demo. He mentions it in the first blog post as well :p No mentions of smalltalk Chris Granger's first video on LightTable: https://www.youtube.com/watch?v=7XUWpze_A_s 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-ide-concept/ http://www.chris-granger.com/2012/04/12/light-table-a-new-id...
- gw 10y agoEverything is a remix ;) Light table certainly was my inspiration for the instaREPL. DrRacket inspired the notion of running code in the same process as the editor. The code completion system comes straight from CIDER. I could go on and on. Please don't interpret the lack of a mention as a slight. We're all remixing each others' work.
- xg15 10y ago"The ambition is to create something that follows the Lisp and Smalltalk tradition, blurring the line between your tools and your code to provide unprecedented interactivity." (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?
- nextos 10y agoReflection, for example, was heavily used by Smalltalk tools to build and debug objects alive. 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).pdf https://ti.arc.nasa.gov/m/pub-archive/176h/0176%20(Havelund)...
- e12e 10y agoYou might enjoy : http://worrydream.com/LearnableProgramming/ http://worrydream.com/LearnableProgramming/