delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/02/07/17:19:55

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: Sat, 07 Feb 2015 23:19:37 +0100
Message-ID: <2047684.lX4NXpYgtQ@jasum>
User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; )
In-Reply-To: <20150207021605.4eb63302@jive>
References: <CAOFvGD7pJTo8A=MXVbuuXO=++0vGukUyqVfckVtnCi99ziqWJQ AT mail DOT gmail DOT com> <CAOFvGD4+Hf_O5-cwjVjyAVkNKm-YpDNtKxX75Sy74Tk2Q61uCQ AT mail DOT gmail DOT com> <20150207021605 DOT 4eb63302 AT jive>
MIME-Version: 1.0
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 Saturday 07 February 2015 02.16:05 you wrote:
> I know. However, I think Lua's stack is designed to push/pop argument and
> return values of functions. What we want to do, is put the whole layout on
> the stack. Arguments and return values are few byte of data. The whole
> layout can be 10 megabytes.

I used lua in an embedded project to configure, controll (start different 
threads, among others for CAN-comunication and relay controll) and deliver 
scriptable webpages (similar to php). I found the language easy  to learn yet 
effective and expressive. I would welcome config files in lua.

I think to use a scriptable config system isn't a problem security wise. In 
lua, you have the core and then add modules and funktions (like eg. an hex-
parser or a filesystem abstraction). The core itself has no posibility to break 
out of the defined set of commands you add.

IMHO, lua would be more expressive, easier to learn and simply more powerfull 
than "cryptic looking" scheme code. I also think personally, the usage of 
scheme inhibits people to change the gEDA tools to their needs, as it looks 
complicated (it certainly does to me).

I think it would be awesome to script the layout, but there is the problem of 
storing it back in the file. What if you use a loop to generate a couple of 
resistors in the file, parse it in gschem and the serialise it back? But on the 
other hand, to use snippets of code to define the resistor (a function with an 
argument of a table with x,y,refdes,footprint,etc and a list of commands to 
render the symbol) and reuse it would be nice. It certainly would simplicate 
the syntax of the layout file, as it would also contain a list of commands to 
"render" the page. Then it would be possible to add multi page schematics to 
one file, as a page is simply a list.

-- 
mit freundlichem Gruss

Christian Riggenbach

- Raw text -


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