Mail Archives: geda-user/2015/07/03/23:35:57
On Fri, 3 Jul 2015, John Doty wrote:
>
> On Jul 3, 2015, at 12:32 PM, Evan Foss (evanfoss AT gmail DOT com) [via geda-user AT delorie DOT com] <geda-user AT delorie DOT com> wrote:
>
>> Stefan, It is very telling that almost none of the symbol generators
>> or other small scripts and etc written by users and even the
>> developers use scheme. I see a lot of python, perl and etc.
>
> But most netlist generation uses Scheme. Creating a symbol or pseudo-schematic from some simpler representation is relatively easy text processing. My personal favorite language for this is AWK.
The main (or only?) reason most netlisters are written in scheme is that
the current infrastructure pretty much decides that you have to use
scheme unless you want to rewrite a lot of stuff from scratch. It's not a
big deal if you wanted to use scheme or if you like to use scheme.
I disagree that the difference would be the simpler format or that
non-netlist parts are more text processing than the netlist ones, see
below.
>
> For netlist generation, the internal machinery in gnetlist is critical. This is not so trivial, and the API via which you may access the processed data is in Guile (Scheme). It could be another language, of course, but I think the choices are narrower. I don?t see AWK as a practical language here.
I do.
My devmap scripts are written in awk. Back when I started to develope it,
I had to decide between two hard ways:
- use scheme for most parts, so that I can rely on the netlister infra
- use something else and just reproduce the relevant parts of the
netlister infra
I chose the second way and I managed to do it, and I am certain I spent
less time reproducing the relevant scheme stuff in awk than writing the
new parts in scheme. Meanwhile I did realize there's much more code
burried there in the scheme. I gave the other method a try, with the
test/json/xml/lihata exporters (and scheme was a real PITA).
My conclusion is that the netlister part more or less requires/forces
scheme. But it is very clear that it's so not because scheme is any more
suitable for the task than anything else, but because the amount of code
that's already there. It's just the pure inertia of a big amount of
code. Been there, done that, both ways.
Now that I worked this problem around with the exporters, there's a good
"binding" to other languages. My later netlister related scripts simply
use the exporter-written-in-scheme as a preprocessor than do the real job
in another language.
Regards,
Igor2
- Raw text -