News for hackers. Stuff that matters.
Re:Emacs Symbolic Integration by choeger on Wednesday January 06, 2021 @04:57AM (#25656217)
That is certainly impressive. But why does emacs have that functionality?
Re:Emacs Symbolic Integration by patrec on Wednesday January 06, 2021 @05:05AM (#25656264)
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.

Re:Emacs Symbolic Integration by TeMPOraL on Wednesday January 06, 2021 @05:18AM (#25656340)
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.)

Re:Emacs Symbolic Integration by JadeNB on Wednesday January 06, 2021 @09:03AM (#25657793)
> Emacs is best viewed a Lisp execution platform with a built-in text UI.

Hence the old joke "Emacs is a fine OS, but its text editor sucks."

Re:Emacs Symbolic Integration by ssivark on Wednesday January 06, 2021 @05:59AM (#25656557)
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.

Re:Emacs Symbolic Integration by pjmlp on Wednesday January 06, 2021 @07:21AM (#25657055)
Because awk and bc are UNIX programs that precede bash and are part of any POSIX certified UNIX, whereas bash is not.

https://pubs.opengroup.org/onlinepubs/9699919799/

Re:Emacs Symbolic Integration by avar on Wednesday January 06, 2021 @05:29AM (#25656402)
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.
Re:Emacs Symbolic Integration by sillysaurusx on Wednesday January 06, 2021 @05:37AM (#25656439)
Oh my gosh, someone please add an M-x gpt-doctor. Hmm.. I wonder how we'd build the training dataset...

How many other meme modes exist? I dug up the earliest commits I could find, and apparently one of the earliest hooks was "protect-innocence-hook": https://twitter.com/theshawwn/status/1327459335245422597

If the buffer's filename is "sex.6", it asks whether the user is over 18. If so, it renames the buffer to "celibacy.1".

Apparently it was in the file lisp/play/meese.el. Emacs archaeology is more fun than it should be.

Re:Emacs Symbolic Integration by fjcp on Wednesday January 06, 2021 @08:35AM (#25657569)
>How many other meme modes exist?

Here is the manual section listing all the "Games and Amusements" that ship with Emacs by default:

https://www.gnu.org/software/emacs/manual/html_node/emacs/Am...

Re:Emacs Symbolic Integration by TeMPOraL on Wednesday January 06, 2021 @05:46AM (#25656489)
There's M-x zone, a bunch of games - anything from Tetris and Bubbles to Zork, morse code handling (M-x morse-region, unmorse-region), inserting interesting phrases for NSA spooks... There's a lot.

There's also nyan-mode, made by yours truly, but unfortunately it does not ship with Emacs by default :).

Re:Emacs Symbolic Integration by sillysaurusx on Wednesday January 06, 2021 @06:06AM (#25656611)
Who do we have to lobby to get nyan-mode into emacs mainline? Happy to send a recommendation email.

Was surprised how high quality the repo is, too!

https://github.com/TeMPOraL/nyan-mode

It even has an accompanying blog post, which I found informative. http://jacek.zlydach.pl/blog/2011-08-25-introducing-nyan-mod...

And even a Show HN. https://news.ycombinator.com/item?id=2906632

Re:Emacs Symbolic Integration by TeMPOraL on Wednesday January 06, 2021 @07:59AM (#25657308)
Thank you for your kind words. I wouldn't call it high-quality, though. I wrote this back when I barely knew how to wield Lisp or use Emacs. I've gained much more experience in both since then; I keep promising myself that one of these days, I'll clean it up and make it a stellar little mode...

As for getting it into mainline, I'd be OK with going through the FSF copyright paperwork, but I worry this will probably fail over the uncertain status of Nyan Cat image/music IP...

Re:Emacs Symbolic Integration by boogies on Wednesday January 06, 2021 @02:24PM (#25661178)
> I worry this will probably fail over the uncertain status of Nyan Cat image/music IP...

That’s how MooGNU was born: https://archive.org/details/M00GNU

Re:Emacs Symbolic Integration by MaDeuce on Wednesday January 06, 2021 @01:02PM (#25660347)
One of my favorites is "Zippy the pinhead" quotes (M-x yow). I believe this has been removed due to copyright issues, but it is still available if you look. Zippy's quotes could be sent to the doctor via M-x psychoanalyze-pinhead.
Re:Emacs Symbolic Integration by sn41 on Wednesday January 06, 2021 @08:54AM (#25657719)
I think the Emacs doctor drilled down my insecurities down to a bad exam in school. (S)he ? claimed that his/her secretary will send me the bill, but I haven't been back so they must have forgotten.
Re:Emacs Symbolic Integration by TeMPOraL on Wednesday January 06, 2021 @09:15AM (#25657906)
If you feel that the services rendered were useful to you, consider sending a donation to FSF :).
Re:Emacs Symbolic Integration by TeMPOraL on Wednesday January 06, 2021 @05:37AM (#25656438)
Can't wait for someone to do a M-x doctor over GPT-3, AiDungeon style.
Re:Emacs Symbolic Integration by vifon on Wednesday January 06, 2021 @06:08AM (#25656629)
The manual actually answers this very question: https://www.gnu.org/software/emacs/manual/html_node/calc/His...
Re:Emacs Symbolic Integration by TeMPOraL on Wednesday January 06, 2021 @09:20AM (#25657942)
Thanks for posting this. Not only it's an amazing story of scope creep, it also revealed a bunch of features I didn't know calc had (e.g. unit handling, arbitrary-size math).
Re:Emacs Symbolic Integration by funkaster on Wednesday January 06, 2021 @11:45AM (#25659361)
thanks for the reference! love the final acknowledgement in there:

> Final thanks go to Richard Stallman, without whose fine implementations of the Emacs editor, language, and environment, Calc would have been finished in two weeks.

:D

Re:Emacs Symbolic Integration by ojnabieoot on Wednesday January 06, 2021 @01:21PM (#25660531)
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.

Re:Emacs Symbolic Integration by mschaef on Wednesday January 06, 2021 @09:12AM (#25657882)
> 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.

Re:Emacs Symbolic Integration by monsieurbanana on Wednesday January 06, 2021 @05:06AM (#25656267)
Because it can... don't underestimate the amount of unrelated things you can crame into a 40 year old software.

Interestingly, nowadays it's really difficult to convince people to add new features, like enabling mouse scrolling by default [1].

[1] https://lwn.net/ml/emacs-devel/20200906133719.cu6yaldvenxubc...

Re:Emacs Symbolic Integration by linspace on Wednesday January 06, 2021 @06:54AM (#25656893)
I don't think it's a valid example. The discussion is about the default configuration, not about removing mouse scrolling from the code. It's a really big thread nevertheless...
Re:Emacs Symbolic Integration by worik on Wednesday January 06, 2021 @08:41AM (#25657602)
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?

Re:Emacs Symbolic Integration by melling on Wednesday January 06, 2021 @08:46AM (#25657636)
Emacs is a big Lisp interpreter.

Elisp is the most popular Lisp in the world.

Why wouldn’t you want to improve it?

Re:Emacs Symbolic Integration by legends2k on Thursday January 07, 2021 @11:21AM (#25672930)
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.

Re:Emacs Symbolic Integration by a-nikolaev on Wednesday January 06, 2021 @11:40AM (#25659310)
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?

Re:Emacs Symbolic Integration by thotsBgone on Wednesday January 06, 2021 @02:34PM (#25661283)
How is it a walled garden if it's free, open-source software?
Re:Emacs Symbolic Integration by a-nikolaev on Wednesday January 06, 2021 @09:34PM (#25666592)
Emacs is its own ecosystem, you either buy it all, and grow to use it more and more, or don't get to use it all. So in a way it separates itself from the rest of Unix ecosystem.
Re:Emacs Symbolic Integration by thotsBgone on Thursday January 07, 2021 @02:41PM (#25676172)
Only because much of what emacs does is cumbersome or impossible as regular software.
Re:Emacs Symbolic Integration by a-nikolaev on Thursday January 07, 2021 @04:10PM (#25677516)
a lock-in is a lock-in, even if with free software, it incurs certain costs on you, even if it provides convenience.