Mail Archives: geda-user/2012/11/18/16:14:13
On 18 November 2012 17:03, Evan Foss <evanfoss AT gmail DOT com> wrote:
> I never understood why Guile became the plugin language when so many
> more people know C.
I don't know why guile became the scripting language of geda, but if
you have a look at this, http://www.vanderburg.org/OldPages/Tcl/war/,
you will know what GNU founder Stallman thinks. I guess using guile is
only something for GNU projects due to the license.
My experience with Cadence Composer tells me that it is good to have a
script language with which extensions can be programmed without the
need of recompiling C-code. Cadence Composer use SKILL, a Lisp
dialect, to offer scripting functionality to the user. SKILL has over
5000 access functions into the API of the Cadence design tools. A
savvy tool user can fairly quickly whip up code to make repetitive
tasks without the need to recompile anything. Whole design flows of
semiconductor chips are implemented in SKILL.
Other CAD tools, both EDA and mechanical, use some kind of extension
language. Lisp seems to be used by tools with long history, and newer
tools use anything from python through perl to lua and ruby.
A large number of commercial EDA tools use Tcl. Tcl is kind of the
reason why guile exist. If you google on John Ousterhout and Richard
Stallman, I think a lot of historical reasons for the existence of
guile will show up.
In the open source domain, Xcircuit and Magic are examples of
Tcl-enabled EDA tools. Xcircuit went through Scheme and Python as
extension languages before it landed on Tcl/Tk. For the Tcl version,
the author decided to make Xcircuit an extension of Tcl, that is, Tcl
is loading the EDA tool as a package and the functionality of the EDA
tool is a set of Tcl commands. The same author also started on a Tcl
version of PCB in order to make it a Tcl extension in order to have
front-end schematic and back-end pcb in the same mother process Tcl
for back and forward annotation. Same was planned for Xcircuit and
Magic. Don't know the state of that development.
Scripting vs an API makes sense, even if people write C. Prototyping
can be done in the scripting language, and bottlenecks can be
implemented in C when the interface and need for feature has been
decided. Tools like Modelsim simulator can be completely controlled
from the Tcl command line available in the application. Specific
work-flow related tasks can be kept completely separate from the core
simulator, and since Tcl is a very common extension language, it is
easy to bring knowledge from one tool to the next. It also doesn't
hurt that Tcl/Tk is available on most unix clones, windows and mac in
its basic core as installable packages. Getting to know the scripting
tool is very easy, and as a topping, offers a UI toolkit (Tk) with
which GUI applications can be built with little code.
As a long-time user of both extension Tcl (Modelsim) and extension
Lisp (SKILL in Cadence), I find Tcl a bit more user friendly as it
mimics the regular shell command line. Lisp is with its reverse polish
notation and large number of parenthesis a bit more cumbersome. At the
end of the day, the quality of the API documentation for a particular
tool integration of either is more important than which one of either
to use.
Since both Tcl and guile offers the two major ways of tool scripting,
embedding and extending, it is a matter of taste and license. In later
years Lua seems to be a valid alternative, but the conservatism of the
EDA industry still seems to be quite strong.
Anyway, design-flow related programming is, in my opinion, best done
in a scritpted extension language, otherwise the C-code will be
impossible to maintain. Different people use the same tool in many
different ways. gnetlist, and its various back-ends, is probably a
good gEDA representative of this.
--
Svenn
- Raw text -