by marijn · 12y ago · 0 comments
(I use Emacs for all my coding, and Common Lisp is my favorite programming language, so, if anything, my biases would be in favor of Emacs. Sadly, it doesn't really deliver -- not that other editors get their interface right. Don't get me started on vim. ST is somewhat better, but doesn't expose powerful enough tools. If I may toot my own horn, I believe my own project, http://codemirror.net , does a lot of things right on the editor API level that popular editors get tragically wrong.)
(For me personally being able to run in a terminal is a huge feature, which means I'll probably be stuck w/ emacs forever -- no one making new editors seems to care about terminal support.)
JS would not be a better language. Guile could be.
I used to think a more semantically aware setup would be better. But the costs of semantic awareness are enormous, because a single mismatch between what your editor understands, and what the underlying language can represent, breaks everything. This makes things fragile; parser error recovery is not an easy thing to get right. Some artfully written regexes can go further, in a practical sense.
Part of what Emacs a great editor and Elisp a great tool for mutating -- if one can call it that -- is exactly the same things that make it "bad." Yes, it has dynamic scoping, and yes you can change variables outside your scope -- which is exactly the level of granularity your average Emacs hacker wants. He's not looking to write rock-solid code for the mars rover; he's trying to make M-x compile a bit less crap or a bit more specific to what he's doing.
Say what you want about side effects and advising and all the other "terrible" practices that, in any sane software project, would never pass peer review -- in Emacs it enables you to hot plug, duct tape and jury rig Emacs to get it to do what you want.
The last 2-3 years has seen a massive resurgence in Emacs packages and there's a lot of buzz in the community, I feel, in trying to push things in the right direction. But it takes time. And people. And we need both.
I guarantee you that if Emacs used a "real" extension language, with lots of OO and state hiding, you'd be yelling obscenities into the computer the first time you wanted to tweak some extension you had. Have you ever seen an Eclipse user tweak one of his extensions? Didn't think so.
Agreed the ease of modification of emacs is unparalleled (and tricks like dynamic scoping can be handy at times), but I'm not convinced that it wouldn't be possible to get something aprox. as flexible and easy to modify with a more robust culture and langauge. (But not a classic "real OO" language, which I agree would be very annoying -- I'm thinking something with a strong functional flavor and static structural typing...)
Whether this is really possible or not is an open question, though.
So out of curiosity, how far away do you think CodeMirror is from being usable as a real local editor - and by that I mean how far away would you be from using it instead of Emacs? It seems like it would be straightforward to embed in something like node-webkit[2]. What else then remains?
[1] http://eloquentjavascript.net/ [2] https://github.com/rogerwang/node-webkit
- The compiler really isn't very effective, so doing expensive things is often tricky and takes a lot of fiddly optimizing to get halfway acceptable performance (this should get better when/if guile becomes the Emacs compiler).
- But the killer is the APIs and conventions that exists around the language. It's neat with how little code you can do some things using direct actions on buffers, and the various hooks make a lot of things sort of possible, but I've found again and again that things just don't compose, scripts trample on each other's toes, and trying to deal with dynamic scope (even with lexical scoping, lots of interfaces depend on dynamically scoped variables and concepts, such as the current buffer) when you're doing something asynchronous is a total nightmare.
http://www.gnu.org/software/emacs/manual/html_node/cl/Struct...
http://www.gnu.org/software/emacs/manual/html_mono/eieio.htm...
I remember nicferrier and others discussing how to write lazy streams for elisp in order to have a more functional text processing ~std lib.
All in all I agree with you that the extensions are weirdly integrated and fragile, maybe it's time to build a side-project emacs with better abstraction layers.
ps: What's make me so sad it that elisp editing api is really not lispy in nature. Language doesn't dictate good design...
That said, an emacs rewrite in Clojure is a wet-dream of mine (emacs like goodness with the ability to use modern GUI libraries, ANTLR parsers etc... and speed!)
Although it seems to be stalled. Part of me wonders/hopes LightTable will get to the point that it is a viable replacement for emacs.
I'm not saying that makes vim a better editor than emacs. Just pointing out that vim has other options for extending. Also, I use vim and haven't found emacs to be more productive; in my college days I tried emacs, in earnest, for a few months. I came back to vim eventually, and haven't felt compelled to give emacs another go since.
Edit: it's obviously far from perfect, but it has stood the test of time and it lets you get things done. It's no Scheme or CL, but for what people use it for it's fine.
That said, I wish I could pin some of my hopes to the upcoming Guilemacs.
"Will it be open source?
I'm a firm believer in open source software and open source technologies. I can guarantee you that Light Table will be built on top of the technologies that are freely available to us today. As such, I believe it only fair that the core of Light Table be open sourced once it is launched. At some level, this is an experiment in how open source and business can mix - it will be educational for us all." - http://www.kickstarter.com/projects/ibdknox/light-table
In the meantime, humble projects are progressing along without all the young people JS-dev hype.... CodeMirror, emacs/vim editor plugins, etc
I am the founder of a browser based IDE software company, our product uses Codemirror exclusively and extensively..check my profile for the link if you want to check it out.
Beats the hell out of javascript.