I'm preparing a presentation for Tcl and I need some materials about making
DSL in Tcl. Does anybody knows something like that on the net? I couldn't cope
to find anything interresting by googling.
--
// _ ___ Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl>
\\ L_ |/ `| /^\ ,() <ethourhs(O)wp.pl>
// \_ |\ \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx
"I am allergic to Java because programming in Java reminds me casting spells"
Tcl is an excellent base for creating domain specific languages.
Two good, early examples are Expect (for driving command-line
programs) and Tk (for creating GUIs). The first major project
I ever did in Tcl was Cost, a DSL for SGML processing.
More recently, see Jean-Claude Wippler's RATCL, a DSL for
relational algebra. I'm sure there are other examples out
there. These aren't commonly thought of as "domain-specific
languages" in the community -- most were invented before the
term "DSL" came into common use :-) -- but that's really what
they are.
Tcl has a number of characteristics that make it especially well-suited
for this sort of thing: a simple syntax (11 rules) with minimal
magic punctuation -- {}"[]$ and whitespace; and the related
doctrines of "everything is a string" and "everything is a command"
makes it easy to define new data and control structures.
--Joe English
> Tcl is an excellent base for creating domain specific languages.
Huh! That is why I am keen to increase the knowledge about it in my company as
well as encourage people to start using it. For me it is enough to be able to
imagine, how flexible is Tcl in such a use as DSL.
But I need something more than stating that Tcl is excellent. Something
concrete. Something that will throw the people out of their chairs. ;)))
> Two good, early examples are Expect (for driving command-line
> programs) and Tk (for creating GUIs).
Yes, the presentation about Tcl will include Tk and Expect. I'm going to show
some simple Tk applications and simple Expect scripts.
> The first major project
> I ever did in Tcl was Cost, a DSL for SGML processing.
http://www.flightlab.com/cost/ ?
Hmm... loox nice. What would you advice me to show as a nice example? This
topic looks like needing some specific knowledge and if I cannot "accept"
something very quickly it is rather unsuitable for presentatuion. On the other
hand, I know that the presentation need not be comprehensible to be
enthusing... ;)
Seriously; I'd like to show the people something that will show them that Tcl
is not "just another programming language", but rather a base for specific
languages. Having Tcl you don't have to spell up your own special syntax; you
just base on Tcl's syntax and you can even provide specific "syntax
extensions", however mostly using commands and braces. This is what I want to
exlain in examples.
> More recently, see Jean-Claude Wippler's RATCL, a DSL for
> relational algebra.
http://www.equi4.com/raintro.html ?
Thumping ;)
> I'm sure there are other examples out
> there. These aren't commonly thought of as "domain-specific
> languages" in the community -- most were invented before the
> term "DSL" came into common use :-) -- but that's really what
> they are.
Hmm... I think, Google should start a new service called "keywords", divided
into specific categories. Something like a central "point of understanding"
between the page publisher and page searcher.
> Tcl has a number of characteristics that make it especially well-suited
> for this sort of thing: a simple syntax (11 rules) with minimal
> magic punctuation -- {}"[]$ and whitespace; and the related
> doctrines of "everything is a string" and "everything is a command"
Unless something is a variable ;)
> makes it easy to define new data and control structures.
Yes. I also created something that can freely be called DSL:
;)
I think the examples you mentioned are worth using in the presentation.
Thanx!!! ;)
Donal.
> To avoid confusion: I mean Domain Specific Language ;)
>
> I'm preparing a presentation for Tcl and I need some materials about making
> DSL in Tcl. Does anybody knows something like that on the net? I couldn't cope
> to find anything interresting by googling.
Does the example in
http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/d1
f386899ab78510/ count as a DSL? I rather like making existing data into
something that can be [source]'d in its own right.
Michael
The wiki has numerous examples of DSLs, and you can find some in the
archives of this newsgroup too. For instance, here is a post with a
little DSL for rule-based game AI I knocked up a little while ago:
http://groups.google.co.uk/group/comp.lang.tcl/msg/5aa88dd1eed4c617
That example is perhaps small and self-contained enough (if less than
complete) to demonstrate how easy it is to do this sort of thing in Tcl.
Richard Suchenwirth has numerous good examples of DSLs on the wiki. One
of my favourites is "iShow" - a little presentation system:
http://wiki.tcl.tk/8985 which again is small enough to demonstrate in
its entirety for your coworkers. You could even use it for the
presentation itself!
Cheers,
Neil
Small? What do you mean "small"?
Your PowerPoint emulation requires almost half a page of code! <LOL>
I have already got some good ideas just from looking it over, and intend
to give it some study as a possible basis for a tiny help system I need.
Thank you for the posting.
Gerry