The syntax of Tcl is often criticized as being "strange", which is not fair in my opinion. But I understand that programmers coming from other languages do not catch the syntax very fast... as it was my case, too :-(.
Could we help those beginners by writing a converter from a Lisp-like syntax to regular Tcl syntax? I am really willing to help those who do not catch the spirit of Tcl and give them the opportunity to learn softly our favorite scripting language.
> The syntax of Tcl is often criticized as being "strange", which is not > fair in my opinion. > But I understand that programmers coming from other languages do not > catch the syntax very fast... as it was my case, too :-(.
> Could we help those beginners by writing a converter from a Lisp-like > syntax to regular Tcl syntax? > I am really willing to help those who do not catch the spirit of Tcl > and give them the opportunity to learn softly our favorite scripting > language.
I suspect most programmers, even CS grads, find Lisp-like syntax a little (or a lot) strange.
Most would be more comfortable with an Algol-like descended language syntax (eg Java/C/C#/VB).
That being said -- have fun with the converter!
-- +------------------------------------------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+
At Thu, 20 Aug 2009 12:17:07 -0700 (PDT) sarnold <stephanearn...@yahoo.fr> wrote:
> Hello
> The syntax of Tcl is often criticized as being "strange", which is not > fair in my opinion. > But I understand that programmers coming from other languages do not > catch the syntax very fast... as it was my case, too :-(.
> Could we help those beginners by writing a converter from a Lisp-like > syntax to regular Tcl syntax? > I am really willing to help those who do not catch the spirit of Tcl > and give them the opportunity to learn softly our favorite scripting > language.
Tcl and LISP actually have very similar syntax -- both are prefix languages (except Tcl 'cheats' -- the expr syntax is infix, just like C).
Both Tcl and LISP treat data and code the same. Data can be code and code can be data (in Tcl, 'everything is a string', in LISP 'everything is a list').
Someone who is used to LISP's idiosyncrasies, should be pretty much at home with Tcl, more so that someone from the 'Algol' (Pascal/C/C++/Java/JavaScript/C#) or FORTRAN (BASIC) worlds.
> At Thu, 20 Aug 2009 12:17:07 -0700 (PDT) sarnold <stephanearn...@yahoo.fr> wrote:
> > Hello
> > The syntax of Tcl is often criticized as being "strange", which is not > > fair in my opinion. > > But I understand that programmers coming from other languages do not > > catch the syntax very fast... as it was my case, too :-(.
> > Could we help those beginners by writing a converter from a Lisp-like > > syntax to regular Tcl syntax? > > I am really willing to help those who do not catch the spirit of Tcl > > and give them the opportunity to learn softly our favorite scripting > > language.
> Tcl and LISP actually have very similar syntax -- both are prefix > languages (except Tcl 'cheats' -- the expr syntax is infix, just like > C).
> Both Tcl and LISP treat data and code the same. Data can be code and > code can be data (in Tcl, 'everything is a string', in LISP 'everything > is a list').
> Someone who is used to LISP's idiosyncrasies, should be pretty much > at home with Tcl, more so that someone from the 'Algol' > (Pascal/C/C++/Java/JavaScript/C#) or FORTRAN (BASIC) worlds.
I wish I remembered what I found strange about Tcl's syntax ... Or even if I did find it strange (coming from an Algol/Fortran/C background - in that chronological order).
What I do find strange is that Tcl is critized for its syntax. Apart from the absence of an assignment a la x = y, that may be seen as strange (but that is a semantical difference rather than a syntactical one - and actually goes very deep, an altogether different topic), what is strange?
Compare:
puts [lindex $list 0]
and
printf( "%s\n", list[0] );
Or the C++ "equivalent":
cout << list.get(0);
To help newcomers with Tcl's perceived strange syntax, we need to know what they find strange.
On 20 Aug, 21:07, Robert Heller <hel...@deepsoft.com> wrote:
> Tcl and LISP actually have very similar syntax -- both are prefix > languages (except Tcl 'cheats' -- the expr syntax is infix, just like > C).
With 8.5, there's a prefix syntax for arithmetic (functions in the ::tcl::mathfunc namespace, operators in the ::tcl::mathop namespace) if you prefer; they make some things much easier. And there's no reason in principle why Lisp couldn't use a special form for arithmetic expressions; the Lisp world just chooses not to.
> Both Tcl and LISP treat data and code the same. Data can be code and > code can be data (in Tcl, 'everything is a string', in LISP 'everything > is a list').
Everything is a list or an atom. Common Lisp also has arrays, which, while simulatable with lists, are hard to replicate the performance characteristics of with classic Lisp; computers are very good at doing arrays...
On Thu, 20 Aug 2009 12:17:07 -0700 (PDT), sarnold <stephanearn...@yahoo.fr> wrote:
> Hello
> The syntax of Tcl is often criticized as being "strange", which is not > fair in my opinion. > But I understand that programmers coming from other languages do not > catch the syntax very fast... as it was my case, too :-(.
> Could we help those beginners by writing a converter from a Lisp-like > syntax to regular Tcl syntax? > I am really willing to help those who do not catch the spirit of Tcl > and give them the opportunity to learn softly our favorite scripting > language.
> Regards > Stephane
That is a great idea! Lisp and TCL share a lot. While Lisp (and especially Common Lisp) has a lot of extra features like arrays and streams, TCL has TK. I really would like to try that.
Looks like correct Lisp to me ... but that probably means I do not get it either.
Or perhaps this: - Lisp is a demigod among programming languages and is beyond criticism. - Tcl is a pariah because mr. Stallman says it should not be used.
The somewhat bizarre social processes among programmers of all sorts cause the (ir)rational arguments of the past to flourish without reconsideration.
Strange, very strange, as the programmers' community has a very strong tendency not to be interested in its own history and the achievements of the past ...
Regards,
Arjen (being a trifle cynical perhaps - but then it is a monday morning)