<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On 2010-03-31, at 20:00 , Juan Jose Garcia-Ripoll wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Mar 31, 2010 at 4:39 PM, james anderson <span dir="ltr"><<a href="mailto:james.anderson@setf.de">james.anderson@setf.de</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div style="word-wrap: break-word;">i simply don't understand your requirements. on one hand both with and without asdf, but then it is objected, that a mechanism which requires asdf does not work without it. please explain.</div> </blockquote><div><br>What I do not understand is what YOU do not understand.<br><br></div></div>In an standalone system there is no ASDF. That is all.<br><br>I want to be able to take an ASDF system describing my program and its dependencies on other libraries and compile it and produce a standalone executable. That program will not have ASDF inside, it will not have the notion of a central registry it will have nothing, but it still has to work.<br></blockquote><div><br></div>it's going to need to take it's logical host definitions from somewhere.</div><div><br></div><div>either they survived, in which case, in the simplest form they are re-rooted, or in more complex forms distinct branches are mapped distinctly, or they didn't survive, and the program will either apply heuristics to locate the intended files, or will benefit from external information to accomplish that task. to these ends, it will use at least the cl operators for logical pathnames. in the case of the examples which i posted, it might in addition use the same operators from the cited library which were used to establish the host definitions in the first place.</div><div><br></div><div>asdf did not appear in that paragraph.</div><div><br><blockquote type="cite"> <br>Please understand that the program I am talking about is not a dumped lisp image that contains everything needed to build the system and even some extra stuff that was there (database of ASDF systems and other trash). The programs I produce are just a set of compiled files, one per ASDF system, linked together with a core library that is the Common Lisp environment ECL offers.<br></blockquote><div><br></div>that's ok. </div><div><br><blockquote type="cite"> <br>When the program starts, the linked files are "loaded" one after another, as if LOAD was used but actually much faster. But I insist again ASDF is not part of the things that is loaded simply because there is no need.<br></blockquote><div><br></div>that's ok.</div><div><br><blockquote type="cite"> <br>The only thing that one might need ASDF for is to locate the data associated to the program, but if we provide logical pathname translations (one host per library), then a small piece of code can be inserted at the beginning of the program which locates the data and sets up the appropriate translations.<br></blockquote><div><br></div>as noted above.</div><div><br><blockquote type="cite"> <br> <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div>if the requirement is that exact same exact formulation be used with and without asdf, then</div><div>a) the additional system initialization argument is excluded</div><div>b) the second option in my earlier message provides this path.<br></div></div></blockquote><div> </div>I only find "b" acceptable because I still do not understand how "a" is going to work without a central registry and a lot of complicated logic that has to propagate to those distributed binaries.<br></blockquote><div><br></div>asdf uses a central registry. that is a given. that is how it finds the system definitions. i reported that it is possible for asdf to use the registry list to infer the logical host which should apply to a given system definitions. without any additional specification in the system declaration. that asdf does that has no necessary bearing on what a release process or the released program does with logical pathnames. it just makes it possible for the build process to share information with the later processes.</div><div><br><blockquote type="cite"> <br>Having "b", which I recall was one logical host name per system, one may simply prepend to the compiled set of files a tiny bit of lisp that looks as follows<br><br>(defvar *program-data-location*<br>#+windows ;; Data and binaries live together<br> (program-location)<br>#+unix ;; Data is installed somewhere standard<br>"/usr/share/program/"<br>#+osx ;; Assume this is an application bundle<br>(merge-pathnames "Content/Resources/" (program-location)))<br> <br>(defun set-host-translation (root extra)<br>  ...)<br><br>(set-host-translation "cl-ppcre" "cl-ppcre/")<br>(set-host-translation "cl-unicode" cl-unicode/")<br></blockquote><div><br></div>this is what the code in the examples i cited does. not in exactly these terms, but the pathname world is not large.</div><div>the only difference between the two approaches which i described is whether asdf uses the operators or they are used otherwise, in addition to the defsystem form.</div><div><br><blockquote type="cite"><br>With this simple, automatically generated code I can pack the given systems and let them work anywhere, even though ASDF is not present.<br> <br>The same or a similar procedure can be used to link many systems into a single distributable binary fasl + resources, install it in a standard location that can be found by certain lisps and prepend a simple logic for finding out its data... Without using ASDF in the file itself.<br> <br>There is even a third model in which installation paths are known beforehand. Say that a package maintainer from Debian has the role of generating binaries for 10 libraries out there and they have complex inter-dependencies. Libraries can be compiled in the machine of the maintainer and then installed by ASDF in their standard locations. ASDF can, in the process, hard-code the pathname translations when installing the files.<br> <br>For instance, if we produce binaries for cl-ppcre-1.0.1 and cl-unicode-2.0.1 and the latter depends on the former, and we know that they are going to live in<br>/usr/lib/common-lisp/cl-ppcre-1.0.1<br>/usr/lib/common-lisp/cl-unicode-2.0.1<br> when "asdf-build" compiles the files and "asdf-installs" them we may get<br><br>;; Stripped down version of a system definition<br>;; which only contains the precompiled files<br>;; and which can be searched and used by ASDF<br> /usr/lib/common-lisp/cl-ppcre-1.0.1/cl-ppcre.asd<br> /usr/lib/common-lisp/cl-unicode-1.0.1/cl-unicode.asd<br><br>;; The binaries themselves<br>/usr/lib/common-lisp/cl-ppcre-1.0.1/cl-ppcre-1.0.1.fas<br> /usr/lib/common-lisp/cl-ppcre-1.0.1/cl-unicode-1.0.1.fas<br><br>;; Proxy binaries that can be loaded using "require"<br>;; even if ASDF is not present. These files define the logical<br>;; pathname translations based on hardcoded locations.<br> /user/lib/common-lisp/cl-ppcre-1.0.1/cl-ppcre.fas<br> /user/lib/common-lisp/cl-ppcre-1.0.1/cl-unicode.fas<br><br>;; Data used by the library<br> /user/lib/common-lisp/cl-ppcre-1.0.1/cl-unicode.dat<br><br>;; Symbolic link to the last version<br>/usr/lib/common-lisp/cl-ppcre -> cl-ppcre-1.0.1<br><br>The FASL without version numbers files can explicitly load the required versions of the libraries because they know the hardcoded paths of their files. In doing so they can also set up the appropriate pathname translations that are used by the other files.<br> <br>I have listed just two examples with different paradigms on how to build and distribute software, and which go beyond current use in which the user has to set up a collection of registries, in your case you even define pathname translations and have magic to make ASDF understand them, sources are always present, things are recompiled...<br></blockquote><div><br></div>the first two clauses are true, although the characterization is unwarranted. the third and fourth are not.</div><div><br></div></body></html>