public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Marc Nieper-Wißkirchen" <marc@nieper-wisskirchen.de>
To: Basile Starynkevitch <basile@starynkevitch.net>
Cc: jit@gcc.gnu.org
Subject: Re: Incremental compilation
Date: Mon, 01 Jan 2018 00:00:00 -0000	[thread overview]
Message-ID: <CAEYrNrQdop-FBH6F4RkzCjt9v0YRXx6jxSwqeE--BgGUadoMxw@mail.gmail.com> (raw)
In-Reply-To: <b37b12ce-cf4a-3687-15b3-e8c418d0e6ca@starynkevitch.net>

Am So., 30. Dez. 2018 um 13:28 Uhr schrieb Basile Starynkevitch
<basile@starynkevitch.net>:
>
>
> 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?

At the moment, most parts of the project is just in my head. I have
written some code to be able to do some experiments but nothing is
finished yet. As soon as I have something presentable, I'd love to
share it with you. It will be GPL'd code.

The goal of the project is to have a reasonably fast Scheme
implementation that I can use for experiments with language extension.

> 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.

The reason why I would like to have a single shared object is for the
convenience of the user. The compiler should produce a single shared
object from a Scheme library definition which can then later be
visited/invoked in lieu of loading the Scheme source code of the
library.

> 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?

There will be two sources of (longer lived) compiled code: Libraries
that have been loaded and functions generated by `eval'. The former
will never be garbage collected. The latter will. `Eval' would
(internally) return closures created that should be disposable by
calling 'gcc_jit_result_release`.

> 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.

I really should write up my concept. It isn't going to be finished
this year, however.

Best,

Marc

>
>
> Cheers
>
> --
> Basile STARYNKEVITCH   == http://starynkevitch.net/Basile
> opinions are mine only - les opinions sont seulement miennes
> Bourg La Reine, France
>


-- 
Prof. Dr. Marc Nieper-Wißkirchen

Universität Augsburg
Institut für Mathematik
Universitätsstraße 14
86159 Augsburg

Tel: 0821/598-2146
Fax: 0821/598-2090

E-Mail: marc.nieper-wisskirchen@math.uni-augsburg.de
Web: www.math.uni-augsburg.de/alg/mitarbeiter/mnieper/

  reply	other threads:[~2018-12-30 15:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01  0:00 Marc Nieper-Wißkirchen
2018-01-01  0:00 ` Basile Starynkevitch
2018-01-01  0:00   ` Marc Nieper-Wißkirchen
2018-01-01  0:00     ` Basile Starynkevitch
2018-01-01  0:00       ` Marc Nieper-Wißkirchen [this message]
2018-01-01  0:00         ` Basile Starynkevitch
2019-01-01  0:00           ` Marc Nieper-Wißkirchen
2018-01-01  0:00     ` Basile Starynkevitch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEYrNrQdop-FBH6F4RkzCjt9v0YRXx6jxSwqeE--BgGUadoMxw@mail.gmail.com \
    --to=marc@nieper-wisskirchen.de \
    --cc=basile@starynkevitch.net \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).