reddit / emacs
Is there any other program like emacs, as in a user-space OS?
LowCom · 2022-04-26 07:02
Coming from vim, now I realise emacs is not just a text editor. It is a lisp interpreter and thus functions like an OS from which you can do several different things and thus use your common key binds etc across several different applications.
​
Is there any other program which does this? I am not looking for an alternative. I am just curious as I never came across such a program before and why isn't this more common? Like there could be python based or C based emacs-like programs, right?
nderflow · 2022-04-26 07:16
KA9Q comes to mind. https://en.wikipedia.org/wiki/KA9Q
WikiSummarizerBot · 2022-04-26 07:16
**[KA9Q](https://en.m.wikipedia.org/wiki/KA9Q)**
>KA9Q, also called KA9Q NOS or simply NOS, was a popular early implementation of TCP/IP and associated protocols for amateur packet radio systems and smaller personal computers connected via serial lines. It was named after the amateur radio callsign of Phil Karn, who first wrote the software for a CP/M system and then ported it to DOS on the IBM PC. As the KA9Q package included source code, many radio amateurs modified it, so many different versions were available at the same time. KA9Q was later maintained by Anthony Frost (callsign G8UDV) and Adam Goodfellow.
^([ )[^(F.A.Q)](https://www.reddit.com/r/WikiSummarizer/wiki/index#wiki_f.a.q)^( | )[^(Opt Out)](https://reddit.com/message/compose?to=WikiSummarizerBot&message=OptOut&subject=OptOut)^( | )[^(Opt Out Of Subreddit)](https://np.reddit.com/r/emacs/about/banned)^( | )[^(GitHub)](https://github.com/Sujal-7/WikiSummarizerBot)^( ] Downvote to remove | v1.5)
WikiMobileLinkBot · 2022-04-26 07:16
Desktop version of /u/nderflow's link: <https://en.wikipedia.org/wiki/KA9Q>
---
^([)[^(opt out)](https://reddit.com/message/compose?to=WikiMobileLinkBot&message=OptOut&subject=OptOut)^(]) ^(Beep Boop. Downvote to delete)
7890yuiop · 2022-04-26 07:50
> It is a lisp interpreter
Yes.
> and thus functions like an OS
This is merely a popular joke. Emacs is nothing like an OS.
> Like there could be python based or C based emacs-like programs, right?
Well, GNU Emacs is C based. That's what the lisp interpreter and other performance-critical code are written in. But sure, you could doubtless have a similar system extensible in C -- the extensions would need to be compiled on every system, though.
alanthird · 2022-04-26 08:43
I've never used it, but my understanding is that Smalltalk is similar, in that it provides an environment within which you can run multiple programs.
LowCom · 2022-04-26 09:14
> This is merely a popular joke. Emacs is nothing like an OS.
What is the correct term for a program like Emacs, which allows wide changes in its functions and allows to create new applications in it through extensions? I am not able to find the correct words (I'm not a programmer). But although I have used many other programs which could be modded and extended, here the level of extension seems to be so much higher.
7890yuiop · 2022-04-26 09:22
I don't know if there's any particular term for it.
> here the level of extension seems to be so much higher.
Indeed, it's certainly uncommon.
folcred · 2022-04-26 13:02
I would say "interpreter" is probably the closest term for Emacs. In a nutshell it does the same thing Python does, interprets code to preform some function. It's no more an OS than Python is
Really, all the "applications" Emacs has by default, the editor, calculator, calendar, IRC client, org, terminals, etc., they're all elisp programs. On a Linux system if you looked in `/usr/share/emacs` you'll find all the code files there, just like you might have several folders of Python code to create some application. They're the apps that come with it by default. Core Emacs, the C code part, is what's used to interpret that code, just like Python would for folders of Python code.
As to is there any other program like Emacs, that has it's program-ability, these days I'd say the closest are possibly Atom and VS Code. I have no experience with them, but my understanding is they use typescript/javascript in much the say way as Emacs uses elisp, only they use Node to interpret the code, and Electron to draw the UI.
IMHO "interpreter" is a far more accurate way to describe Emacs.
sunnyata · 2022-04-26 13:17
> What is the correct term for a program like Emacs, which allows wide changes in its functions and allows to create new applications in it through extensions?
I would say "platform" or "framework".
LowCom · 2022-04-26 14:03
Oh then why isn't there a python equivalent to emacs?
Python is most famous for its wonderful packages, then I guess something like this could have been implemented in python?
You are right about VS code being very similar, it's extensions offer a lot of additional features. Then what differntiaties emacs from something like VS Code. They both are interpreters for a scripting language, are primarily text or code editors and have extensions to deal with many other formats like pdf,latex, calendar etc. I guess it's just that emacs is "more free" and offers more and easier customisability?
KDallas_Multipass · 2022-04-26 15:21
Loosely I would say that this amounts to having a robustly programmable runtime system that allows for modification of the application itself
bobbane · 2022-04-26 16:50
[Medley](https://interlisp.org) qualifies in a similar fashion.
It's a portable emulator for Xerox D-machine hardware, with a complete Common Lisp and Interlisp-D development environment.
weevyl · 2022-04-26 17:15
Occasionally I toy with the idea of writing a Python-based equivalent of Emacs: a Python interpreter extended with the notion of buffers, windows and frames and where everything can be mapped to functions.
But then I remember I already have Emacs and there's no need to reinvent the wheel. Maybe I will change my mind once I'm retired, but until then Emacs it is.
ftrx · 2022-04-26 19:18
> Is there any other program which does this?
Smalltalk's in general, Pharo as one of the most modern looking ones, see for instance https://youtu.be/Pot9GnHFOVU in origin it was a complete OS, at Xerox time, see for instance:
- https://youtu.be/M0zgj2p7Ww4
- https://youtu.be/Cn4vC80Pv6Q
- https://youtu.be/ODZBL80JPqw
But since them some say "hey, no one want such desktop computers, we just need printers with computing abilities and teleprinters, far simpler, far cheaper" and so the Unix history began. In few years the simple and cheap model appear to miss a real desktop and GUI, they was created, violating all Unix foundation principles (being a set of small programs, like Smalltalk methods, the users can combine with IPCs in a CLI or in scripts, GUIs have only cut/copy/paste as "IPCs") and they keep going. Someone at MIT thought that's a bit illogical and the Symbolics/Lisp Machines era see the light, with Emacs, a dedicated fork named ZMacs, workstation that process lisp down to the hw, far more flexible and powerful than original Xerox with Smalltalk BUT also far expensive so they end up badly... In the meantime IBM start to sell even cheaper stuff and they succeed to a point that years later DOS and Windows overtake even unix being even cheaper...
The above succinct story is a bit too succinct to be taken as "history" but more or less that's what happen: original computers where back in the past and just calculators and teleprinters, all know that, but nearly no one remember that MODERN computers where back in the late '60s to the '70s, Desktops, the same kind of modern ones, with mouse, GUIs etc, even our first videocall with screen-sharing was from 1968 [1]. After that pioneering phase commerce suck out all innovation just to sell cheap and limiting stuff one after another and we, the public, just re-discover, sold as new, a bit of a feature here and there, coming from that era, and implemented decades after in buggy and limited ways. It was for GUIs, it's now for NoteBook UIs, ...
If you read The Filter Bubble by Eli Parisier the first part describe in succinct but nice manner how GAFAM fortune was build technically on Xerox PARC features, implemented in anti-users and limited ways. Another good one is Fumbling the Future by Douglas K. Smith and Robert Alexander who condense the PARC history.
Some future (and vague, so far) modern development I know might be from
https://twizzler.io/ and see https://youtu.be/bSNda9EzNOI really usable these days as Emacs however I know only Emacs...
[1] the so called Mother of All the Demos on NLS, another historic OS
BunnyLushington · 2022-04-26 19:22
>Is there any other program which does this?
Bear with me a little on this one but I'd propose QLab ([https://qlab.app](https://qlab.app)) as an example of an extensible (in AppleScript) application in ways that are reminiscent of Emacs. Very briefly: QLab is a mechanism for firing (usually theatrical) cues, like sound, light, or video. It also has the ability to run an (AppleScript) script cue. Such a cue might do something external (in one recent usage I had cues that made web requests to control a custom Arduino controller that controlled an electromagnet on stage) but because QLab itself has an AppleScript dictionary, users can trivially\[\*\] change some aspects of the program's behavior from within the program itself. (In other words, a script cue might execute functionality on the QLab instance that fired it.) It's certainly not an open framework like Emacs (the dictionary is limited) but it's possible to create some fairly sophisticated functionality that the developers didn't plan on.
There are other examples: e.g., script-fu in Gimp but I like the QLab example because it walks a line between easy to use (if that's what you need) and surprisingly powerful.
\[\*\] "Trivial" if you believe programming in AppleScript is trivial, of course. It's not what I'd call a pleasurable experience but because you can do things like open UI widgets and execute shell commands it's more powerful than it appears at first blush.
AlanYx · 2022-04-26 19:22
Someone has already mentioned Smalltalk, but Squeak Smalltalk is a particularly good example of this. Everything exists on top of a Smalltalk virtual machine, like elisp's virtual machine. Obviously there's a text editor and a debugger and a lot of other stuff built in, but it's also an environment where you can write or download other programs that run in the same environment. There's a package repository called SqueakSource that has web browsers, todo list apps, mailreaders, etc. It's just a fun environment to work and write code in.
That being said, the traction and mindshare that emacs has is unique because it's a good combination of an actual tool focused really well on common problems (coding/text editing) and a mutable environment. Because you're working with text rather than more complicated GUI abstractions, it's also less intimidating to build things with... less friction.
ftrx · 2022-04-26 19:30
> This is merely a popular joke. Emacs is nothing like an OS.
In architectural terms, yes, the correct name should be OE, Operating Environment, where the "system" part is now "alien", like GNU/Linux, Windows, OSX etc but in the past was part of the low-level Emacs, a fork of it, ZMacs by Symbolics...
> Well, GNU Emacs is C based. That's what the lisp interpreter and other performance-critical code are written in.
A small note: C is well-known to be just a step above (good) asm in performance terms, but various Common Lisp implementations are not that slow, and differently from many other "high-level" languages they can also be used to write a kernel. I do not know why Emacs core is in C, but I suspect that's not for performance reasons but to have access to the vast C libraries used by supported "bootloader"-operating systems, witch means to interface with them in ways that demand much more work to do with something like SBCL. No proof, and if some have insight I'm curious, just I smell that's was the reason :-)
> a similar system extensible in C -- the extensions would need to be compiled on every system, though.
That's the Suckless idea, or what's remain from Plan 9, but so far does not seem that nice: fast it's fast, but nothing really flexible and without Plan 9 infra under the wood it's terribly long doing even simple things...
I think too many do not visualize the "original" idea of Operating Systems, witch can be probably called Operating Environment anyway, that's is a single giant application, running barebone on hw, where some cohort of humans are engineers from hw to "system" parts of such app, others are just end-users who combine a gazillion of functions as they need/desire and can thanks to an easy, open, fully integrated language+environment develop many "applications" (functions, module, something that do not exists and they want) with ease vs the modern idea born between old IBM and Unix that the system is a thing, separated from the rest, that only few can see or touch and something else exists for end users on top of such layer. The first vision live in Pharo, in modern Emacs etc, the second one in modern OSes and have shown very well it's limits.
ftrx · 2022-04-26 19:38
> What is the correct term for a program like Emacs, which allows wide changes in its functions and allows to create new applications in it through extensions?
For mere "runtime changes" you might use REPL, take any Common Lisp, like SBCL and you can live change anything. Some Lisp was used for NASA Mars missions, remotely debugged and changed, some live today for instance in StumpWM, a tiling windows manager written in CL or Maxima a CAS (Computer Algebra System).
Emacs do more, in the sense that a classical REPL is a CLI, for instance you can change a live instance of StumpWM but you do so in a CLI environment or in Emacs. While Emacs it's a 2D environment, you can write and execute code anywhere with no read-eval-print loop *only* style.
As mere programming languages various common lisps, like the aforementioned SBCL, racket is even more flexible since it's designed to be a language to create new programming languages, it have a certain GUI support but revolve most around DrRacket witch is both it's official IDE and environment, Smalltalk (see Pharo) and few others.
ftrx · 2022-04-26 19:51
> Oh then why isn't there a python equivalent to emacs?
Probably because it will be too complicated: lisp family languages are a bit harder to master at first but are very powerful, any programming language can be used to program a bit anything but on scale you can write a giant and still manageable lisp program, it's far harder do the same for an equally giant one in other languages.
The reason why lisp family is almost lost is that it's model is wide open and an application is not an isolated product so you can't easily create individual part of a systems made by different teams in isolation (like multiple-companies projects, where any of them "protect" it's own product) and so modern commerce-only IT dislike it. Not much in tech terms but in philosophical terms: if you have Emacs looking for help on a function it's natural look for it's source code, wrap it etc. If you see a FLOSS project in any other language probably you just want to build the code to run the final software, not looking around in it.
> You are right about VS code being very similar, it's extensions offer a lot of additional features. Then what differntiaties emacs from something like VS Code. They both are interpreters for a scripting language, are primarily text or code editors and have extensions to deal with many other formats like pdf,latex, calendar etc. I guess it's just that emacs is "more free" and offers more and easier customisability?
Modern editors are tool to manipulate text and stop. Classic ones are human-computer text-centric UIs. Emacs is "an editor" because 99% of humans productive activity on classical systems was (and largely still is) text. An email is text, a chat is text, a spreadsheet is text, a note is text, a feed with relevant articles is text, ... so the human-computer interaction tool is something able to process text. Not just something to write it like VSCode. That's the subtle but giant difference. VSCode is build as a production-only tool, with a clear difference in mind between production (write code) and consumption (the final program you've written) while in Emacs there is no real difference between producing (both code and text, they are text anyway and in lisp data/code etc are equal citizens) and consuming. You can read a mail in Emacs and Emacs do not need anything special to know that's a mail, it's just text with some display stuff to make it colored in a nice way. It's read-only by default, but you can switch to read-write at any time, you can add a sexp and execute it. There is no separation. Anything is integrated because humans are integrated, we use the same mind to do all we do, so there is no reason to have something for a thing and something else for another with barriers in between. Barriers obstacle innovation.
folcred · 2022-04-26 22:38
I think perhaps one major reason is no one has seen a need to build yet another editor in Python. Emacs predates Python by somewhere around 2 decades. Emacs was created because there was a need for something like it. By the time Python was created that need no longer existed, there were already plenty of editors and other tools. Even more so now.
As to what differentiates Emacs from VS Code, well, as I said, I have no experience with VS Code, so I can't say from first-hand knowledge. I suppose the major difference is the languages they're written in. There are far more people with a least some basic knowledge of javascript these days than people working with a dialect of lisp, so it's understandable they would likely choose VS Code to hack on and make their own.
For me personally, the fact that if I find myself stuck at a TTY, Emacs is still there for me. It works both as a GUI and as a text-mode only tool. GUI only tools are useless when you're stuck at a terminal. With Emacs I have my editor, my file manager, IRC client, web browser, shell, everything I need to fix the problem, all with the same familiar keys and tools I'd have with a GUI. That, and as I'm not a programmer by trade, I find elisp a bit easier to understand then javascript.
LowCom · 2022-04-27 02:30
Great answer, I have always been looking for a text based spreadsheet. As why should any basic spreasheet be so much bloated like Excel or calc, when I only want to do a few things with it. Make tables, sort, use formulas etc. A text based spreadsheet should be able to do all these. Emacs org's tables seems to come very close to this idea though I have not used it much to say if it can replace excel for my day to day use ( as in simple use, not power query and crazy stuff lieke that)
Is there any good text based spreadsheet you recommend apart from that? Do you use org tables for that purpose?
LowCom · 2022-04-27 02:36
Does SBCL have lisp similar to emacs lisp ?
LowCom · 2022-04-27 02:46
Woah, very interesting. Do you recommend any such good classic programs now available?
hughjfchen · 2022-04-27 06:32
SmallTalk is the first thing coming to my mind when I say this question, just as others do.
ftrx · 2022-04-27 16:25
Trying Pharo might be worth it, trying modern emulators of old glories honestly is meaningless... You will not use them for real so investing time to get them to work is just a long investments just to satisfy a short-living curiosity...
ftrx · 2022-04-27 16:32
It's a Common Lisp, so it have all Emacs has minus Emacs functions (there is no org-, dired, buffer etc so to speak) plus various CL stuff who are partially ported to Emacs via CL-lib and cl- prefix (like `loop` witch is `cl-loop` in Emacs).
Essentially all lisps are "the same" with identical or similar constructs like some who define a function like
(defn name () ...)
others prefer
(defun name () ...)
others something else but the language it's that. CL is the II tentative to standardize and modernize lisp, ANSI was the ancestor, CL add gazillion of things older lisps do not have like objects, conditionals etc but the reasoning and usage are the same, the hard part is finding the good function you are looking for from an implementation to another when you start.
Documentation unfortunately is like implementations: very fragmented... Practical Common Lisp by Peter Seibel is a very good intro though.
ftrx · 2022-04-27 16:46
> Is there any good text based spreadsheet you recommend apart from that?
I vaguely remember some curses-based but not really text-centric, so honestly I say probably no.
> Do you use org tables for that purpose?
I do use org-tables with rare computation and plotting (org-plot) in them but not as "real" (complex) spreadsheets, I consider the concept behind spreadsheets very bad. For small automation tables with formulates are ok, for larger stuff dealing with a programming languages and it's built-in data structure and eventual libs/modules is far easier IMO.
A stupid example, years ago I want a way to match Amazon charges to items I ordered, I see for a single order few charges on my bank but they do not state witch thing I bought so... At that time I was not in Emacs and now I've just imported the old code in org-babel
#+begin_src python :results output
# refs
# http://en.wikipedia.org/wiki/Knapsack_problem
# http://en.wikipedia.org/wiki/Subset_sum
import numpy as np
# comma-separated list of items/shipping fees
array = np.array([31.00, 11.27, 24.90])
# charge I look for
num = 42.27
def subsetsum(array,num):
if np.isclose(num, 0) or num < 1:
return None
elif len(array) == 0:
return None
else:
if np.isclose(array[0], num):
return [array[0]]
else:
with_v = subsetsum(array[1:],(num - array[0]))
if with_v:
return [array[0]] + with_v
else:
return subsetsum(array[1:],num)
print('Prices : ', array)
print('Charges : ',num)
print('Objects : ', subsetsum(array,num))
#+end_src
I do not use that often but I can type vars in an org-table and pass it to the python block. That's to say how Emacs is flexible and a spreadsheet is not needed :-) try to solve it in Calc/GNumeric/Excel and tell how much time it take!
Another example you might like (see also others video from the same authors): https://youtu.be/w3LbuI5naMI
trs_80 · 2022-04-27 22:01
I have to give you a lot of credit u/LowCom, you really seem to be grokking Emacs in a way that many never seem to be able to (and especially, coming from Vim).[0]
I cannot think of examples as others have, but I think the comments hinting at paradigm shifts are the most interesting/relevant. Emacs is special, IMO, because it hails from a different time and mentality where the computer should serve the hacker/user, without limit. In particular, there is not this notion of separation between 'Operating System' and 'applications' as we think of them today.
I think there is also something special about Lisps themselves, and that the choice of implementation language was by no means accidental. As I hinted to in [a comment](https://old.reddit.com/r/vim/comments/uc6t8d/just_discovered_emacs_as_a_long_term_vim_user_and/i6g4lsv/) in [your other thread](https://old.reddit.com/r/vim/comments/uc6t8d/just_discovered_emacs_as_a_long_term_vim_user_and/), this is something I am myself just starting to get my head around the notion of. And therefore I think you might find some of Paul Graham's writings on the subject [1] as interesting as I have.
[0] No offense intended toward recent (nor long term) converts. :)
[1] If I piqued your interest, start with [The Roots of Lisp](http://www.paulgraham.com/rootsoflisp.html) to whet your appetite. If you want more, check out his book *On Lisp* which can be found [here](http://www.paulgraham.com/onlisptext.html) (among other places).
trs_80 · 2022-04-27 22:10
> GAFAM fortune was build technically on Xerox PARC features, implemented in anti-users and limited ways.
Even before you said this, I already was thinking, as I was reading through your post, how your narrative could be perfectly extended in a straight line to the modern day with so called 'smart' phones which are in fact really all about platform control and you get exactly as much functionality as the platform owner allows you to have. Even though the underlying technology (which have been around a while, and IMO implemented better previously) is capable of so much more.
Cheers.
ftrx · 2022-04-28 13:01
Perhaps this is a common pattern in capitalism, or even is societies in general.
Those who create the tech are mostly dreamers, always imaging a future perfect world, those who can made the transition between pioneering phase toward a widespread phase always fear for their position and do not trust the society at a whole, nor their competitors, the large mass of people "in the outside world" do not know nor the tech nor the transition process and mostly have no real interest in it, being generally reactionary, fearing the real change. So we keep evolving at different speed in a continuous "war-alike" chaotic manner instead of a cooperative manner. IT could be a gamechanger in that sense and probably that's why is so deeply hit just after the pioneering phase and keep evolving so badly.
Just imaging the modern world without modern aggregators by few IT giants, with personal aggregators instead, with usenet instead of modern socials: population would know and decide mostly autonomously as a real democracy, marketing would have limited grasp and much limited feedback, essentially all actual politicians would probably be second-class non-elected PRs in a desperate search for some crumb of success. With personal filters instead of centralized search or even push-based contents, variety of information would be there, without realtime clicks feedback journals would be journals not just forge and mediator between propaganda and readers will. As a result much more people would have a kind of big picture view on things and mean culture would be much higher. All sounds good, for us Citizens, BUT is a nightmare for those who profit from most citizens, and also a bit for us, at least in the west, because we still profit from other less knowledgeable people as well. In an age of scarcity...
Gnaxe · 2022-04-30 00:07
Smalltalk comes to mind first, as several others have mentioned. Squeak and derivatives (Pharo and Cuis Smalltalk, but also Scratch, Etoys, Croquet) are most notable. Dolphin and GemStone/S are worth mentioning.
GNU emacs is not the only one. There are several other emacsen. Numerous other editors/IDEs are highly scriptable and customizable, but mostly not to the same degree.
The web browser is also quite programmable nowadays, and fast enough to emulate older computer systems, including [the original Squeak](http://try.squeak.org/). The JavaScript console and bookmarklets allow for some easy customization, and the more ambitious can write plugins too. And, of course, web pages can be entire applications now, including IDEs, some of them highly customizable. https://lively-kernel.org/ is a very Smalltalk-like browser-based environment. https://jupyter.org/ and the related https://jupyterlite.readthedocs.io/en/latest/ are also worth mentioning.
Blender3D is fully scriptable in Python and had a complete game engine at one point.
thetemp_ · 2022-04-30 03:27
It occurs to me that what we referred to as the "OS" on early, pre-IBM-PC, home computers did essentially fit this definition.
If you had a Commodore 64, you simply turned it on, and were faced with a fully extensible environment in the form of an MS-BASIC command line. You didn't even have to boot from a disk like computers do now. The environment was baked-in to the hardware.
You could program it to play music, edit text, do calculations, play games, and even--eventually--get online.
It was well documented (though not self-documenting), and had impressive capabilities for its time. I still have a couple of these computers, which I fire up on occasion using a special adapter to connect them to modern video hardware. They were some of the first computers I ever used.
So maybe that's why I find Emacs so attractive. It reminds me of those early days. (Not to mention that Emacs was modeled after early "Lisp Machines". I have no personal experience with those, but my impression is that they were a sort of higher-end version of those early home computers, using Lisp as the built-in language instead of BASIC.)
b3n · 2022-04-30 07:27
I would argue that modern Web browsers fall into the same category. They are platforms for running applications, which can be simple HTML/CSS rendering, or full blown Javascript applications. They can be extended in Javascript and the extensions can impact every application, in the same way Emacs packages do. They have their own way of managing windows (tabs), distinct from the underlying window manager or operating system.
LowCom · 2022-04-30 14:13
Lol this exact thought occured to me later and I posted this question yesterday in this subreddit if emacs is conceptually similar to a web browser.