From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44183 invoked by alias); 30 Dec 2018 12:28:43 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 43607 invoked by uid 89); 30 Dec 2018 12:28:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=wasting, hundred, yours, france X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: relay7-d.mail.gandi.net Received: from relay7-d.mail.gandi.net (HELO relay7-d.mail.gandi.net) (217.70.183.200) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 30 Dec 2018 12:28:41 +0000 X-Originating-IP: 193.248.54.187 Received: from [192.168.1.2] (lstlambert-656-1-266-187.w193-248.abo.wanadoo.fr [193.248.54.187]) (Authenticated sender: basile@starynkevitch.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 8BAC220003; Sun, 30 Dec 2018 12:28:38 +0000 (UTC) Subject: Re: Incremental compilation To: =?UTF-8?Q?Marc_Nieper-Wi=c3=9fkirchen?= Cc: jit@gcc.gnu.org References: <1bc5aeb1-d251-0335-6103-eba3f6258456@starynkevitch.net> From: Basile Starynkevitch Message-ID: Date: Mon, 01 Jan 2018 00:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-IsSubscribed: yes X-SW-Source: 2018-q4/txt/msg00010.txt.bz2 On 12/30/18 12:54 PM, Marc Nieper-Wißkirchen wrote: > My use case is compiling a Scheme library. It contains macro > definitions whose transformation procedures have to be compiled at > first to expand subsequent parts of the library body. Furthermore, the > compiled transformation procedures of global macro defintions have to > appear in the final dynamic library as well. I am quite interested in your work, since I did (in the past) GCC MELT http://starynkevitch.net/Basile/gcc-melt/ (which now is a dead project; it was a Lisp dialect compiled to C or C++ for GCC extensions); I am working on http://github.com/bstarynk/bismon right now, and you might be interested in reading http://starynkevitch.net/Basile/bismon-chariot-doc.pdf Is your project some open-source stuff? Could you give us the URL of its source code? In MELT, I also had macros similar to yours. So I believe I understand your work quite well (since it is similar to what I did in GCC MELT, which was a Lisp -but not Scheme- dialect with macros). In practice, you still can compile every function in a separate *.so plugin. You could group several (unrelated) functions together by JIT compiling them at once, but that is an optimization. You could, once all macros have been compiled, regenerate a single "shared object" for all your library, but that is an optimization. The main reason to do so would be to avoid wasting virtual address space by having many thousands of shared objects. I am not sure it is worthwhile. Since you are implementing a Scheme, all your functions are in fact used in closures (which contains a function pointer). So updating all the required closures (to put there a function pointer to a newer code) might be quite easy in practice. The potential issue is to "garbage collect" useless code. In your case, that would mean doing dlclose in your GC. Do you want to do that? Since you can in practice have many hundred thousands of useless generated plugins, you might decide to never call dlclose (and accept the "code segment leak" that follows). Again, I really am interested by your work. If you have any additional references (draft reports, source code, etc...) please share them with us if possible. Cheers -- Basile STARYNKEVITCH == http://starynkevitch.net/Basile opinions are mine only - les opinions sont seulement miennes Bourg La Reine, France