X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=HWMlSKgewZqgkgTE688giB9sCQQ8Z4JeTsCemtaLp50=; b=cH+WmEESt9K7LRpC7VlTlMFSrVBjIEJsFwOtVUKyjTbIklPAleLbQqZQ7MDspsGbLF rU2ALberishUEsyx7kXiUHwCJRMWtu1GjpDIS8240ADerYasgCcrrUfwl1a2r2bvaDPu +jcCN/q3AMKQsMikBp1AC5m0ZOZ028qEzRZtb7rU4pvFoznsR+2gSTaVDqYH1Lv/omNK aUnx9MyITKl+W40U4hFSoiJH8fUjh5h+Z0ZmdwGP50vY62Z42tZ/Rz0HLtbOgGjl4aDy tT//IYyS+RahLKJpi8Crch/mucu4/ZtpNn2C/RYV7T/7RGREJ5X6uCnky7jNKYKkFGsN RPBQ== MIME-Version: 1.0 X-Received: by 10.28.48.131 with SMTP id w125mr73281671wmw.18.1451783259809; Sat, 02 Jan 2016 17:07:39 -0800 (PST) In-Reply-To: References: <1512221837 DOT AA25291 AT ivan DOT Harhan DOT ORG> <20151222232230 DOT 12633 DOT qmail AT stuge DOT se> <0F6F1D0F-4F07-48EA-90FE-836EAD4E2354 AT noqsi DOT com> <0FCF3774-F93C-4BFF-BB61-636F75DCCACB AT noqsi DOT com> Date: Sat, 2 Jan 2016 16:07:38 -0900 Message-ID: Subject: Re: [geda-user] A fileformat library From: "Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com]" To: geda-user AT delorie DOT com Content-Type: multipart/alternative; boundary=001a114242a47df1db052863a13d Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk --001a114242a47df1db052863a13d Content-Type: text/plain; charset=UTF-8 On Sat, Jan 2, 2016 at 3:26 PM, John Doty wrote: > > On Jan 2, 2016, at 5:04 PM, Roland Lutz wrote: > > > On Thu, 24 Dec 2015, Peter Clifton (petercjclifton AT googlemail DOT com) [via > > geda-user AT delorie DOT com] wrote: > >> Getting the data model right is almost completely independent of the > rest - even if some may work more elegantly than others. > >> > >> Getting the data model right is also the hard bit - unfortunately. > > > > I absolutely agree. I've been working hard to get the in-memory data > representation for Xorn right, and the main thing which keeps me from > defining PCB object types right now is that I haven't found a convincing > data model for these yet. > > > > On Sun, 27 Dec 2015, Britton Kerin (britton DOT kerin AT gmail DOT com) [via > geda-user AT delorie DOT com] wrote: > >> Simple though it is, the effort of parsing it is not zero and is mostly > a waste. Modern language have built-in serialization, and with YAML you > get a cross-language version of that plus a well-defined human-readable > file format. What's not to like? > > > > The part of parsing a .sym/.sch file which can potentially become easier > with YAML is as simple as a sscanf(3). > > Except that what we have is already easy to parse with sscanf() and other > things. We have a lot of infrastructure based on what we have: symbol > generators, refdes renumberers, ... > As I've mentioned previously I'm talking pcb, which is a more painful format to parse (such that so far as I'm aware the parser in pcb is the only one). Personally I find formats like this: device=RESISTOR T 44400 49300 5 10 1 1 90 0 1 substantially less readable than ones with field names, but they are indeed easy to parse. The pcb format is quite a bit more elaborate and the savings from not rolling your own parser are more significant. > > After extracting the value strings from the file, you still have parse > and validate them no matter whether they have been stored in a .sym/.sch or > YAML file. > True. One of the nutty things about XML as people tried to use it was the notion that it can somehow validate the data. Trying to do that just causes schizophrenia about where validation should happen and I wouldn't attempt it. That needs an API like libgeda. However, a lot of potential application may just want to get the file parsed, and trust themselves to make some valid modifications. This can fairly easily be provided. If Xorn later supersedes direct use of YAML with a full validating load/save for the language in question, wonderful. I think you're criteria for what should go in libgeda are spot-on btw. Nor do I have any problem with a C interface calling python or gschem or for that matter C++. I do think providing a clean C interface to libgeda gets by far the best return on investment, since it's so widely known and with a little care wrappers can then be provided almost automatically for a wide variety of languages (via SWIG or some other similar mechanism -- or maybe Xorn facilitates this, I'm a little unclear). Britton --001a114242a47df1db052863a13d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sat, Jan 2, 2016 at 3:26 PM, John Doty <jpd@= noqsi.com> wrote:

On Jan 2, 2016, at 5:04 PM, Roland Lutz <rlutz AT hedmen DOT org> wrote:

> On Thu, 24 Dec 2015, Peter Clifton (petercjclifton AT googlemail DOT com) [via
> geda-user AT delorie DOT com] wr= ote:
>> Getting the data model right is almost completely independent of t= he rest - even if some may work more elegantly than others.
>>
>> Getting the data model right is also the hard bit - unfortunately.=
>
> I absolutely agree.=C2=A0 I've been working hard to get the in-mem= ory data representation for Xorn right, and the main thing which keeps me f= rom defining PCB object types right now is that I haven't found a convi= ncing data model for these yet.
>
> On Sun, 27 Dec 2015, Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:
>> Simple though it is, the effort of parsing it is not zero and is m= ostly a waste.=C2=A0 Modern language have built-in serialization, and with = YAML you get a cross-language version of that plus a well-defined human-rea= dable file format.=C2=A0 What's not to like?
>
> The part of parsing a .sym/.sch file which can potentially become easi= er with YAML is as simple as a sscanf(3).

Except that what we have is already easy to parse with sscanf() and = other things. We have a lot of infrastructure based on what we have: symbol= generators, refdes renumberers, ...

As I've m= entioned previously I'm talking pcb, which is a more painful format to = parse (such that so far as I'm aware the parser in pcb is the only one)= .=C2=A0 Personally I find formats like this:

=C2=A0 device=3DRESISTO= R
=C2=A0 T 44400 49300 5 10 1 1 90 0 1

substantially less readabl= e than ones with field names, but they are indeed easy to parse.=C2=A0 The = pcb format is quite a bit more elaborate and the savings from not rolling y= our own parser are more significant.
=C2=A0
>=C2=A0 After extracting the value strings from the file, you still have= parse and validate them no matter whether they have been stored in a .sym/= .sch or YAML file.

True.=C2=A0 One of the n= utty things about XML as people tried to use it was the notion that it can = somehow validate the data.=C2=A0 Trying to do that just causes schizophreni= a about where validation should happen and I wouldn't attempt it.=C2=A0= That needs an API like libgeda.=C2=A0 However, a lot of potential applicat= ion may just want to get the file parsed, and trust themselves to make some= valid modifications.=C2=A0 This can fairly easily be provided.=C2=A0 If Xo= rn later supersedes direct use of YAML with a full validating load/save for= the language in question, wonderful.

I think you're criteria fo= r what should go in libgeda are spot-on btw.=C2=A0 Nor do I have any proble= m with a C interface calling python or gschem or for that matter C++.=C2=A0= I do think providing a clean C interface to libgeda gets by far the best r= eturn on investment, since it's so widely known and with a little care = wrappers can then be provided almost automatically for a wide variety of la= nguages (via SWIG or some other similar mechanism -- or maybe Xorn facilita= tes this, I'm a little unclear).
=C2=A0
Britton
--001a114242a47df1db052863a13d--