[RFC PATCH 02/28] cli: Add LIL shell

Wolfgang Denk wd at denx.de
Thu Jul 8 19:00:53 CEST 2021


Dear Sean,

In message <43880bf0-baa6-0cb2-80fe-0fe50d43b42f at gmail.com> you wrote:
>
> > Tcl is a horror of a language for anything that is above trivial
> > level.
>
> Can you please elaborate on this? You've made this claim several times,
> but haven't explained your reasoning for it.

A long, long time ago I I was looking for an efficient way to do
regression testing for embedded systems, mainly U-Boot and Linux.  I
found GNU gnats to bee too difficult to handle und started writing
my own test system (you can still find this ancient stuff here [1])
based on expect/Tcl.  At that time, I could not find any other
solution, so I had to accept Tcl as programming language for this
tool.   And at the beginning it usually worked just fine.  Mostly.
Coming from a C programming environment I always found Tcl ...
strange.  For example it's scoping rules (see [2] for an example).
Things got worse when the system grew and we had to deal with
strings or parameters which might contail quotes or other special
characters.  This required fancy quoting, which depended of the
calling depth - if there was only on specific level. you might find
a solution after some (cumbersome) experimenting.  But if the same
string was used in several places in the code, and different levels,
you really lost.  At a certain point all our developers refused to
write new test cases for the system, because it always was the same
nightmare of fighting unforeseeable language problems.

That was when we abandoned DUTS, and some time later Heiko came up
with an initial implementation of tbot, soon to be joined by
Harald to make a production quality test system out of it [4].


IMO, Tcl has a large number of situations where it's actual
behaviours is not what you expect from it - it is good enough for
simple things, but any more complex processing of arbitrary text
data quickly drives you insane - things like quotes or braces and
other special characters.


[1] http://www.denx.de/wiki/DUTS/DUTSDocs
[2] https://wiki.tcl-lang.org/page/Commonly+encountered+problems+in+Tcl
[3] https://wiki.tcl-lang.org/page/Why+can+I+not+place+unmatched+braces+in+Tcl+comments
[4] https://tbot.tools/

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The number you have dialed is imaginary. Please divide by 0  and  try
again.


More information about the U-Boot mailing list