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

Wolfgang Denk wd at denx.de
Sat Jul 3 21:33:30 CEST 2021


Dear Sean,

In message <8bbdb7a1-5085-a3b7-614f-12ae9aee8e8b at gmail.com> you wrote:
>
> > For a partial list, see
> > 
> > [1] https://github.com/Forty-Bot/lil/commits/master
>
> Whoops, looks like I completely misread what you were asking here. I
> don't have an exhaustive list of differences, but here are some similar
> things expressed in both languages:
>
> sh				tcl
>
> foo=bar				set foo bar
> echo $foo			echo $foo
>
> if [ 1 -gt 2 ]; then		if {1 > 2} {
> 	echo a				echo a
> else				} {
> 	echo b				echo b
> fi				}
>
> foo() {				proc foo {first second} {
> 	echo $1 $2			echo $first $second
> }				}
>
> for file in $(ls *.c); do	foreach file [glob *.c] {
> 	echo $file			echo $file
> done				}
>
> fact() {
> 	if [ $1 -eq 0 ]; then
> 		echo 1
> 	else
> 		echo $(($1 * $(fact $(($1 - 1)))))
> 	fi
> }
>
> 				proc fact {n} {
> 					if {$n} {
> 						expr {$n * [fact [expr {$n - 1}]]}
> 					} {
> 						return 1
> 					}
> 				}
>
> Hopefully this gives you a bit of a feel for the basic differences.

Well, I know TCL, and there has been a zillion of reasons to move
_from_ that language many, many years ago.  Intoducing this as new
"shell" language in U-Boot does not look attractive to me.
Actually, it gives me the creeps.

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
Drawing on my fine command of language, I said nothing.


More information about the U-Boot mailing list