6 ms·
This reminds me of using swank-js with Emacs, as demonstrated in a short Emacs Rocks! screencast[1]. [1]: http://emacsrocks.com/e11.html http://emacsrocks.com/
by tikhonj 14y ago
This reminds me of using swank-js with Emacs, as demonstrated in a short Emacs Rocks! screencast[1].
[1]: http://emacsrocks.com/e11.html http://emacsrocks.com/e11.html
Basically, you can hook Emacs up to the browser and interact with the page directly without having to refresh it. You can do some really cool stuff as shown at the end of the screencast.
All this without having to sacrifice the inherent editing and programming power of Emacs.
In the screencast, code gets reevaluated using a key command (C-x C-e), just like Emacs does for lisp. However, since Emacs is extremely programmable, it would be pretty easy to set it up to run any new code as soon as you finished modifying it, or on a timer, or however you like.
As an aside, the rest of the Emacs Rocks! videos are also worth watching--they make it very clear why people really like Emacs. For example, episode 12 (about editing HTML with Emacs) not only shows how powerful some of the default modes are, but also how easy it is to customize commands.
- julian37 14y agoShameless plug, my toy project is integrating the WebKit debugger with Emacs: https://github.com/jscheid/kite https://github.com/jscheid/kite Live editing (or "hot swapping" as it's called in the article) is my main, long-term objective. I can only devote so much time to it, and it's not as far along as I would like it to be. But, getting there... do take a look at the other branch if you're curious.
- tikhonj 14y agoOkay, that's pretty awesome. I almost wish I was still doing web development so that I could play around with the great stuff coming out for it! If I ever get back to web development--and, the way these things usually go, it's probably inevitable--I'll definitely give kite a go.
- seanmcdirmid 14y agoHot swapping is a prerequisite, but not sufficient for live editing (or live programming as I call it). You also need to ensure that you can have responsive feedback about your edit via framework or programming model affordances. This is just hot swapping (as they claim), it's been around since before smalltalk.
- julian37 14y agoGood point, I shouldn't have lumped together the two concepts. Thanks for clarifying. I would add that this all seems to be in pretty early stages on the WebKit side, too. For example, I had hoped that when the debugger hits a breakpoint, and you hot-swap code in the current call frame and restart the frame, what would happen is what you'd expect to happen, alas--at least with Chome Canary--this doesn't seem to work yet. So yes, you're right that true live editing is not around the corner, with or without Kite. I'm just aiming to get as close as possible.
- seanmcdirmid 14y agoThis is stated most eloquently in Christopher Hancock's dissertation [1]: > And yet, if making a live programming environment were simply a matter of adding “continuous feedback,” there would surely be many more live programming languages than we now have. As a thought experiment, imagine taking Logo (or Java, or BASIC, or LISP) as is, and attempting to build a live programming environment around it. Some parts of the problem are hard but solvable, e.g. keeping track of which pieces of code have been successfully parsed and are ready to run, and which ones haven’t. Others just don’t make sense: what does it mean for a line of Java or C, say a = a + 1, to start working as soon as I put it in? Perhaps I could test the line right away—many programming environments allow that. But the line doesn’t make much sense in isolation, and in the context of the whole program, it probably isn’t time to run it. [end quote] Light Table is interesting in this regards, though I'm not sure what they are claiming yet. I (and others like Jonathan Edwards) think we'll have to accept significant changes in our programming models to achieve true live programming, that we can't just tack it on transparently to our existing stack, e.g. by snapping back a few stack frames on an edit. [1] http://llk.media.mit.edu/papers/ch-phd.pdf http://llk.media.mit.edu/papers/ch-phd.pdf, page 56 bottom
- julian37 14y agoHighly interesting, thanks for sharing your thoughts and the link to that paper. Really I'm just trying to improve turnaround time when developing Web apps. I think that between full-page reloads and research into better programming models, there's some middle ground worth exploring. I guess I shouldn't be using the term "live editing" for that, though.
- rayiner 14y agoSLIME+your favorite dynamic language is a tactical nuclear weapon of a programming tool. I just wish there were a more OS X-y port of Emacs...
- eric_the_read 14y agoI used Aquamacs for a while, but I found GNU emacs had everything I needed- clipboard integration, cmd-s and so on. Out of curiosity, what do you want that's more OS X-y?
- rayiner 14y agoReal OS X text widgets that scroll properly and respond to mouse input properly.