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=66n7Cq9UHUpa3nB6miuiu/s+Yp2CdS54rbPA+JCFk5k=; b=BmoNaQ3PErZUNW/B2UmNLmTN7lJiUXas5av9uupP1Yk0jl1VIZxBQ/4JPdavPZwQL4 dTHsht2MJWfyz7jnIu61nccOfLwBiDhblRdvcN3Th4Y+Zvwb2linTdtHMNHsP2THQSVz YUOyVR/8tLOaIYKQ6plklf9HH1pS0EDpBBaO4sDSBCMzaqQ2HoFlU3smiUzF0HNOyfmB hBygoRAj7QC19vdUm/9tb/UoWnrT2w2oE3D1yukRBE2w+Ea28FTAXTVhCO5JM62WfCE0 qVZdZetV0+hq3vuat/rA89dA0M0s+9Ptg0B/yIrM5FWvFxzABEelyAMKe6emi17ip/1H Pr+w== MIME-Version: 1.0 X-Received: by 10.50.134.137 with SMTP id pk9mr8351471igb.93.1452074330142; Wed, 06 Jan 2016 01:58:50 -0800 (PST) In-Reply-To: <20160106091006.5F67B809D7A1@turkos.aspodata.se> 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> <20160105182120 DOT 3237F809D79B AT turkos DOT aspodata DOT se> <20160106091006 DOT 5F67B809D7A1 AT turkos DOT aspodata DOT se> Date: Wed, 6 Jan 2016 10:58:49 +0100 Message-ID: Subject: Re: [geda-user] A fileformat library From: "Levente (leventelist AT gmail DOT com) [via geda-user AT delorie DOT com]" To: gEDA User Mailing List Content-Type: multipart/alternative; boundary=047d7b2e3dd8a2c08d0528a7660f 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 --047d7b2e3dd8a2c08d0528a7660f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can have any difftool for git, so you can do visual diffs or anything what you want, independent of the file format. (as of today, we HAVE visual diff for PCB) You can write your own script in whatever language, as long as it has bindings for the file format, which is the case. When selecting a file format I would not have such constraints like "it should be pretty for a human eye". CAD data is so complex, that one can (and I believe should not) parse them with naked eye. For a computer, binary is much more efficient. So I still prefer the SQLite database, as that library is optimized for our purpose. Yes, I prefer to have a library, that parses our files, and gives us the possibility to use, or modify the data. I prefer this way because we have approx. 50 different implementation of pcb/gschem file parser. There is one in pcb/gaf, and all the other power users wrote their own. It would be much better to write the parser once, and other could use that. If file format changes, you have to just change one code, and not 50+. If we use a standard file format (SQL, YAML, JSON), the parsing library could be very thin. The independent parsing code is already written. Only the application (gEDA) specific code has to be written. Remember, all of us has very limited time to contribute code to gEDA nowadays. Lev On Wed, Jan 6, 2016 at 10:10 AM, wrote: > Britton Kerin: > > On Tue, Jan 5, 2016 at 9:21 AM, wrote: > > > Britton Kerin: > > > > On Sun, Jan 3, 2016 at 6:25 PM, John Doty wrote: > > > ... > > > > > Although these are good measures, once you adopt them you may sta= rt > > > asking > > > > > yourself why you aren't just using a binary format. The argument > for > > > text > > > > > is that you can glance at a chunk of it and easily tell what's > going > > > on. > > > > > A stronger argument for text is that you can process it with > > > text-oriented > > > > > tools. > > > > But ultimately the reason for wanting to use those text-oriented > tools is > > > > the same: you can see what you're working on with your own eyes. I= n > > > every > > > > other respect binary is better. > > > > > > I counter that. > > > . you have to check a binary file for valid values just as you do for= a > > > text file > > You have not commented this point. Any reader, human or program, have > to verify its input. Just because you have a binary file you can't just > do > > struct some_struct_type data; > read(fd, data, sizeof(struct some_struct_type)) > > and pretend that data will contain valid values. > > > > . if your binary file is in some way invalid, you will have a greater > > > problem correcting it than a text file > > > . discussing why a file is invalid is easier with a text file > > > . a binary file might be smaller, but that does not matter much > > > . text files are better provided for by version systems (e.g. git) > > > . it is easier to write tools that write text than binary, because > > > debugging the output is easier > > Regarding vcs of text data files for GUI program, it's a stretch to cla= im > > that the fact that they're text makes them much more compatible. The > diffs > > are only useful for the most trivial of cases. > > You used the word "better", now are you judging things around > "compatible". What do you want ? > If you want "compatible", then compatible to what ? > > I write a sym/fp-generators and I prefer text output; I can check the > output both "textually" and "visually". > > The diffs out the output of thoose generators are valueable when > debugging. > > You might think of gschem and pcb as gui programs, but there is > ifrastructure around them which is not gui. Don't think about their files > in the same way as a png or jpg, where the fileformats are well > entrenched and infrastructure is available. > > > For it to be really useful > > you need a (non-text) diff viewer of some sort. > > A graphical-diff is provided by > > http://www.imagemagick.org/Usage/compare/ > > You can generate png's from sch/pcb files and use that program for > graphical-diffs. > > It would be very useful for regression tests, other projects have been > successful at that. > > > All the rest of the above still boil down to examples of things that ar= e > > easier because you can see the data, and therefore manipulate and > validate > > it more easily. > > No, validate input and size, is not about "easier to see". > > But... > Why do you want to remove the text format for me ? > What are your complaint of having a textual file format ? > > By dropping the text you loose something, what is the gain of a binary > format that outweights that ? > > > > Also, there is no reason to change a file format unless you change th= e > > > functionality it provides, I have to "side heavily" with John on this= . > > > If you want to change the file format, you first have to provide some > > > goodies that will make people to accept it. And no such "goodie" > > > thing has appeared. > > A little while back a PhD Stefan Salewski put together a very good star= t > on > > a very nice router. IIRC he said 300-400 hours of effort, probably abo= ut > > $100k worth with overhead in the american market. It's not C (for good > > reasons) and currently can't talk to pcb at all. I would like to someh= ow > > arrange things such than efforts like this could maybe get used. > > In what way does his work relate to a decision about text contra binary > file format. > > > > You might write a library that reads and writes the files and if peop= le > > > find it useful, they will start using it, else, it will be just your > own > > > project. > > True. It might be useless but should at least be non-destructive. > > I thought you are for a fileformat library. I'm I wrong ? > But now you say that such a library is useless. Did I get that right ? > > I think a fileformat library would be useful, but I still > would like a textual format for sch/sym/pcb/fp files. > > Regards, > /Karl Hammar > > ----------------------------------------------------------------------- > Asp=C3=B6 Data > Lilla Asp=C3=B6 148 > S-742 94 =C3=96sthammar > Sweden > +46 173 140 57 > > > --047d7b2e3dd8a2c08d0528a7660f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


You= can have any difftool for git, so you can do visual diffs or anything what= you want, independent of the file format. (as of today, we HAVE visual dif= f for PCB)
You can write your own script in whatever language, as = long as it has bindings for the file format, which is the case.

When selecting a file format I would not have such constraints like= "it should be pretty for a human eye". CAD data is so complex, t= hat one can (and I believe should not) parse them with naked eye. For a com= puter, binary is much more efficient.

So I still prefer the SQ= Lite database, as that library is optimized for our purpose. Yes, I prefer = to have a library, that parses our files, and gives us the possibility to u= se, or modify the data. I prefer this way because we have approx. 50 differ= ent implementation of pcb/gschem file parser. There is one in pcb/gaf, and = all the other power users wrote their own. It would be much better to write= the parser once, and other could use that. If file format changes, you hav= e to just change one code, and not 50+.

If we use a stand= ard file format (SQL, YAML, JSON), the parsing library could be very thin. = The independent parsing code is already written. Only the application (gEDA= ) specific code has to be written. Remember, all of us has very limited tim= e to contribute code to gEDA nowadays.

Lev

On Wed, Jan 6, 2= 016 at 10:10 AM, <karl AT aspodata DOT se> wrote:
Britton Kerin:
> On Tue, Jan 5, 2016 at 9:21 AM, <karl AT aspodata DOT se> wrote:
> > Britton Kerin:
> > > On Sun, Jan 3, 2016 at 6:25 PM, John Doty <jpd AT noqsi DOT com> wrote:
> > ...
> > > > Although these are good measures, once you adopt them y= ou may start
> > asking
> > > > yourself why you aren't just using a binary format.= =C2=A0 The argument for
> > text
> > > > is that you can glance at a chunk of it and easily tell= what's going
> > on.
> > > > A stronger argument for text is that you can process it= with
> > text-oriented
> > > > tools.
> > > But ultimately the reason for wanting to use those text-orie= nted tools is
> > > the same: you can see what you're working on with your o= wn eyes.=C2=A0 In
> > every
> > > other respect binary is better.
> >
> > I counter that.
> > . you have to check a binary file for valid values just as you do= for a
> >=C2=A0 =C2=A0text file

You have not commented this point. Any reader, human or program, hav= e
to verify its input. Just because you have a binary file you can't just=
do

=C2=A0struct some_struct_type data;
=C2=A0read(fd, data, sizeof(struct some_struct_type))

and pretend that data will contain valid values.

> > . if your binary file is in some way invalid, you will have a gre= ater
> >=C2=A0 =C2=A0problem correcting it than a text file
> > . discussing why a file is invalid is easier with a text file
> > . a binary file might be smaller, but that does not matter much > > . text files are better provided for by version systems (e.g. git= )
> > . it is easier to write tools that write text than binary, becaus= e
> >=C2=A0 =C2=A0debugging the output is easier
> Regarding vcs of text data files for GUI program, it's a stretch t= o claim
> that the fact that they're text makes them much more compatible.= =C2=A0 The diffs
> are only useful for the most trivial of cases.

You used the word "better", now are you judging things aro= und
"compatible". What do you want ?
If you want "compatible", then compatible to what ?

I write a sym/fp-generators and I prefer text output; I can check the
output both "textually" and "visually".

The diffs out the output of thoose generators are valueable when
debugging.

You might think of gschem and pcb as gui programs, but there is
ifrastructure around them which is not gui. Don't think about their fil= es
in the same way as a png or jpg, where the fileformats are well
entrenched and infrastructure is available.

>=C2=A0 For it to be really useful
> you need a (non-text) diff viewer of=C2=A0 some sort.

A graphical-diff is provided by

=C2=A0http://www.imagemagick.org/Usage/compare/

You can generate png's from sch/pcb files and use that program for
graphical-diffs.

It would be very useful for regression tests, other projects have been
successful at that.

> All the rest of the above still boil down to examples of things that a= re
> easier because you can see the data, and therefore manipulate and vali= date
> it more easily.

No, validate input and size, is not about "easier to see".=

But...
Why do you want to remove the text format for me ?
What are your complaint of having a textual file format ?

By dropping the text you loose something, what is the gain of a binary
format that outweights that ?

> > Also, there is no reason to change a file format unless you chang= e the
> > functionality it provides, I have to "side heavily" wit= h John on this.
> > If you want to change the file format, you first have to provide = some
> > goodies that will make people to accept it. And no such "goo= die"
> > thing has appeared.
> A little while back a PhD Stefan Salewski put together a very good sta= rt on
> a very nice router.=C2=A0 IIRC he said 300-400 hours of effort, probab= ly about
> $100k worth with overhead in the american market.=C2=A0 It's not C= (for good
> reasons) and currently can't talk to pcb at all.=C2=A0 I would lik= e to somehow
> arrange things such than efforts like this could maybe get used.

In what way does his work relate to a decision about text contra bin= ary
file format.

> > You might write a library that reads and writes the files and if = people
> > find it useful, they will start using it, else, it will be just y= our own
> > project.
> True.=C2=A0 It might be useless but should at least be non-destructive= .

I thought you are for a fileformat library. I'm I wrong ?
But now you say that such a library is useless. Did I get that right ?

I think a fileformat library would be useful, but I still
would like a textual format for sch/sym/pcb/fp files.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Asp=C3=B6 Data
Lilla Asp=C3=B6 148
S-742 94 =C3=96sthammar
Sweden
+46 173 140 57=



--047d7b2e3dd8a2c08d0528a7660f--