www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/02/08/12:55:18

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
From: Christian Riggenbach <criggenbach AT magahugu DOT ch>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] Using Lua to safely read configuration and layout files (program attached)
Date: Sun, 08 Feb 2015 18:55:02 +0100
Message-ID: <3252013.jziFbvHuEb@jasum>
User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; )
In-Reply-To: <52E0C8E3-2FD3-4D79-A01D-962E7EFA6D4F@noqsi.com>
References: <CAOFvGD7pJTo8A=MXVbuuXO=++0vGukUyqVfckVtnCi99ziqWJQ AT mail DOT gmail DOT com> <66DD3BF9-092C-4EFF-B12D-6214141C152D AT icloud DOT com> <52E0C8E3-2FD3-4D79-A01D-962E7EFA6D4F AT noqsi DOT com>
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t18HsA1N020243
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

On Sunday 08 February 2015 10.09:06 you wrote:
> In Lua’s representation. Not as a Scheme data structure. You have exactly
> the same problem the C implementation has: you must expose the data through
> a Scheme API. You’re not really solving any problems, just torquing the
> design to fit your Lua prejudice.

The workflow would look like this:

1. start the lua core and load custom modules like eg. filesystem or hex-
parser, some global defaults and the custom functions for geda (like 
netlisting, data objects for lines, pins etc)
2. load and parse all config+macro files: system, user then local (like todays 
gafrc and friends)
3. load and parse the schematic

Now you have all the data inclusive the middle layer in the lua core, so you 
don't have an internal representation per application anymore (or just for 
specialised tasks like graphical representation or sorting algorithms). The 
core is ready to exchange the data back with gschem/gnetlist/etc.

4. seriealise it back to the schematic file to save the data.

gnetlist would then just be a simple wrapper around lua to do point 1-3, load 
a custom script (or an interactive prompt) and point 4. In all whole suite, 
you would have the exact same API to access the data, either with C code or 
directly in lua.

-- 
mit freundlichem Gruss

Christian Riggenbach

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019