From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sendmail.purelymail.com (sendmail.purelymail.com [34.202.193.197]) by sourceware.org (Postfix) with ESMTPS id F00AA3858D1E for ; Fri, 23 Feb 2024 09:20:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F00AA3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=miropalmu.cc Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=miropalmu.cc ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F00AA3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=34.202.193.197 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708680045; cv=none; b=Y7n7kMTE/YOnjntsHX2QwzeJVldB/lDuj9U1gJOjvHu1c+32cZRDdaXSosDb+8bf4eKMklzwSX+W79oK1TMPU58i6VZosO5HcIIeRmafvIl3K2z3oitkCd1g5RZSKoBUwANwOMh8/vDh7HCzj9hSGZ8ZThcwd8/mctSG9XNeZLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708680045; c=relaxed/simple; bh=jSyG6hB80c3Xn3aKk/gxUJHd3qxMEh8WAqcceQMtuMg=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:From: To:Subject; b=jw1q88nFP9ZP0hpf+FjomO/8sATG5u4+rGfsHwS2/nKrnTCG41J34LutsTQzhcBAOKGhmg/6XyQarCJWUqbGLcS/FbNr1oK8WMcrBgh3d/CRjgI1HPTXvIbGZ8sWiJ2Big4PsEXBF9EvyKastLQ39/PcTebLKMhMB1uGBts3Ml4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: a=rsa-sha256; b=PRS0sV4ZTi+Qr35fSzGIyGUXcUKYQwrP3H35oId3qjZbE5SLJQPwhTEz+tLrvWivE24Wg8KOHZj3f6qmRGPranlyB2+itpsgaHjzkb2yQ+/ADJXf/jXMmH6hPZeFyLEJbi9geRNmD22jnMOiDPRolbu2E0QS/CJjPVk/ao3aFXov1m1q0HFLNhZNmW2q1LRsa6z7Dz8R2L+C51JVgwJhfz2idtCOgw6NhRzNBD/EiTKD+RRnHDcwcR66hFp68GFy9wb8GYQWS4mAwYNBFTEkbDTfJYWjEH46/nsjTlEuFLCb31MUzFzoGfW3ObxlkzgpOcEthq8rFhLZiXWJLiSUxQ==; s=purelymail3; d=miropalmu.cc; v=1; bh=jSyG6hB80c3Xn3aKk/gxUJHd3qxMEh8WAqcceQMtuMg=; h=Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=l1k4RuECBwohpP03dxff7Q9NdEpYSK+z1d0Dc6XM8Itvo8gDvAiXAEBNwPNToxQh2lLS9Ixk4cLDcHbx4DUJVfFULBkg4FwKHe2+P8zpQ32VFVpD1sag9NfpqrF1OTe+OHgGOOMKSz+VykFgFhJZKf+K9EakPbQczgfhZjl6MRMxmAmjue+mOgUrZ4gB8gUjWFp0G/2vetKv5yVItUMRCJLcH5KjA1cAjjfj2pIaEDpAuTtLHkEbC81aawqh/nsQ1cdbNYXpVBf0JQmjT+0cDNOIgB92kjNoXkHWIVF+jGKejJeURFxf+Jgw0fzknUK5vmLK74Ajo4ECXLzgz+awFA==; s=purelymail3; d=purelymail.com; v=1; bh=jSyG6hB80c3Xn3aKk/gxUJHd3qxMEh8WAqcceQMtuMg=; h=Feedback-ID:Received:From:To:Subject; Feedback-ID: 21986:4128:null:purelymail X-Pm-Original-To: gcc@gcc.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -124501266 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 23 Feb 2024 09:20:36 +0000 (UTC) Message-ID: Date: Fri, 23 Feb 2024 11:24:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Miro Palmu To: gcc@gcc.gnu.org Subject: Discussing gcc font end hobby project Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi. I have a idea about long term hobby project relating to gcc, so with this email I'm asking feedback about the idea early rather than later. First little bit of context. I'm a student deep in a university course about compilers and I have been writing a compiler for language which is a subset of Herb Sutter's Cpp2. I chose this because I'm bit of a Cpp language nerd, and I can apply all of my Cpp knowledge to this project, which is fun. After the course I'm interested in converting this to a front end to gcc, with goal of learning about front end development to gcc. (It is a non-goal to try to upstream the project.) I don't see any obvious reason why this would not be possible. It just need to be able to target (C++ version of ?) GENERIC. This would be the first goal of the compiler and would serve as the MVP of the project. Below is discussing/theorizing post MVP goals. Because the Herb Sutter's cppfront transpiles Cpp2 to Cpp1, it is easy to have mix of Cpp1 and Cpp2 global level constructs in the same file. Just generate forward declarations of everything, keep Cpp1 definitions unchanged and transpile the Cpp2 ones. At the moment my subset Cpp2 does not support this compatibility but it would be nice to have at some point. But if my front end targets GENERIC I would have to use g++ machinery to turn the Cpp1 parts to GENERIC and then somehow combine the trees. I imagine that somebody with more experienced with GENERICs would have a intuition on how hard this combinations would be to implement. I'm curious about this intuition which I lack. In Cpp2 one can import and export Cpp1 modules. With transpiling to Cpp1 this again is easy implement but with potential front end, I'm not sure. I'm quite ignorant on Compiled Module Interface (CMI) implementation in gcc, so I'm asking just for guidance on where to look if one would want to learn on how CMIs are implemented. Thanks! -- Miro Palmu