Wednesday, October 20, 2010

Eagle switches to XML

Last week a rumor started spreading about Eagle, the popular schematic capture and PCB drawing package used by thousands of electronics enthusiasts, switching to a text-based file format. We at Elektor asked CadSoft, the editor of Eagle, about this rumour and got it confirmed. Somewhere in the hopefully near future Eagle will start using an XML-based file format for storing its drawings. The reason for this change is, according to CadSoft, that the binary format has reached its limits.

I find this reason a bit strange. Why would a text format be more flexible than a binary format? I mean, text is just limited binary, right?

Of course a text-based format is human readable, which is an advantage when trying to debug a broken file. But will this help in real life with a multi-megabyte sized file? (BTW, I have never yet had to debug a PCB file.)
A text-based format will be cross-platform as it avoids byte ordering issues, a good thing. Using XML is probably a good idea too, because it is a well known format and many tools & libraries for fiddling with XML files are readily available.
For the user a text-based format is interesting as it may help speed up certain repetitive tasks like net labeling or copying blocks. Users will start writing utilities for manipulating Eagle files.

Will they? Probably. They always do.

But Eagle already offers a powerful scripting language that lets you do lots of things without learning the file format first, so why bother? By writing a script you can already export everything yourself to a human readable format. And that is exactly what RS did for DesignSpark, the competitor of Eagle Freemium by Farnell (who bought CadSoft some time ago). RS offers scripts that allow you to export Eagle files as ASCII data. This is what it looks like:


(fileUnits IN)
(library Library_1
(padStyleDef "Oval1"
(holeDiam 0.0314961)
(padShape (layerNumRef 1) (padShapeType Oval) (shapeWidth 0.0514961) (shapeHeight 0.102992))
(padStyleDef "Round1"
(holeDiam 0.125984)
(padShape (layerNumRef 1) (padShapeType Ellipse) (shapeWidth 0.133984) (shapeHeight 0.133984))
(padStyleDef "Rectangle1"
(holeDiam 0)
(padShape (layerNumRef 1) (padShapeType Rect) (shapeWidth 0.07) (shapeHeight 0.1))
(padShape (layerNumRef 16) (padShapeType Ellipse) (shapeWidth 0) (shapeHeight 0))

That is not so different from XML, is it?

The only reason I can think of why Farnell/CadSoft wants to switch to XML is that they hope that the heavyweights like Cadence or Pads will start writing Eagle import filters for their products. These products already know XML, it would be easy enough to add Eagle support. And that would be a good sales argument for Eagle. Start simple and low-budget with Eagle and when you’re ready to move on to something more serious you won’t lose your work.

It is all about compatibility.

No comments:

Post a Comment