From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
<= br>On Ju= l 2, 2017, at 11:46, Philipp Stephani <p.stephani2@gmail.com> wrote:Ken Raeburn <raeburn@raeburn.org> schrieb am Mo., 29. Mai 2017 um 11= :33=C2=A0Uhr: On May 28, 2017, at 08:43, Philipp Stephani <p.stephani2@gmail.com= a>> wrote:Ken Raeburn <<= a href=3D"mailto:raeburn@raeburn.org" target=3D"_blank">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 in= formation, etc.=C2=A0 While it has a certain appeal (making C modules and L= isp files look much more similar, maybe being able to link Lisp and C toget= her into one executable image, letting GDB understand some of your data), s= witching to a machine-specific format would be a pretty drastic change, whe= n we can currently share the files across machines.
>
> Althoug= h it does indeed sound like a big change, I don't see why it would prev= ent us from sharing the files across machines. Emacs can use standard ELF a= nd DWARF format on any platform if Emacs is doing the loading. And there sh= ould be some software-engineering benefit in using the same format that Gui= le uses.
Sorry for the delay in responding.
The ELF format ha= s header fields indicating the word size, endianness, machine 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 ty= pes, interpretation of certain ranges of values in some fields) are archite= cture- or OS-dependent; we might not care about many of those details, but = relocations are likely needed if we want to play linking games or use DWARF= .
I think Guile is using whatever the native word size and architect= ure are.=C2=A0 If we do that for Emacs, they=E2=80=99re not portable betwee= n platforms.=C2=A0 Currently it works for me to put my Lisp files, both sou= rce and compiled, into ~/elisp and use them from different kinds of machine= s if my home directory is NFS-mounted.
We could instead pick fixed v= alues (say, architecture =E2=80=9Cnone=E2=80=9D, little-endian, 32-bit), bu= t 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 that we=E2=80=99d ever be able to= use non-GNU tools to treat them as object files.=C2=A0 Then again, we coul= dn=E2=80=99t expect to do the latter portably anyway, since some of the pla= tforms 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 interesting idea.=C2=A0 If one of the popular serializ= ation libraries is compatibly licensed, easy to use, and performs well, it<= /span>=C2=A0may be better than rollin= g our own. I've trie= d this out (with flatbuffers), but I haven't seen significant speed imp= rovements. 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), a= nd it's the evaluator that's too slow.