← Back to team overview

kicad-developers team mailing list archive

Re: [RFC] Symbol library file format

 

On 1/3/19 11:24 PM, Simon Richter wrote:
> Hi,
> 
> On 03.01.19 19:06, José Ignacio wrote:
> 
>> I
>> think useful comments to the proposed format should see beyond the
>> actual low level representation of the data and talk about the overall
>> model being used to store it.
> 
> tl;dr: That's a separate discussion.
> 
> There are two schools of thought here, one that treats saved data as a
> protocol between two black box instances, and one that treats it as a
> serialization of the internal state.
> 
> Both have advantages and disadvantages. The "protocol" approach allows
> changing internals more easily, and gives better compatibility between
> versions as changes to the file format have to be made deliberately,
> while the "serialization" approach gives us load/save basically for
> free, so we need a lot less code.
> 
> The "serialization" model also requires us to generate the internal data
> structures from a more constrained language like IDL, as the marshaller
> needs to know when to follow pointers, and what members of an array are
> actually valid.
> 
> I'm not sure there are generators that include support for spatial
> indexes, though, which is pretty much a requirement for fast rendering,
> so this is pretty much impossible at the moment, which places us in
> "hand written load/save code" territory anyway.
> 
> We have also ignored diff/merge capability so far, which I believe is a
> good thing because it cannot really be done on a textual level (schemas
> are two-dimensional, PCBs are three-dimensional, so there is no normal
> form with a consistent ordering of elements that will make the files
> diffable).
> 
> I fully expect both the internal model and the file format to change
> significantly in the coming years as new features are added. The main
> requirement for the file format is that it always needs to be possible
> to read older files in some way, and to recognize when a file is newer
> than the current parser understands.
> 
> It might be a good idea to also have an "extension" mechanism, where we
> don't increase the version number when adding a new feature, but rather
> mark files that actually use the new feature, so files written by newer
> versions that don't use one of the newer functions can be read by older
> versions. This would also be another point for "hand written" load/save.
> 
>    Simon
> 

I've done some more investigation on this and I'm not convinced that
this is any better than our current implementation due to some of the
issues Simon mentioned above.  I've also discovered there is also a
significant performance hit[1] with the JSON reader.  This is important
due to the overhead required when loading libraries.  I appreciate the
information and protobufs are interesting but I am going to stick with
what we have and know versus what we don't know because I don't think we
have the extra manpower to experiment only to find out it doesn't suite
our requirements.

Cheers,

Wayne

[1]:
https://groups.google.com/forum/#!searchin/protobuf/JSON|sort:date/protobuf/23Slq4AX7oE/xuwQX_ZXAAAJ

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References