From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.user Subject: AOT compiler (was: Running Compiled Guile Objects) Date: Sun, 15 Dec 2024 02:21:32 +0900 Message-ID: References: <769073d434c2ed5fb7937c85da240aa5df4d854a.camel@starynkevitch.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12302"; mail-complaints-to="usenet@ciao.gmane.io" Cc: basile@starynkevitch.net To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Dec 14 18:22:22 2024 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMVqQ-00032N-5O for guile-user@m.gmane-mx.org; Sat, 14 Dec 2024 18:22:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMVpw-0007AH-Lm; Sat, 14 Dec 2024 12:21:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMVpr-00074Z-CT for guile-user@gnu.org; Sat, 14 Dec 2024 12:21:48 -0500 Original-Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMVpp-0002ae-HU for guile-user@gnu.org; Sat, 14 Dec 2024 12:21:47 -0500 Original-Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ee67e9287fso2459611a91.0 for ; Sat, 14 Dec 2024 09:21:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734196903; x=1734801703; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9nJPNagvqUoKgRcaaEOKyfqCJuWmh7YpcItUL1U8ZQg=; b=CqVYl8meaMmYsHnyc8tL6wbUeVimemzqDDiwIB90WPQjNLSfLdgOl72TEjp3WL3vta /ocCHXcjj8tYGeujwxTHRtgNkdU75izL9zpwmxkSK3hCkV5ygQWCHA50fQQqIHJHFn+V HwAN8YP+awClfm2lhxMk0EZqTQEh9sLmAEIk6AoC+ddU/RB3x3jqfPYAudUrLm4JCgu/ 7CECTInOeblRvPhn24vHDjUPWFGA25YpZEecRnItGZ9Awybq7NolGMkk3sZXY13ys2rQ Lxt7qgPFA6KCWDf5Bg8sX/0yzJwlnxiRapx0MexHFGG759BN5SY7s3LcFv7hxIHoXSzI RvgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734196903; x=1734801703; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9nJPNagvqUoKgRcaaEOKyfqCJuWmh7YpcItUL1U8ZQg=; b=SzchuFMbBqGUzeI6oWZGEJD7uunHesX+3OW3U/zrEjSk1NsjudS+qk1hEzlyfSa29Y cKjanl+EziUnMkXa71TSBla6GF32hU7PAMl0xuhAcW6O3OOq3CJoZDEgvNPiLhyLO86a sNDryo7xSwkfoFvNNFaZltBSQQGMbC2xQeWHkwkZ425a7VnJBGOtJPirVb+8rbTJCK9k C3fhej3YK9CzYzMELPXdfiaQnKhiw16oqWSVI3yhKmlOA2mvxQptXjEOrQMqIPrJ5QNR r24PsGSjijAPYY1x+F+EgCmB6T9xSwHm/1I75lOcZ+9snei/U3KRAwupjqADOPqp30uw 8/7w== X-Gm-Message-State: AOJu0YwT9AVSGg1d4fdpFe5rHcEmCeOwJjnxaUvPs+uBMAuzHwTCwYDS EEHohTN+8u9csc1GyrWq91EpR0FgpgeftGou58oIYQhVxdVeVnGHBj/hVXTfw6nQW5A9vbCF1dR JHoMg8Pc5zw0rPd/piJvi0vdt+QKi2w== X-Gm-Gg: ASbGnctHIwmunZZ+kqRUwhPTpGRRGUKORWWm8o34TQoWWzKoU5QaZjQIppmTD5FXHgy sKH1lgK95V9sAu2SaAd/x+fjs0u03NK0qJwhXow== X-Google-Smtp-Source: AGHT+IGKrIny19gztnLpszy0zFOQmqNZrvg38V/alNPdjBGMn+6igF1y2oYtVnqT8517aWZis12A5Dgrl+Nur6CGFUw= X-Received: by 2002:a17:90b:4a4f:b0:2ee:9902:18b4 with SMTP id 98e67ed59e1d1-2f2900a9878mr10296239a91.27.1734196903074; Sat, 14 Dec 2024 09:21:43 -0800 (PST) In-Reply-To: <769073d434c2ed5fb7937c85da240aa5df4d854a.camel@starynkevitch.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=nalaginrut@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19993 Archived-At: @basile I'm glad you raise this topic, I've played lobgccjit with a toy project. https://gitlab.com/hardenedlinux/screaming-fist I would say libgccjit is a wrong name since it's more like a tool for AOT. Of course, one may still use it for JIT, however you have to do your own work for JIT and finally use libgccjit for codegen. =F0=9F=98=81 Best regards. ---------- Forwarded message --------- From: Basile Starynkevitch Date: Sun, Dec 15, 2024, 02:11 Subject: Re: Running Compiled Guile Objects To: Nala Ginrut , Hakan Candar < hakancandar@protonmail.com> Cc: guile-user@gnu.org , On Sat, 2024-12-14 at 09:15 +0900, Nala Ginrut wrote: > Hi Hakan! > The current Guile is not AOT yet. Although the object file is ELF, > it's > just bytecode wrapped ELF header. So you can't run it as a regular > executable file. > Those willing to contribute a proper ahead-of-time compiler to GNU guile could use the GNU CC libgccjit library which is part of the GCC compiler. https://gcc.gnu.org/onlinedocs/jit/ This libgccjit layer of the GCC compiler is stable and maintained C API and has some obsolete C++ API (which seems unmaintained in december 2024). Most of the libgccjit code is internally coded (under GPL license) in C++, but the stable API is for C. I am using the C API of libgccjit in the RefPerSys open source inference engine project (GPLv3+ licensed) on https://github.com/RefPerSys/RefPerSys/ Both libgccjit and GNU lightning (see https://www.gnu.org/software/lightning/ ...) could be a basis for adding a genuine compilation layer to GNU guile. And RefPerSys uses both. I guess a significant issue would be to use libgccjit (or GNU lightning) with GUILE's garbage collector (which seems to be Boehm conservative GC). The RefPerSys project has a precise garbage collector and some persistence (to textual files). Since it is GPLv3+ licensed, its code could be reused in a future GUILE major version. RefPerSys is mostly coded in C++. I did contribute to GCC long time ago and hope that RefPerSys could become a GNU project (but don't know how to make that happen) Regards from near Paris in France. --=20 Basile STARYNKEVITCH 8 rue de la Fa=C3=AFencerie 92340 Bourg-la-Reine, France http://starynkevitch.net/Basile & https://github.com/bstarynk