X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Message-ID: <568F9A18.2080007@iee.org> Date: Fri, 08 Jan 2016 11:14:32 +0000 From: "M. J. Everitt (m DOT j DOT everitt AT iee DOT org) [via geda-user AT delorie DOT com]" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: geda-user AT delorie DOT com Subject: Re: [geda-user] (SQL file open/save) References: <1512221837 DOT AA25291 AT ivan DOT Harhan DOT ORG> <20160106091006 DOT 5F67B809D7A1 AT turkos DOT aspodata DOT se> <20160106133049 DOT 5A0E9809D79B AT turkos DOT aspodata DOT se> <20160106143629 DOT 4D39D809D79B AT turkos DOT aspodata DOT se> <20160106164022 DOT D0D4E809D79B AT turkos DOT aspodata DOT se> <20160106180912 DOT 42ddf4079d91384f206b7c35 AT gmail DOT com> <20160106191433 DOT 5dc5cb59 AT jive DOT levalinux DOT org> <20160106202817 DOT 56197b2c539d426a1b724c9e AT gmail DOT com> <568E09ED DOT 1080508 AT m0n5t3r DOT info> In-Reply-To: Content-Type: multipart/alternative; boundary="------------080004020306050207000305" X-Provags-ID: V03:K0:gDUIghDSRzs5u2quzZNLFj8vDQgtpMVFasb/1ERbM0ljyjyL3sm LqAC1e4nPRvl65XmFAXpiZNzHthnsB74dptTnmwBOxXY3rQ8YO0oAqaPsRfplm6RCTpqSK6 YUq1JRspt1JkUY8amYqsuH4kwfVp8h0YaJJsWDoZM6iIAB7y5bDWD85+fUik0RCe+D8RdoF aqOT1GTpgm2UfajuSthSw== X-UI-Out-Filterresults: notjunk:1;V01:K0:Gc19vBp3C/M=:n5pL0zzCENfKYQzHzEMKBe 41IQvyMhRWWihQEu/qFc4GUr99H58l99b/HAa7av2tHGiugSIqJnr4W78Z1vJiiC70cRkueGJ mvO5lMZNRIn3rLlNc10q9SSs5jNJRCWCCLIgeSxzFW3VogcS07w1hj8D72zq3es4dJXWkXr8W 1XzwW8MEqjPV88LbS2hW09ti1w3t+04rDGFqJQ3/bY3hLHYfibsPoEvzPNTeoXKcabuvtan3A /xM49ILLzT8xURyM32ryOVNirmnErN9i6amxksHsp5GEEKKVhit0kEWcRVRc3o9m+q5mCNIKR nDkqseaNq8A6+qwjVG0iave59UsBBKB9HapaGYJIqfr+UHzRfhpBls9IPVYMohuRSgcuQsji9 9T6gcp5vXsIyYRYGwjZpE+cBRG/cYuSWzmszQAO/U7tRV1O7GWlBuydNdHxO9BheUrC2dX5oj QjZ5aX/s/o18AsQgOAaI3QcOa2W5A9WYHiUQBTIXfW5y/pLAh3XOWN76yN2IdIgDMTmVwXZeP vJqubUiB7nJTc6UL0QhCGJScJFJoav657hVEZ6mINNI5r0vQIZgKkfxoSwkpA/BeJSQloiHgw lHNcCF8a5w5M/fYn5ZFFB/0sBTJt4056NpzM3ojrJPbekPWZeEIRLGuzPpxiiyR2+ZJ3Ecu4X BbMF4KAm3E71nFu+fLHY8NpJ3p2aO7MsDa8qnJMBs1528iwPo7KkoHXraXBXpMUGVJT5tprnD 0+bfvcXkUO/mdg9f Reply-To: geda-user AT delorie DOT com This is a multi-part message in MIME format. --------------080004020306050207000305 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Apologies folks, as I'm "coming late to the party" on this one. Sabin and Britton (if I read the thread correctly!!) make some interesting points, and I'm not privy to the argument why the existing geda/pcb file is considered 'deficient' (apart from the "its text, its not sexy-this or sexy-that or latest-exciting-development-tool-here" one, which is rarely valid). I'm personally a firm fan of the "if it ain't broke, don't fix it" ethos! Perhaps somebody can compile a list of potential options with their relative pro's and con's on the wiki page, (preferably without personal bias) and then we can take a(n) (anonymous) vote on which direction to take? The other option is to introduce a 'compatibility' import/export option ie. users don't -have- to use the default text format, and you create a series of 'file filters' that geda -can- use .. and any individual can use whatever happens to suit them. Think office programs, and RTF vs. ODF vs. M$ etc. Michael. On 08/01/16 07:30, Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com] wrote: > > > On Wed, Jan 6, 2016 at 9:47 PM, Sabin Iacob (iacobs AT m0n5t3r DOT info > ) [via geda-user AT delorie DOT com > ] > wrote: > > On 01/06/2016 09:28 PM, Nicklas Karlsson > (nicklas DOT karlsson17 AT gmail DOT com ) > [via geda-user AT delorie DOT com ] wrote: > >> On Wed, 6 Jan 2016 18:09:12 +0100 > >> "Nicklas Karlsson (nicklas DOT karlsson17 AT gmail DOT com > ) [via > >> geda-user AT delorie DOT com ]" > > wrote: > >> > >>> Then it come to SQL can you solve file open and save as usual? > Or do > >>> you have to make connection to some kind of database? > >> Yes. SQLite. > >> > >> https://www.sqlite.org/ > >> > >> Using server/client architectured database engin like > postgresql is IMHO > >> overkill. > >> > >> Lev > > I used SQL once to write a small database application but I used > an SQL server and even though it works and could be done it will > be rather complicated for ordinary use. With a simple library > binding it could be worth a try. > > > > > > all right, can't stand it any more, I've been eating my words for a > while now: please, please, please, stop with this SQL nonsense... > I know > that once you find a new shiny hammer everything looks like a > nail, but > schematics and PCBs are graphs at the core, and SQL databases are a > > > PCBs are not graphs > > > pretty bad fit for storing graphs (yes, you can shoehorn them in - see > mptt - but the results are more often than not awful); I too would > like > to see a more comprehensible file format for PCB, but SQL will be > anything but comprehensible (source: used SQL extensively for the last > 15 or so years as a developer and a server babysitter). > > > I've worked with it quite a bit too, I understand your concern. IMO > the big trouble is SQL makes it so easy to extend formats that formats > quickly become extremely complicated often with redundant and poorly > thought out tables. However, for someone who knows SQL it's tough to > look at them and say that vivified objects from a format like JSON > (array+dict) or YAML (array+dict+ref) will be anywhere near as potent > for them. > > > as far as file formats go, while something standard like json or > (cringe) yaml or (cringe even harder) xml would have advantages > > > Out of curiosity you like JSON better than YAML? It's certainly more > widespread but noisy and lacking refs, so YAML seems easier overall to me. > > > (ubiquitous library support, easy-ish to parse and modify with awk & > friends for people who are so inclined), it will degenerate into > unproductive holy wars (see previous pushes for lua as the file > format, > > > lua as the file format is a very different proposition, since it > doesn't get you portability to anything besides lua > > > or various bickering about which text format is best); the way I > see it, > the process looks like this: > > * decide on data model; this is where you think hard about what > you need > to do, how it maps to the physical world, etc. > > > Yes, this is the hardest part. > > > * decide on syntax, write formal grammar; this is where you take into > account parse-ability with standard text tools and human brains > (I, for > one, am a big fan of "design for humans first, computers later") > * have a parser generator generate parsers for every language you use, > generate some more as they are requested > > > What do you get by doing these two? It's a pain and its already been > done, in JSON, in YAML, in XML, in SQL. > > > problem solved, you get canonical parsers for all languages that are > needed and no extra layers of FFI (which can be needlessly heavy) > > > gEDA already uses a big stack of libraries, one small additional one > is all that any of the existing solutions mentioned above would > require, not FFI > > Britton > --------------080004020306050207000305 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Apologies folks, as I'm "coming late to the party" on this one.

Sabin and Britton (if I read the thread correctly!!) make some interesting points, and I'm not privy to the argument why the existing geda/pcb file is considered 'deficient' (apart from the "its text, its not sexy-this or sexy-that or latest-exciting-development-tool-here" one, which is rarely valid). I'm personally a firm fan of the "if it ain't broke, don't fix it" ethos!

Perhaps somebody can compile a list of potential options with their relative pro's and con's on the wiki page, (preferably without personal bias) and then we can take a(n) (anonymous) vote on which direction to take? The other option is to introduce a 'compatibility' import/export option ie. users don't -have- to use the default text format, and you create a series of 'file filters' that geda -can- use .. and any individual can use whatever happens to suit them. Think office programs, and RTF vs. ODF vs. M$ etc.

Michael.

On 08/01/16 07:30, Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com] wrote:


On Wed, Jan 6, 2016 at 9:47 PM, Sabin Iacob (iacobs AT m0n5t3r DOT info) [via geda-user AT delorie DOT com] <geda-user AT delorie DOT com> wrote:
On 01/06/2016 09:28 PM, Nicklas Karlsson (nicklas DOT karlsson17 AT gmail DOT com)
[via geda-user AT delorie DOT com] wrote:
>> On Wed, 6 Jan 2016 18:09:12 +0100
>> "Nicklas Karlsson (nicklas DOT karlsson17 AT gmail DOT com) [via
>> geda-user AT delorie DOT com]" <geda-user AT delorie DOT com> wrote:
>>
>>> Then it come to SQL can you solve file open and save as usual? Or do
>>> you have to make connection to some kind of database?
>> Yes. SQLite.
>>
>> https://www.sqlite.org/
>>
>> Using server/client architectured database engin like postgresql is IMHO
>> overkill.
>>
>> Lev
> I used SQL once to write a small database application but I used an SQL server and even though it works and could be done it will be rather complicated for ordinary use. With a simple library binding it could be worth a try.
>
>

all right, can't stand it any more, I've been eating my words for a
while now: please, please, please, stop with this SQL nonsense... I know
that once you find a new shiny hammer everything looks like a nail, but
schematics and PCBs are graphs at the core, and SQL databases are a

PCBs are not graphs
 
pretty bad fit for storing graphs (yes, you can shoehorn them in - see
mptt - but the results are more often than not awful); I too would like
to see a more comprehensible file format for PCB, but SQL will be
anything but comprehensible (source: used SQL extensively for the last
15 or so years as a developer and a server babysitter).

I've worked with it quite a bit too, I understand your concern.  IMO the big trouble is SQL makes it so easy to extend formats that formats quickly become extremely complicated often with redundant and poorly thought out tables.  However, for someone who knows SQL it's tough to look at them and say that vivified objects from a format like JSON (array+dict) or YAML (array+dict+ref) will be anywhere near as potent for them.  
 
as far as file formats go, while something standard like json or
(cringe) yaml or (cringe even harder) xml would have advantages

Out of curiosity you like JSON better than YAML?  It's certainly more widespread but noisy and lacking refs, so YAML seems easier overall to me.
 
(ubiquitous library support, easy-ish to parse and modify with awk &
friends for people who are so inclined), it will degenerate into
unproductive holy wars (see previous pushes for lua as the file format,

lua as the file format is a very different proposition, since it doesn't get you portability to anything besides lua
 
or various bickering about which text format is best); the way I see it,
the process looks like this:

* decide on data model; this is where you think hard about what you need
to do, how it maps to the physical world, etc.

Yes, this is the hardest part.
 
* decide on syntax, write formal grammar; this is where you take into
account parse-ability with standard text tools and human brains (I, for
one, am a big fan of "design for humans first, computers later")
* have a parser generator generate parsers for every language you use,
generate some more as they are requested

What do you get by doing these two?  It's a pain and its already been done, in JSON, in YAML, in XML, in SQL.
 
problem solved, you get canonical parsers for all languages that are
needed and no extra layers of FFI (which can be needlessly heavy)

gEDA already uses a big stack of libraries, one small additional one is all that any of the existing solutions mentioned above would require, not FFI 

Britton


--------------080004020306050207000305--