News for hackers. Stuff that matters.
Re:The Emacs dumper dispute by btilly on Wednesday November 30, 2016 @02:43PM (#13073956)
It is an idea that should not work and it is only happenstance that it ever worked

In the 1980s it was a surprisingly common approach. For example most Unix variants had an undump command to turn a core dump into an executable. See https://www.ctan.org/tex-archive/obsolete/support/undump for example. It was also how Microsoft Office file formats were implemented until about a decade ago.

With the hindsight of experience, it is easy to say that it is a bad way to go and won't age well. But back when Emacs went this way, the problems were not as widely understood as they are now.

Re:The Emacs dumper dispute by jlv2 on Wednesday November 30, 2016 @03:59PM (#13074639)
IIRC, "most UNIX variants" didn't have an undump command. It primarily came with a few huge applications that played these type of games. The two worst offenders that I remember were in fact GNU Emacs and TeX! A few other programs that I dealt with (porting to a new platform) which depended upon a similar hack were Sendmail and Franz Lisp.

The Sendmail "WIZ" SMTP bug was in fact caused by it's use of reloading the frozen configuration file (the pointer to the password was saved in the data section, not the BSS region that was reloaded from the frozen config, so that if you used a frozen config you effectively had an empty password).

Re:The Emacs dumper dispute by btilly on Wednesday November 30, 2016 @05:38PM (#13075361)
My impression comes from the comments in the undump link that I provided.

To your list of other programs you can add Perl. It comes with a dump command to take a core dump that can be turned into an executable. I never used it as anything other than a joke, but I do know several people who independently used that feature in production back in the 1990s.

Re:The Emacs dumper dispute by rurban on Wednesday November 30, 2016 @05:21PM (#13075261)
Looks like a very simple objcopy from binutils.

Maybe we just need to add an objcopy format for reading the bfdname "core" to --input-target. Sounds trivial.

In fact happened in 2001 already: https://sourceware.org/ml/binutils/2001-12/msg00360.html

Not a bad way at all, very convenient. Just ASLR might be tricky.

Re:The Emacs dumper dispute by sooheon on Wednesday November 30, 2016 @02:52PM (#13074084)
Now that we do have the hindsight of experience, and it is time to make that decision again, why are the maintainers going with the clearly smellier approach?
Re:The Emacs dumper dispute by MBCook on Wednesday November 30, 2016 @03:01PM (#13074185)
They have an immediate problem (things are slow/broken on newer glibc) that needs fixing.

Someone has posted sane code to fix the issue in a similar fashion to what they were doing before but without needing to reach into the memory manager.

The maintainer who is mad wants it fixed right (replace the whole thing and make the elisp load fast) but so far neither they nor anyone else seems to have posted code to do that.

Bird in the hand. I would hope they'd just remove the need for the mechanism totally in the future, but for now.... bird in the hand.

Re:The Emacs dumper dispute by btilly on Wednesday November 30, 2016 @03:17PM (#13074314)
What would fixing it right look like?

Make elisp faster. Easier said than done. Any easy wins already happened.

Introduce various lazy loading mechanisms and switch to that by default. That doesn't help any third party plugins that people might use. In fact any such work could create ways of breaking the expectations of said plugins!

Identify/eliminate work spent on dead code paths in initial load. Again, easier said than done. And there are bound to be a lot of, "I don't see what that is useful for, but what third party plugins might need it?"

In the meantime, end users faced with the choice of a slow new release versus a fast old one, will resist upgrading. And if there is a patch that simply makes things fast, that is generally acceptable.

The current moment provides pressure to do things right. If the cheap fix is taken, there are no guarantees on when there will be another opportunity like this one. But pressures exist to take the easy out right now. And if taken, it won't be easier next time either.

Re:The Emacs dumper dispute by chris_wot on Thursday December 01, 2016 @06:11AM (#13078645)
I'm amazed that Chrome and Firefox load instantly and they regularly interpret scads of DOM input and complex JavaScript code.

Exactly why can't emacs do this again?

Re:The Emacs dumper dispute by db48x on Thursday December 01, 2016 @08:23AM (#13079166)
The first time you start Firefox, it reads in a whole mess of xul, html, css, and javascript. It parses it all and then dumps it to a binary file that can just be mmap'd back in next time. This is exactly like emacs, except that emacs also dumps out all of its own internal state including the state of the allocator; that makes it more fragile.
Re:The Emacs dumper dispute by jeremiep on Wednesday November 30, 2016 @03:01PM (#13074184)
Because even with experience you don't refactor a 40+ years old piece of software easily without breaking half the ecosystem.

I'm sure there's a whole world of tradeoffs we're not seeing that the maintainers have to deal with.

Re:The Emacs dumper dispute by armitron on Wednesday November 30, 2016 @09:35PM (#13076721)
It's not smellier, it's actually a great feature.

Dumping your own images will be extremely useful to many Emacs users.