top | item 25655923

Emacs Symbolic Integration

138 points| eklitzke | 5 years ago |gnu.org

76 comments

order
[+] submeta|5 years ago|reply
Emacs has got to be one of the most misunderstood pieces of technology. It's often made fun of [1], just because of this misunderstanding. Saying Emacs is an editor (mostly), is like saying a smartphone is a phone (mostly).

Emacs is actually an appliction framework (and a Lisp machine) with a unified interface where one application can share data with other applications via "buffers" very easily because the basic data is text (no proprietary or fancy datastructures that can get outdated at some time). With this underlying structure (plus with the integrated programming language Lisp) you can connect, combine, configure (to your liking) every application within Emacs easily. In non-Emacs world, using isolated apps (islands), I'd "beg" the dev teams to add this or that feature to make it more productive [3]. Not so in Emacs-land, where I can change every aspect of an app within minutes.

I have legacy tools / apps that were discontinued, and my data is stuck in those formats [2], and I don't have the time to migrate those documents.

Emacs is here to stay. And offers many apps (packages) for many use-cases: org-mode for project management, task-management, taking notes, writing complex documents, creating technical documentation with inline images, ascii tables, with embedded code (that can get run via org-babel); lsp-mode which transforms Emacs into a decent IDE; calc for doing basic to complex calculations within Emacs (documents); org-babel for doing literate programming; eshell for using your shell within emacs; mu4e which is a very good email client (says someone who used to use MailMate and was thrilled I could use keyboard shortcuts to control lots of aspects of my email client), and many more.

Emacs is the tool that will grow on you, and it will get better the more you learn about how to configure it.

---

[1]: "a great operating system, lacking only a decent editor"

[2]: EccoPro PIM from the 90s, AskSam (full text database) from the 90s, NoteMap (outliner), MS Access databases (from the 90s/2000s) with old format, and many many more.

[3]: Whenever I liked an app, I'd quickly start writing with dev teams back and forth in forums or via email. Bear.app, Ulysses.app, iA Writer, DevonThink, etc. Constantly writing to the dev teams, asking to include this or that feature.

[+] travv0|5 years ago|reply
> "a great operating system, lacking only a decent editor"

That joke seems to imply a perfect understanding that it's more than a text editor. It is, however, referred to as "The Emacs Editor" in its documentation and "an extensible, customizable, free/libre text editor — and more" on its official website, which could lead to some confusion about its primary purpose if that's not editing text. I do begrudgingly use Emacs as my main editor because that's what the communities of the languages I like use, but I do find the editing experience to be sub-par compared to other editors I've worked with, and I find that there are better external alternatives to any of the common elisp applications, barring org-mode.

[+] TeMPOraL|5 years ago|reply
Yup. All this.

Emacs being a platform within a platform is a feature. It comes with an extra benefit: it's a free (libre) platform. Completely shielded from corporate interests. There's no bullshit inside. No proprietary formats, no unnecessary network dependencies, no "X as a Service". Just a community of folks maintaining and expanding a parasitic OS that embraces interoperability and personal productivity above all.

[+] abeppu|5 years ago|reply
I agree, and I am frequently impressed by the tools people have built on this platform. But I think the "it's a great operating system" line is wrong because it has underinvested in scheduling and process management.
[+] imdoor|5 years ago|reply
> "a great operating system, lacking only a decent editor"

I've seen this thrown around when people joke why vim is better than Emacs and i think it's funny. But, seeing that Emacs has evil-mode, which is basically an implementation of vim on top of the said "operating system", i'd say it's false. Or ironic :D

[+] iso8859-1|5 years ago|reply
> the basic data is text

How can this work? Let's say I am developing a spreadsheet. Each cell has a formula, and it has a rendered text version. How can this work in Emacs? I want there to be a "underlying" strongly typed version of the data which is rendered, but Emacs forces them to be the same.

Unix (with pipes) also works with plain bytes, but many pipes are not necessarily rendered. Given that emacs is inherently visual, because you see the buffer if you're working with it, why can't there be data structures?

[+] pierrebai|5 years ago|reply
Which is exactly the reason why... VSCode is winning the editors war.

The main difference is that it chose javascript instead of lisp as its universal language, which, in the current world, is a much better choice for adoption.

Also, saying app can share data easily because the format is text buffer is either a tautology or a non-sequitur: not having a defined format can't be broken, sure, but it also cannot be reliably used. ask anyone who had to maintain bash/awk/perl labyrinthine assemblies...

[+] sachdevap|5 years ago|reply
One amazing use of symbolic integration: https://github.com/johnbcoughlin/calctex

Create latex equations in calc! :D

[+] iib|5 years ago|reply
This looks interesting and I want to use it. It seems to not be available on melpa, and the installation instructions for linux are missing, though. Are there any instructions for installation on linux that I miss? Apart from the cloning and tinkering that I will inevitably do if there is no easier way.
[+] Koshkin|5 years ago|reply
Sure, emacs is an OS [1], you can write any kind of programs for it.

On the other hand, you can do symbolic calculus in Scheme - see, for example, MIT Scheme-based Structure and Interpretation of Classical Mechanics (which, incidentally, is perfectly usable from inside emacs).

[1] http://www.informatimago.com/linux/emacs-on-user-mode-linux....

[+] fooofw|5 years ago|reply
Of course, in this example, the symbolic calculus functionality is distributed with the OS, or arguably even as part of it, which I guess is a bit more rare than simply having the option of installing it.
[+] contravariant|5 years ago|reply
Damn I'd been searching for ages to find a proper calculator. Turns out it's Emacs. Now I just need to get it on my phone somehow.
[+] sea6ear|5 years ago|reply
What kind of phone are you using?

If it's Android you can at least for the moment get Emacs on there using Termux. That's what I do - and it works pretty well. It might also be possible via UserLAnd, although I have not tried UserLAnd personally.

It seems like iSH on iPhone may provide similar ability (again do not have direct experience) although it seems unclear at the moment how long it will be able to remain available.

[+] agumonkey|5 years ago|reply
As a palliative you can always use some hp48 emulator.. you get some forth and some lisp all at once.
[+] brlewis|5 years ago|reply
Android? Termux will run it, even the Termux in the Play Store.
[+] jnxx|5 years ago|reply
You can run emacs on sailfish.
[+] agumonkey|5 years ago|reply
Oh yeah.. of course it calc.

On the tinier lib side there's bindat, to fiddle with binary data straight from elisp.

[+] choeger|5 years ago|reply
That is certainly impressive. But why does emacs have that functionality?
[+] patrec|5 years ago|reply
Who in his right mind would use an editor that cannot even do symbolic integration?

Joking aside, I suspect that this is mostly due to two factors:

1. Emacs was used by a lot of smart people, and one of them, David Gillespie got carried away a bit.

2. Thirty years ago, when David Gillespie first started working on calc, emacs lisp (despite at the time lacking even floating points numbers IIRC!), was probably one of the most expressive fairly widely deployed languages around, particularly for the type of symbolic manipulation you need to do for computer algebra. And unlike other things that were used by smart people 30 years ago, emacs still sticks around, so survivorship bias also plays a role.

[+] TeMPOraL|5 years ago|reply
It's a bit like asking why Windows has a calculator :).

Emacs is best viewed a Lisp execution platform with a built-in text UI. Much like it has a "c++ app", "terminal app" and "compile this" app, it also ships with a "calc app" (literally called "calc"). Since it was being used by lot of mathy people for lot of mathy stuff, it ended up being a proper scientific calculator application.

(Also, Lisps are inherently friendly for doing any kind of symbolic calculations. A Lisp system is one of the least surprising places to find a symbolic integrator in.)

[+] ssivark|5 years ago|reply
Emacs is best understood not just as an editor, but as an integrated computing environment promoting user freedoms to the fullest extent possible in a manner naturally integrated with its user interface and extensibility. In that sense, it shouldn’t be the least bit surprising to see the kind of in-built application suite one would expect from an operating system or desktop environment. One must also remember that historically the most common computer (power) users were academics, and not “software developers” — so expect a lot of scratches for their itches.

It’s a bit like asking why does bash come with a utility like awk or bc; it’s equally natural.

[+] avar|5 years ago|reply
Have you tried asking your local psychotherapist?

    M-x doctor RET

    I am the psychotherapist.  Please, describe your problems.  Each time
    you are finished talking, type RET twice.

    Why does Emacs need Symbolic Integration?

    What do you think?

    I don't know, just answer the question!

    Why do you say you do not know just answer the question?

    [...]
Maybe you'll have better luck than I did with mine.
[+] ojnabieoot|5 years ago|reply
In general - developers use calculators all the time (most frequently via Google these days, but also via REPLs) so a dedicated calculator is a self-evidently useful widget for any editor. It’s is not essential fir a new editor in 2021 but considering emacs has had Calc for some time, it is worthwhile to make improvements to widely-used legacy software. Many emacs users have used Calc in lieu of alternative “developer calculators” like Octave, the R REPL, etc, so it’s not like Calc is an extraneous feature.

It’s uncommon for developers to deal with integral equations in their day-to-day work. But it’s obviously not unheard of - integral equations show up naturally in many domains of finance and engineering. I’ve had to deal with numeric integration on .NET in one of my jobs. Sometimes an exact symbolic solution is easier for the developer and the CPU than a numeric technique, so for a small handful of developers a symbolic integral calculator is a handy (if somewhat specialized) tool, and not just some bell-and-whistle.

[+] mschaef|5 years ago|reply
> But why does emacs have that functionality?

GNU Emacs is a 36 year old tool that's been targeted at programmers its entire life, is built on an interactive Lisp environment, and actively encourages external improvements and contributions. The more interesting question is why _wouldn't_ it have that functionality.

[+] worik|5 years ago|reply
I often find it useful t do a calculation while I am editing. For example when I write a invoice I have to calculate taxes.

I have not had to use the more advanced features. I did not know that they were there. Now I know, perhaps I do need them?

[+] melling|5 years ago|reply
Emacs is a big Lisp interpreter.

Elisp is the most popular Lisp in the world.

Why wouldn’t you want to improve it?

[+] legends2k|5 years ago|reply
Because enough of its users use it?

I'm a graphics programmer and I use Emacs' in-built RPN calc for its linear algebra capabilities almost daily.

[+] a-nikolaev|5 years ago|reply
A healthier approach is to have a separate non-Emacs app that can do symbolic integration, which can be run seamlessly from within Emacs.

Otherwise, with all its extensions Emacs starts giving the impression of an Apple-like walled garden, which is not a good comparison for a free software, no?