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: MPS codegen Date: Fri, 14 Jun 2024 08:08:01 +0200 Message-ID: References: <87le3b43qi.fsf@gmail.com> <86r0d21tqj.fsf@gnu.org> <877cetgqiz.fsf_-_@gmail.com> <87wmmsg2e4.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="18264"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Helmut Eller , Eli Zaretskii , emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 14 08:08:53 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 1sI07J-0004W7-5r for ged-emacs-devel@m.gmane-mx.org; Fri, 14 Jun 2024 08:08:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sI06d-0005Yj-VZ; Fri, 14 Jun 2024 02:08:12 -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 1sI06a-0005WK-Ni for emacs-devel@gnu.org; Fri, 14 Jun 2024 02:08:08 -0400 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sI06Y-0000LY-TI; Fri, 14 Jun 2024 02:08:08 -0400 Original-Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2eaae2a6dc1so31411291fa.0; Thu, 13 Jun 2024 23:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718345283; x=1718950083; 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=9LS5Qz4YbsOZiCcIxcJKEarH2QjH6xGjiE8F70UpVIY=; b=IvYnyITkNK/c440k/mpxMgoAJXSt06lvdPnqwOvMSXKGKj2TV9x/gXrO8iJOZqy4Ri UTQZBzZ6e98HMNlVrHqkRS21Cj8a+qIDj3q15gUNtgboFK8ZmjwwiPVWqZ+ViPMRlvGn OQCF9Ukucdu6Mz8qalKkgye/9IYr2H5llSNvkG/kpAG7Vot95xpCpb/56nxBDItw0Gfh OVz7Jed5oBex3BI1vm1IZB3h/KlOydduiwb8GcZ64U5Lrr1MbC+mU9G+2uikvDZw2AdG /NPZSOZ3Yqz624AJnsbkZUbCsYF4wWf48pLRqav8L//mdJhBLyC/AOWHbXqkR0wefvh8 TnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718345283; x=1718950083; 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=9LS5Qz4YbsOZiCcIxcJKEarH2QjH6xGjiE8F70UpVIY=; b=j25vIJ6+XK9iiKcWre4Brnjh9QzNvbvj/Uab1Mpf+AuVUQHVHaRA80M1L+4KrPWW0c p3eU07OcKEFZcwW+xboXxEiPT1rKpuj2pW9MwpFIgAgAfwiUEsZyDP58mu2hPk616Kni PQNYXqLNzaXDLVmGEWP6OCFc3Vj1QAtZtNvGXgAzSkb+pk+Sm2fDv+ANjwqsk4IaIx4g KOYatZ3deHBvBeq+1hgs2drNy26C2a9QKe5lALftp02vrrFN9ktwYiMUoy+1Zzht34BF E2SktmIRZe+zMpqT9lVnzv6D2QDK34GebmeGZT+onD4beNlQIeJnlrdeJiwH27/Adg08 a5Ug== X-Forwarded-Encrypted: i=1; AJvYcCVx80N9xOROdbpFtWgP//rIYroYCvFWFxIflJ3nhc2DQBUZIuAsnqIAaoE1nnDS32XsZmFWY3Fybi2cBvMQOAC8mVrXCO0IC2Ojn8SqTGeSbK4= X-Gm-Message-State: AOJu0YxeqFTt7nBNKxf2HbpjkIAKmI0860n1D9o2KXefwSleGnII7cWS Kusgo7K2tD7cY0LTVPwRIcpLz2d5ooj7ReXsXV23Bk97Vu8SZ2IHCYTjUA== X-Google-Smtp-Source: AGHT+IE/NbxZLXdKKdvTTv/V5jgMZweY/bjxa3zKq4F5ZAhPIVzbzu+q0HbHQsROmWUC+gY6cyrT7g== X-Received: by 2002:a05:6512:1386:b0:52c:823f:2a10 with SMTP id 2adb3069b0e04-52ca6e56edfmr1453656e87.1.1718345283225; Thu, 13 Jun 2024 23:08:03 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e367ea.dip0.t-ipconnect.de. [217.227.103.234]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56db67dasm148751566b.58.2024.06.13.23.08.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 23:08:02 -0700 (PDT) In-Reply-To: (Andrea Corallo's message of "Thu, 13 Jun 2024 19:09:12 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=gerd.moellmann@gmail.com; helo=mail-lj1-x236.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, T_SCC_BODY_TEXT_LINE=-0.01 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:320048 Archived-At: Andrea Corallo writes: > Gerd M=C3=B6llmann writes: > >> Helmut Eller writes: >> >>>> I think the thing I don't like is that I believe there should be only >>>> one description of an object's layout. Be it C (struct), or be it >>>> somethings else, from which C is generated. >>> >>> Sure, but that's easier said than done. >> >> Yeah :-). Too bad that GCC doesn't have something like Clang's Python >> API. Somehow I don't really believe in tree-sitter for this specific >> purpose. But what do I know... > > It has (I think). I posted the link already somewhere in one of the MPS > related threads: > > Thanks for the reminder. I had forgotten again. How do the GCC docs fare wrt to GCC internals like the trees? Clang is pretty bad in that regard, IMHO. > > At the time I tried to hack something to generate the code you wanted > (well my interpretation as I never got the minimal example I asked for) > but when Eli suggested treesitter I gave-up as I thought was a good (and > better) suggestion.=20=20 The Lisp code Helmut posted could serve as an example, I think. The task would be to replace the manual object layout descriptions with ones generated from C code. Or something like that. BTW, if Helmut's idea wrt to loading the dump into MPS works, I'd personally consider generation of scanning code less of an urgent problem, although it still would be nice of course, and it might also be nice to use for things like the dumper and the old GC. But that's another project. BTW, @Helmut: do you plan to work on this idea? I'm asking because I'm in sort of a buf-fixing-only mode right now, i.e. I'm trying to make it work well enough that I can use it and get an impression how it does while doing something completely different from MPS. (Alas, I had to fix one or there things to make that possible.) So, I'll probably not tackle your dumper idea in the near future... > Why do you think treesitter is not up to the task? Well, I get that impression because it "only" operates on a syntactic level. But as I said, what do I know... :-)