3 ms·
When it comes to extensibility, Emacs and Emacs Lisp have one of the most compelling stories of all time. (In fact, is there anything that beats them?) If Andy
by gruseom 15y ago
When it comes to extensibility, Emacs and Emacs Lisp have one of the most compelling stories of all time. (In fact, is there anything that beats them?) If Andy is right that Guile can do for GNU what Elisp did for Emacs, only better, it would be downright amazing.
I wonder, though, whether some things that made Emacs/Elisp so successful would get lost in the switchover. For example, while dynamic scoping is bad for writing robust complex software, it does make Emacs easier to extend.
Emacs is not really an application or a platform, it is a framework: a framework for a text editor, one that comes with a well-thought-through model and a flagship application (Emacs itself) that doubles as a development environment. I don't mean "model" as in MVC, but in the sense of a consistent set of concepts that can be composed to do things. In Emacs those concepts are things like buffers and windows and text properties. Emacs has one of the best models I've ever seen; it should be taught as an example of how to do this kind of design. Emacs on the surface may be clunky and unlovable, but dive underneath and its world is beautiful.
When people extend Emacs, they're building programs out of that model using tools designed for building programs out of the model (which themselves were built out of the model). If you shift from Emacs to GNU as a whole, you're moving from that single -- self-consistent and composable, not to mention interactive -- design context into a hugely diverse environment with no common design context at all. If Emacs is a planet, GNU is a universe. It's not clear how well Emacs' extensibility magic can be reproduced at that level. If the benefits come mostly from the language, Andy may be right. I hope he is. But if the benefits come mostly from Emacs' framework and interactive environment (both of which are inseparably bound up with the language), then the magic is likely to be left behind with them.
Still, it's hard to argue against his case for choosing the most powerful possible extension language so as to maximize the extending that people will be able to do with it. To argue against this in favor of familiarity is particularly to miss the point.
- Peaker 15y agoHow does dynamic scoping make Emacs easier to extend?
- yoklov 15y agoIn a system with dynamic scoping, you have access to variables which otherwise you might not. If it were written in scheme, it might be more difficult to know how many buffers are currently open or some other text-editory value than it is in emacs lisp. Interestingly, from what I've seen dynamic scoping hasn't hindered emacs lispers at all. They have some sort of variable naming system that is specific enough that confusion is fairly rare (I've never seen anybody talk about variable naming conflicts, at least). For example, the value of the (chosen randomly out of my .emacs) ``ido-auto-merge-work-directories-length'' variable seems unlikely to be changed accidentally. That being said, Scheme/Guile have dynamic fluids which allow for the same sorts of things to be done. Personally, I feel like these would have to be used heavily in order to for a hypothetical lexically-scoped guile-based emacs to work, but maybe thats just because I feel like dynamic scope makes things easier to extend :p (at least, in this sort of program).
- p4bl0 15y agoIt seems dynamic scoping is not really an issue for Guile to host Emacs Lisp. See the paragraph from the README[1] of the current implementation: flet and flet*: --------------- These constructs behave exactly like let and let*, except that they bind the function slots rather than the value slots, and so make dynamic scoping available for functions, too. To me this sounds like the dynamic scoping issue has already been solved. [1] http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/language/elisp/README;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=mod...