From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Question about code generation Date: Fri, 10 May 2024 14:59:39 +0200 Message-ID: References: <86r0ea3qf4.fsf@gnu.org> <877cg1hljm.fsf@gmail.com> 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="3748"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 10 15:00:20 2024 Return-path: Envelope-to: ged-emacs-devel@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 1s5PrH-0000lB-Fx for ged-emacs-devel@m.gmane-mx.org; Fri, 10 May 2024 15:00:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Pqn-0008OI-RD; Fri, 10 May 2024 08:59:49 -0400 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 1s5Pqk-0008Np-KZ for emacs-devel@gnu.org; Fri, 10 May 2024 08:59:48 -0400 Original-Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5Pqj-0005af-31; Fri, 10 May 2024 08:59:46 -0400 Original-Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-51f72a29f13so2468421e87.3; Fri, 10 May 2024 05:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715345981; x=1715950781; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XWVruWtZj7WFPg/yqnnQ8JVcNAqjKktdCLR3U+IuS1c=; b=b4z2+XE71Wzz6ah/7JLk6/SaA6QvBJOoadmNdnxTAw3/3cLWXGDQC2dDrnUpBen+vg 5xcN2tcMRPcUGckQ34fYezVTcTjxZZfLcEQ+Ukg554wiEtX/GfMIgUGJAL/AzlQ4JrIx F+PX6mn7VcLFGwqEI17+1G3XcgQHyEvtzdNYiYO0eC6sYaf/r0JlyBjzNDW2xuayQOoS T065gybSqlgMH4/FmeCUMIoHURC9/V7pXh6141xpZidBB1Sntycq+PWx+AWGvXaZmS1i 41dRuKqZCzFpFIO9FjAxNeN588dLUfbvlLRNF1COpJsVBujA/0JDVFcnAjXajmYBdje4 yF9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715345981; x=1715950781; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=XWVruWtZj7WFPg/yqnnQ8JVcNAqjKktdCLR3U+IuS1c=; b=pTRBlPu5rFnIw2vC1PfeXl33/IgaHA5sVPOZ2V1pxt16HVLhO/C3i9ksk4iSB1H5tk vO3ueiE8AVJWkvyCVwUOvdCYP1DJ78WdsvKttybL9MwOu3egIeISbhhZoLSCVxG+DF6c feIDLjzAt18NxngCC2tHaFUgNy9ZefxlICCA20gDBtI4aQcEmDysYm0jEzs3tiZ4n2w9 JCGo0E8YnCSLdx3BGcZ+DmDkCKIRKQHlGjDlMz8Iym+xwXa1du+n7bQR6o4YHS1HVlhO 7W4NeUDq/AMhHeP84ne8Eg0CnkP9MvbW81y38nFARUIZBQcdcByWITategqahcNNTrE6 IOVQ== X-Forwarded-Encrypted: i=1; AJvYcCW5L5UQSpvUxOZkhY4sEE5ydPR8vu0iEWCyhaDfHE4Pdh6fSdRJExqFZTIp4xVQTxjQE0gS+Cg5afirG0DKvLNUQWjA X-Gm-Message-State: AOJu0YxkfHwRiAm/xGKeCjKK1/kqbRop5r/ooC3vzJ+oEqWhUgi5sz1X c4B8isr0xcgpui+o1BUbyU5o//gx0Da8lfWuKANsL7yO6Dnmibqqk5W1mA== X-Google-Smtp-Source: AGHT+IGtM+lOPMbBRBuD44LNz80XsonPr9lsPt3722PMqj6t9GHokAtmJoRc0ypjLWE8EXOY4a8XKQ== X-Received: by 2002:ac2:5f79:0:b0:51e:1826:b836 with SMTP id 2adb3069b0e04-522105792d5mr1377369e87.45.1715345980245; Fri, 10 May 2024 05:59:40 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a7ef.dip0.t-ipconnect.de. [79.227.167.239]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b01797sm183421566b.176.2024.05.10.05.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 05:59:39 -0700 (PDT) In-Reply-To: <877cg1hljm.fsf@gmail.com> (Helmut Eller's message of "Fri, 10 May 2024 14:57:17 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=gerd.moellmann@gmail.com; helo=mail-lf1-x12b.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, 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319135 Archived-At: Helmut Eller writes: > On Fri, May 10 2024, Gerd M=C3=B6llmann wrote: > >>> But I guess I'm misunderstanding what you are asking about. >> >> I was thinking of (making my life easier and) generating the fix_ >> functions in igc.c, as an example, from knowledge that a C parser has >> which members are in a given struct, what's their type, Lisp_Object, >> pointer to something interesting, ... >> >> Together with meta infos passed to a code generator this could be used >> for all sorts of things, I guess. > > Would be nice to write things like: > > struct foo { > void* bar [[emacs::igc_fix_obj]]; > } Yeah, exactly! > > and then run a gcc or clang plugin over it and generate the needed code. > > Can libgccjit be used to parse C code and could we write the plugin in > Emacs Lisp? That would be fun.