From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
On Ma= y 28, 2017, at 08:43, Philipp Stephani <p.stephani2@gmail.com> wrote:Ken Raeburn <raeburn@raeburn.org> schrieb am So., 28. Mai 2017 um 13:= 07=C2=A0Uhr:
On May 21, 2017, at 04:53, Paul Eggert <eggert@cs.ucla.edu> wrote:
> Ken Raeburn wrote:
>> The Guile project has taken this idea pretty far; they=E2=80=99re = generating ELF object files with a few special sections for Guile objects, = using the standard DWARF sections for debug information, etc.=C2=A0 While i= t has a certain appeal (making C modules and Lisp files look much more simi= lar, maybe being able to link Lisp and C together into one executable image= , letting GDB understand some of your data), switching to a machine-specifi= c format would be a pretty drastic change, when we can currently share the = files across machines.
>
> Although it does indeed sound like a big change, I don't see why i= t would prevent us from sharing the files across machines. Emacs can use st= andard ELF and DWARF format on any platform if Emacs is doing the loading. = And there should be some software-engineering benefit in using the same for= mat that Guile uses.
Sorry for the delay in responding.
The ELF format has header fields indicating the word size, endianness, mach= ine architecture (though there=E2=80=99s a value for =E2=80=9Cnone=E2=80=9D= ), and OS ABI.=C2=A0 Some fields vary in size or order depending on whether= the 32-bit or 64-bit format is in use.=C2=A0 Some other format details (e.= g., relocation types, interpretation of certain ranges of values in some fi= elds) are architecture- or OS-dependent; we might not care about many of th= ose details, but relocations are likely needed if we want to play linking g= ames or use DWARF.
I think Guile is using whatever the native word size and architecture are.= =C2=A0 If we do that for Emacs, they=E2=80=99re not portable between platfo= rms.=C2=A0 Currently it works for me to put my Lisp files, both source and = compiled, into ~/elisp and use them from different kinds of machines if my = home directory is NFS-mounted.
We could instead pick fixed values (say, architecture =E2=80=9Cnone=E2=80= =9D, little-endian, 32-bit), but then there=E2=80=99s no guarantee that we = could use any of the usual GNU tools on them without a bunch of work, or th= at we=E2=80=99d ever be able to use non-GNU tools to treat them as object f= iles.=C2=A0 Then again, we couldn=E2=80=99t expect to do the latter portabl= y anyway, since some of the platforms don=E2=80=99t even use ELF.
Is there any significant advantage of = using ELF, or could this just use one of the standard binary serialization = formats (protobuf, flatbuffer, ...)?=C2=A0That=E2=80=99s an int= eresting idea.=C2=A0 If one of the popular serialization libraries is compa= tibly licensed, easy to use, and performs well, it=C2=A0may be better than rolling our own.<= /div>I've tried this out (with flatbuf= fers), but I haven't seen significant speed improvements. It might very= well be the case that during loading the reader is already fast enough (e.= g. for ELC files it doesn't do any decoding), and it's the evaluato= r that's too slow.=C2=A0