Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrml7-0003vZ-KI for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jun 2021 19:24:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lrml5-0007OQ-Nv for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Jun 2021 19:23:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrml5-0007OH-GJ for pgsql-hackers@lists.postgresql.org; Fri, 11 Jun 2021 19:23:59 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrml3-0004Ed-Go for pgsql-hackers@postgresql.org; Fri, 11 Jun 2021 19:23:58 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id A9EDD12CC; Fri, 11 Jun 2021 15:23:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 11 Jun 2021 15:23:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=Y/D3LyOrJ0Zxn9OzQfC3m0Ag68J nb0UVULRhFnFF6bo=; b=KTq7xROcxMxt3coelf4qN7DxPfaWq7XsoSDa06RTwVr GNzGB+O5+Dmw/kft6kzyeFOO9jFhBKf/WooCanKPY9kjEFRiZeHjzODAEGaAnX5h GYoi8jFPpohGUxBTkWDHivaPmWj319uttHlLotByXTzwpzD52k4pau0TURWwv7GR CO8yRysI52u4hneS8UcZJPwXIpe9XhboD2WXZuCepLwH3CLkyO8w9S0SM3+nO6Pz KcW3gGZG70tzO84inPhnjs8e2lm57CKlSkl81XOjBb0ypZ29qsIfCS6walramyI9 3TyC/NNwWRUEd91NOOSmnPOGUjfQVMQSolz3eiaqV0A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Y/D3Ly OrJ0Zxn9OzQfC3m0Ag68Jnb0UVULRhFnFF6bo=; b=SkYwEiBhi/BdcFun1U2iso ick0GRCM1UAI8O7X3J82Hl7sZoN0WC129v4WBpkebz+3ApJzzC62kQGTffGBMhbq ZoAPKUAfP9sebq9jC2r2TxPkY+xYW60kQNWP04sImtG2zaKMfrzBbVMOtuTBcotg c1XH2m/GZWoP5F7uRgmm9R+l8UXqdLp0ItyCWv4hCAJjCDgOAnE3tkIAFd/e/zkf GeuFwPuPHYod5QfPd/t9kGckFcdz8WXi8gkhpSBY7RprS89o9XOM8m6I16k+4RVE abpIGO2YmS/FwEiQwhz4uLkZKjJYwZtyTjU05u30pV+2XAB2OC7u5Pzz7JTyySpQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedukedggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedukefhkeelueegveetheelffffjeegleeuudelfeefuedtleffueejfffh ueffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Jun 2021 15:23:54 -0400 (EDT) Date: Fri, 11 Jun 2021 12:23:53 -0700 From: Andres Freund To: Peter Eisentraut Cc: David Rowley , pgsql-hackers Subject: Re: automatically generating node support functions Message-ID: <20210611192353.ugmjp2txdwp2duls@alap3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-06-08 19:45:58 +0200, Peter Eisentraut wrote: > On 08.06.21 15:40, David Rowley wrote: > > It's almost 2 years ago now, but I'm wondering if you saw what Andres > > proposed in [1]? The idea was basically to make a metadata array of > > the node structs so that, instead of having to output large amounts of > > .c code to do read/write/copy/equals, instead just have small > > functions that loop over the elements in the array for the given > > struct and perform the required operation based on the type. > > That project was technologically impressive, but it seemed to have > significant hurdles to overcome before it can be useful. My proposal is > usable and useful today. And it doesn't prevent anyone from working on a > more sophisticated solution. I think it's short-sighted to further and further go down the path of parsing "kind of C" without just using a proper C parser. But leaving that aside, a big part of the promise of the approach in that thread isn't actually tied to the specific way the type information is collected: The perl script could output something like the "node type metadata" I generated in that patchset, and then we don't need the large amount of generated code and can much more economically add additional operations handling node types. Greetings, Andres Freund