reddit / emacs
Is this a good way to describe Emacs?
megaman6710 · 2022-08-18 14:24
I am very new to Emacs, I see the potential it has, but I want to make sure I can accurately describe it to others. I have made-up my own explanation of Emacs, and I just want to make sure I'm not saying anything blatantly wrong.
>Emacs is more than a text editor, it's a Lisp interpreter. Anything you can code with Lisp, you can do in Emacs. Much like how a web browser is just an HTML (& CSS & Javascript) Interpreter. Anything you can write in HTML, you can make a web browser do.
>However, web browsers are external to your computer. You can use a web browser to edit a photo, but you have to upload the photo, do the edits, and then download the photo again, and that's inefficient. Emacs works completely on your system, using your computer's resources to their fullest potential. A web browser could never make files or folders on your computer, but Emacs can, and incorporate so much more into your system.
This is the assumption I've managed to get out of my first few days with Emacs. Let me know if I'm letting some large component out, or if even this is just scratching the surface of what Emacs can do.
nv-elisp · 2022-08-18 14:29
HTML isn't the browser's analogue to elisp. That would be JS.
anaumann · 2022-08-18 14:30
How are web browsers external to my computer? It's running there just the same, using even more CPU time than emacs ;)
And I would argue that emacs is more editor than lisp interpreter.. It does have one built in, it can be extended using lisp, but that's about it.
What it really does in that regard: Provide a number of functions to hook into and extend to fully customize the editor to your needs.
megaman6710 · 2022-08-18 14:31
I thought so, since HTML is just a markup language.
Is elisp comparable to JS? Is one more "powerful" than the other?
anaumann · 2022-08-18 14:34
It depends on your browser.. your everyday Chrome is made to keep random websites from doing harm to your computer, an embedded browser like in Electron can do pretty much everything you can think of.
Once you're past that, it boils down to a lisp vs javascript shootout and it's probably more personal preference than anything else.
nv-elisp · 2022-08-18 14:34
Depends what you mean by powerful.
megaman6710 · 2022-08-18 14:37
I think calling it just an editor is a bit understating. I never played tetris in vim.
I think of web browsers are external since, usually, the websites you access are external. In order to view a news article, your browser sends a request to a server for the article, the server responds with the content, and then the web browser displays the response from the server. Whereas Emacs is often calling on files stored on your own computer/local network.
pwnedary · 2022-08-18 14:37
> You can use a web browser to edit a photo, but you have to upload the photo, do the edits, and then download the photo again, and that's inefficient.
This is not true. JavaScript does such things client-side, without having to have the remote server do the operation.
anaumann · 2022-08-18 14:42
I've already played tetris while copying a floppy disk some 30 years ago :D
Jokes aside: You can make a website do things locally, you can make emacs call a webservice for something.. The boundaries are less clear than you might think :)
But first and foremost, emacs strong suit is handling text and as an extension to that, text-based data.
megaman6710 · 2022-08-18 14:42
I may not be the best on terminology, but Emacs is more "local." Your own scripts instruct your own client how to behave, with little to no outside requests taking place.
Fourstrokeperro · 2022-08-18 14:43
WebAssembly even more so.
megaman6710 · 2022-08-18 14:47
> But first and foremost, emacs strong suit is handling text and as an extension to that, text-based data.
Great way of putting it. It displays and edits texts better than I've ever seen before. If you want to edit your own text, that's fine. If you want text displayed based on an IRC server, Emacs can do that too.
7890yuiop · 2022-08-18 14:48
> However, web browsers are external to your computer.
...is where I lose your train of thought entirely. What could that statement even mean?
The first paragraph makes some sense (for some audiences a comparison with a web browser might be helpful, although it's not an analogy I'd jump to myself), but I can't figure out what you're trying to say after that point.
I'd describe Emacs as a text editor, and also a programmable framework for text-oriented keyboard-driven applications (including, but very much not limited to, text editing), often interacting with files and processes (on both local and remote hosts).
----
If you're talking to a non-technical audience, perhaps you could phrase that more as:
Emacs is an extensible application which contains any number of 'child' applications inside it. You can display multiple applications at the same time, switch between them, and hide or show them as you wish. Applications can interact with files, processes, and network resources. By default it comes with dozens of applications including a text editor, a file manager, an organisational tool, a scientific calculator, and many, many more. Emacs is fully-programmable, meaning that new applications can be written for it by anyone (including its maintainers, third-party developers, and any user), and hundreds of applications are available for download. All applications are text-based and fully keyboard-driven as standard (graphics and mouse UIs are both supported too), and text-based commands (including searching, copying, and editing) can generally be applied to any text in any application, taking powerful advantage of familiar keyboard commands and a standardisation on text formatting.
akirakom · 2022-08-18 14:48
One of the biggest differences between modern web browsers and Emacs would be how they are extended in their extension languages:
- Web browsers are mostly written in a systems programming language such as C++ and Rust. They provide an extension system which lets the user extend the browser in JavaScript, but the extensibility is limited. Browser tabs are sandboxed for security.
- Emacs has a core Lisp interpreter written in C and some functions written in C, but lots of its features are written in Emacs Lisp. It makes Emacs much more like a monolithic Lisp interpreter. However, it's a less secure model.
megaman6710 · 2022-08-18 14:55
Web browsers are a lot more "Send request, display request" in function, where as Emacs instructions are often stored locally on the client machine. Your web browser on your machine is temporarily storing web pages and doing much of the processing locally, but it does this by calling on external sources and getting external instructions. (external instructions hopefully requested by you.)
thetemp_ · 2022-08-18 15:00
>but Emacs is more "local."
Not really. Emacs can and does work over the network. It has Tramp for working on remote files. It even has a web browser built-in, among other network-based applications.
You can make Emacs browse the web, but that isn't it's primary purpose. You can also edit programs inside a web browser (through a webapp), but that's not its primary purpose either.
Both have built-in interpreters (Emacs for elisp, and web browsers for JavaScript). And in modern use of web browsers, it's arguably true that their ability to interpret JavaScript has become even more important than their ability to render HTML documents.
But Emacs is productivity software (a very unique example of same). A web browser is primarily meant for rendering content. Either one can be shoehorned into doing some of what the other does, but that gives a skewed impression when comparing the two.
tldr; apples and oranges
megaman6710 · 2022-08-18 15:10
Apples and oranges, but both are fruit grown from a tree.
brightlystar · 2022-08-18 15:14
This seemed to start very well.
> Emacs is more than a text editor, it's a Lisp interpreter. Anything you can code with Lisp, you can do in Emacs.
Yes exactly right. But after that everything about "web browser" and "HTML interpreter" and "external to your computer" sounds like confused analogies.
megaman6710 · 2022-08-18 15:27
Wording isn't exactly perfect, web browsers are much more powerful as a JS interpreter. But I believe the analogy of Emacs working "like a web browser" is sound, as people that have never heard of Emacs, knows how powerful a web browser can be.
But web browsers aren't powerful on their own. You can't edit photos, you can't listen to music, all these things people use web browsers for, they need to access external sources for. And they may need to access these external sources multiple times. Whereas with Emacs, once you download the script once, you own it for good. You're not redundantly storing more cached web pages or anything like that.
7890yuiop · 2022-08-18 15:36
Ok, so you meant to say that the *programs* being executed by a web browser are typically obtained from a source external to your computer.
The web browser itself is almost certainly local.
megaman6710 · 2022-08-18 15:37
Absolutely correct. The web browser is stored locally, there isn't any virtualization or anything like that.
7890yuiop · 2022-08-18 15:41
I think it's not a particularly useful point to make. Emacs can also call on external sources, including getting elisp programs from remote sources. Emacs itself might well be running remotely. (A web browser might be running remotely as well, but that's certainly less common.)
I don't think it's a comparison which helps to describe Emacs.
AccurateRendering · 2022-08-18 16:05
JS is a Lisp implementation with infix notation (well, at least it used to be).
Sudo_Brew · 2022-08-18 16:20
Technically speaking, since both are Turing-complete, they're mathematically equally powerful
akirakom · 2022-08-18 16:26
I would like to know why someone has downvoted this comment.
00-11 · 2022-08-18 17:45
This.
Most of the comments here are about your second paragraph (web browser...), which is a distraction.
What's more important is this: Your first paragraph is good. And probably sufficient.
MitchellMarquez42 · 2022-08-18 18:58
The real answer
MitchellMarquez42 · 2022-08-18 19:16
> Anything you can code with Lisp, you can do in Emacs.
It's more like, to do something in Emacs is to code it with lisp. When you press the Down arrow, you are calling the lisp function `(next-line)`. It's the same as calling it manually with `M-x` (well, kind of. Some commands can prompt for additional input, read the key that called them, etc).
Also, Emacs Lisp is far from the only lisp out there and many other dialects can do way more. For example, Common Lisp can hook into external C libraries and puppeteer them into its own object model. For an extreme example, check out [the Nyxt web browser](https://nyxt.atlas.engineer/).
deaddyfreddy · 2022-08-18 19:35
> And I would argue that emacs is more editor than lisp interpreter.
a text-oriented UI framework
anaumann · 2022-08-18 19:40
With an editor as its demo application/reference implementation :D
bdunbar · 2022-08-18 20:25
> accurately describe it to others
Why?
dpoggio · 2022-08-19 01:14
Capable and powerful are a bit different to me.
dpoggio · 2022-08-19 01:20
The only analogy between Emacs and a Web browser is: both include some interpreter. That comparison matches a ridiculously big amount of software. No browser exposes it’s core with neither JS, nor HTML as Emacs exposes its own with Elisp.
entangledamplitude · 2022-08-19 01:45
Though not quite 100% technically correct, I think you are getting the spirit. Depending on your purposes, and desired level of sophistication (If this is intended for someone else), this might even be passable.
A few improvements:
1. As you’ve correctly identified below, JS is closer to Elisp, and in that analogy HTML in browser tabs is kinda like the plain text in Emacs “buffers”
2. JS is so critical to modern browsers that tons of resources have been invested into improving the performance of JS engines in the browser. Elisp is nowhere as good, but makes up for it in accessibility/flexibility as used in Emacs and packages (because the community values & prioritizes this highly).
3. Your comments about the web browser are actually comments about “software running in the cloud”. Technically* someone could write full-fledged software in JS and even run it in the browser (that’s the idea behind electron based apps), but most software we use in the browser tends just talk to the “cloud” where all the important stuff happens. You are right to surmise that Emacs has a very different philosophy that aims at giving the user full control.
(*there are limitations/restrictions, and good & bad reasons, but that would be too much detail for this conversation)
Hope that helps.
microamplifier · 2022-08-19 02:10
For me, it’s Howl’s Moving Castle! >.< https://giphy.com/gifs/howls-moving-castle-wUCgLRvDdtWs8
akirakom · 2022-08-19 13:52
I remember Steve Yegge once pointed out [Common Lisp is Howl's Moving Castle](https://steve-yegge.blogspot.com/2008_11_01_archive.html).
sunnyata · 2022-08-19 14:25
Lol if I were you I'd stop digging. Your analogies are leaky, misleading and distracting, and it's been explained why.
Abhinav1217 · 2022-08-19 14:54
The old classic phrase is
> Emacs is an amazing Operating system, which needs a good editor for it
akirakom · 2022-08-19 15:31
Browser extensions are like Emacs Lisp packages, while client-side scripts shipped by apps are not. So I admit the note on security is pointless.
shami1kemi1 · 2022-08-20 09:24
No, not really. It lacks, and has always lacked, some of the most important properties of Lisps, like being expression-based (like many other languages, JS distinguishes between expressions and statements), or being able to manipulate the syntax via the use of macros.
Not being homoiconic is a large reason for those limitations.