Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756064Ab3G3Qkn (ORCPT ); Tue, 30 Jul 2013 12:40:43 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:38620 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755883Ab3G3Qkl (ORCPT ); Tue, 30 Jul 2013 12:40:41 -0400 Message-ID: <51F7EC84.90005@wwwdotorg.org> Date: Tue, 30 Jul 2013 10:40:36 -0600 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: David Gibson CC: James Bottomley , Grant Likely , "jonsmirl@gmail.com" , Mark Rutland , "devicetree@vger.kernel.org" , "ksummit-2013-discuss@lists.linuxfoundation.org" , Russell King - ARM Linux , Ian Campbell , Pawel Moll , "linux-kernel@vger.kernel.org" , Richard Cochran , Tomasz Figa , "rob.herring@calxeda.com" , Domenico Andreoli , Jason Gunthorpe , Dave P Martin , "linux-arm-kernel@lists.infradead.org" Subject: Re: [Ksummit-2013-discuss] DT bindings as ABI [was: Do we have people interested in device tree janitoring / cleanup?] References: <20130725175702.GC22291@e106331-lin.cambridge.arm.com> <2007664.vYsECFSKrV@flatron> <51F39FD8.6080808@broadcom.com> <2460092.aLmjrOVh1g@flatron> <51F3A82E.2000907@broadcom.com> <1374988276.1973.29.camel@dabdike> <20130730014453.GJ29970@voom.fritz.box> In-Reply-To: <20130730014453.GJ29970@voom.fritz.box> X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1924 Lines: 40 On 07/29/2013 07:44 PM, David Gibson wrote: ... > So, by way of investigation, let me propose an alternative > expression of schemas, that I'm also not convinced we should do, > but is possible and expressive. It's illustrative, because it's > kind of the polar opposite approach to XSD: just use C. That actually sounds reasonable. But, I think there's a difference between a schema, which defines what's legal in an abstract fashion, and a validator, which defines that the data conforms to the schema. I can see that codding a validator in C would be pretty easy, and even potentially quite simple/clean given a suitable set of library functions as you say. However, I'm not so convinced that expressing the schema itself as C would work out so well. I think the code/data-structures would end up being pretty stylized so they could actually be read as a schema. At that point, a specific schema language would probably be simpler? Of course, this is all somewhat conjecture; perhaps the only way to tell would be to prototype various ideas and see how well they work. Equally, I'm not sure I want to bind the schema definition to a particular language. I'd like to be able to programatically generate or manipulate *.dts files in arbitrary languages. Integrating a C interpreter into those languages in order to handle the schema would be annoying, whereas directly handling a special-purpose schema language seems like it'd be more tangible. As an aside, in the past I toyed with the idea of using Python data structures as a *.dts syntax, and hence allowing macros/auto-generation using custom Python code, and I'm sure Forth will come up sometime in this thread:-) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/