From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: David Malcolm Newsgroups: gmane.comp.gcc.jit,gmane.lisp.guile.user Subject: Re: Running Compiled Guile Objects Date: Sat, 14 Dec 2024 18:02:11 -0500 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="35099"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) Cc: "guile-user-mXXj517/zsQ@public.gmane.org" , jit-/MQLu3FmUzdAfugRpC6u6w@public.gmane.org To: Basile Starynkevitch , Nala Ginrut , Hakan Candar Original-X-From: jit-bounces~gcgj-jit=m.gmane-mx.org-/MQLu3FmUzdAfugRpC6u6w@public.gmane.org Sun Dec 15 00:02:22 2024 Return-path: Envelope-to: gcgj-jit@m.gmane-mx.org Original-Received: from server2.sourceware.org ([8.43.85.97]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMb9R-00092H-K6 for gcgj-jit@m.gmane-mx.org; Sun, 15 Dec 2024 00:02:21 +0100 Original-Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AD70C3858D21 for ; Sat, 14 Dec 2024 23:02:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD70C3858D21 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IwYJoA7l Original-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id DEDF03858D39 for ; Sat, 14 Dec 2024 23:02:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEDF03858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DEDF03858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734217336; cv=none; b=jVQ/4K6U4sTIQDuzb3H/Tf6ti11bH0FJqA4Ji4St5AgjDsdxphY5a0AVdUwUJg+MHd3tI/L55L2rTuaMVZBsBTqWr9u9sa/ZlYKx09SMzwPUc31BFyiO25G6bhPU8e4SRmxH5fMmAIm9ACthtoxv19iw9sZO6NgYLkpFn1PKbZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734217336; c=relaxed/simple; bh=qwC084JCZCSINi01yPDMLW80MKEmgg0smWlavxSXFFY=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=aDObmRH+3FGuk+fSYzMpW/tUoAtMW71mgNOVTxRubhxgJ5JDLVSGIimiEW8d7aoHy3mZyqSEZ9G6cRU8vn4GUKalKp6ibnn+tvgrZqKCv0HlblofEyWcm4+aWxg/eDvZ37Q8Zv4QpUimgsViRCU/C7dao+kKyMleiKZJgvWuuRg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEDF03858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734217335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nhlcRNf78UnmzVdVZWSzNnEpLnNfiF8cIHi5xXqdiwQ=; b=IwYJoA7lkrkuJ6+6CAKHFPJMKWMWbEHKaMmpRzSgI5xFa/f7xkkunWeSAWastoZdl+ol38 XYUhOoWHf9il1pZryQaip/Yc+Np+ARtc0+sn7FNxaIB6E9J5GwnnpKZ/wBHJ9pSMSu9x5f K40HEAYL8rYFaqBfQkCOalmbPf03C80= Original-Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-zjETLVDlMCCadaP-cSSNmQ-1; Sat, 14 Dec 2024 18:02:14 -0500 X-MC-Unique: zjETLVDlMCCadaP-cSSNmQ-1 X-Mimecast-MFC-AGG-ID: zjETLVDlMCCadaP-cSSNmQ Original-Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7b6fe99d179so383080685a.2 for ; Sat, 14 Dec 2024 15:02:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734217334; x=1734822134; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nhlcRNf78UnmzVdVZWSzNnEpLnNfiF8cIHi5xXqdiwQ=; b=I2WCIquMIPLEVqCTpWoE7zR7j/fuvw5K1aV3JU3yF0zbqUu2sB2WFqqxfO14nAhsfY 8a83YWmciNJbxu8gW2d1b+fMYjfbI3+ukz5aMZb/aMYuUgv5RCGpebXDurePMa9ndiaY 79TKEC8j79y+JN+gh8qRWX6aZ26Ljqcu7NPC2UwmrJo25KCcWzs6Pu/74d8bXo2EnoqN iftnYHXNGHfA0paQa5joPaktMcz53o+v5yMjZEDcT0wHnIRS1pvRwSG7vR70Tln09KCw PSxIQUvdFgz0LW4ZP6nzdqwmlWqqoqibWx03lztHdcZrYHfSKJ5yiXYna3nG3KBYyZ9w qZGQ== X-Forwarded-Encrypted: i=1; AJvYcCWs8742i6TtTkgoj1rpNg9w4SU7nwgMrUH/EcNVzIYiqZel+Q2aB0oxKNe6g5IOwXxfDxI=@gcc.gnu.org X-Gm-Message-State: AOJu0YzkZRPMP/N3mrrvCU/zwlqNxXn4qMU3Ew4KDUPGxOL6/qrcO8EO 7AS4vPhbH+bPGvJP+gUWyIxnHYdItuxlu57KwdGPJoAGGjPSpNL6NVldqHpC1GR8mTtME3cu1o4 0DRIaCrllp4iQrZ0fWYk5hmGFrrHEe4OjaP7XqmGkuQX6 X-Gm-Gg: ASbGncu7O8yahj7T1Pj4moROq6D4qqecYGQeIGWYroLSTg9CH+LFjQ7UvLRSgk+nKJf RUjhGWCrcn30E4tZaqK/Kj20StwOio02zWyfolKHTZMPhZb+HhHQ3l9mSFqKKMxAAquM6M2swFn jY71EuCVR9ICx9uFmWI1PLw8jMrEioaLyyLSdlDcxxnK/UW7BjnpcvOpzRQW3hZN74IrlDe+Xr8 av0eoDApsSjjJh40xpYGWigvJdt/vbgN0OrBp8EymM7FO0Khgzi8z2j96VZWRKfZNHd7HYs4Ez/ BDYn4H1gc0TnnWbj X-Received: by 2002:a05:620a:6285:b0:7b1:11d9:446e with SMTP id af79cd13be357-7b6fbecb011mr1157390085a.3.1734217333772; Sat, 14 Dec 2024 15:02:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3oxz84dpDg0oim/8bHZwTH74kE2ay0KOxsAFCoohwfHolviZ1aaMmexjRruHiGQ2U5GzisA== X-Received: by 2002:a05:620a:6285:b0:7b1:11d9:446e with SMTP id af79cd13be357-7b6fbecb011mr1157385885a.3.1734217333414; Sat, 14 Dec 2024 15:02:13 -0800 (PST) Original-Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b7048bd82asm99091085a.82.2024.12.14.15.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2024 15:02:13 -0800 (PST) In-Reply-To: <769073d434c2ed5fb7937c85da240aa5df4d854a.camel-VdE74OAlGqnvXjIo7pOF+l6hYfS7NtTn@public.gmane.org> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: TqQi3hlnixQwSqRyS1saDH4lvH_t9Vpxw3kcaXgWJU4_1734217334 X-Mimecast-Originator: redhat.com X-BeenThere: jit-/MQLu3FmUzdAfugRpC6u6w@public.gmane.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Jit mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: jit-bounces~gcgj-jit=m.gmane-mx.org-/MQLu3FmUzdAfugRpC6u6w@public.gmane.org Xref: news.gmane.io gmane.comp.gcc.jit:1944 gmane.lisp.guile.user:19998 Archived-At: On Sat, 2024-12-14 at 18:11 +0100, Basile Starynkevitch wrote: > 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. > >=20 >=20 [Sorry if I'm missing context here, I'm only seeing the part of the thread where Basile CCed the jit-/MQLu3FmUzdAfugRpC6u6w@public.gmane.org mailing list] > 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/ ...and https://gcc.gnu.org/wiki/JIT Indeed, it turns out that everyone using libgccjit is using it for ahead-of-time compilation, rather than jit-compilation. Sorry about picking a bad name :) Probably of most interest to guile developers might be the gccemacs project here: https://akrl.sdf.org/gccemacs.html since AFAIK that has successfully used libgccjit from within a lisp- like language to get noticeable speedups. But guile developers probably know more about this than I do; I confess I don't know much about the lisp/scheme world. >=20 > 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. Indeed, it is gcc's code generation source code (which is C++), wrapped in a C API and header (it looks like a frontend to the rest of gcc, and like an API to the client code). Hope this is constructive Dave >=20 > I am using the C API of libgccjit in the RefPerSys open source > inference engine project (GPLv3+ licensed) on > https://github.com/RefPerSys/RefPerSys/ >=20 > Both libgccjit and GNU lightning (see > https://www.gnu.org/software/lightning/=C2=A0...) could be a basis for > adding a genuine compilation layer to GNU guile. And RefPerSys uses > both. >=20 > 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). >=20 > 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++. >=20 > 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) >=20 > Regards from near Paris in France. >=20