From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9CE9C07E99 for ; Mon, 5 Jul 2021 19:11:13 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D41C61982 for ; Mon, 5 Jul 2021 19:11:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D41C61982 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A08882BB4; Mon, 5 Jul 2021 21:11:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="M6LgM0Cb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D60E682BE2; Mon, 5 Jul 2021 21:11:07 +0200 (CEST) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE73C82BB2 for ; Mon, 5 Jul 2021 21:11:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82a.google.com with SMTP id g12so12862028qtb.2 for ; Mon, 05 Jul 2021 12:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dJktvCrkcxlTReZoIhggT1uVUQYleOB/1l15YDC+Vac=; b=M6LgM0CbgDkTLxMO4tTGQG4OGO19QOe9GsOV7w4SSFkp5qhAOxCt7F426zSRYjnIvC CdN/oUpYvBBLhMeUzMx4h0799wFTL+/Wg88xJ6DzeoqudQlH7uKlTbKgpTyxeGtvIlRx AGgFeV3JmikRU4yXP2zqYbbUZZttPH64EKcHs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dJktvCrkcxlTReZoIhggT1uVUQYleOB/1l15YDC+Vac=; b=l1/4ryJlhPySfxqxHLJfsOmcMmo3CNwl7a21Ng3YnLRLXC3FJZ5v7+YatKl2raPMv4 JPAcvBS+qxfFeECA5XkwyZ3DG0AFtNA6Z22l6CeE/HKbtt3FUTJrAukHxIygDdex141J SD7OO52ZeI1XHMi5qVvgcVpGewkHcjPWYpS2dCnB7zHYVvoQBWsSSSsXQtZj+adq0PPY VW+iLtwmqJ87GpPZAtuNuZYxjtt6oVZ/yGxUjC22oXDLhUg52iA1YgvD/lomwvHt/HI5 9tQeOx3rnT5qLkjEp5NWwPGlZwZJcXiv3fxe1Xwx4plLu+XFN2cyee/bhsv2/ebX1XjZ 0H9w== X-Gm-Message-State: AOAM530LbG4p1VX8sckEYcgtrUim2j7SOz4CDwbPDka6OWJpf9srs/pf Bb+uW+6+jkOQzxz8nyBfrTG7ig== X-Google-Smtp-Source: ABdhPJw4PrcaUb895vb9KMCmUOljRwlo3DJpkpM/E8njju1xQ+omcLaENmQp9cY52/zFW/pnfJGzIw== X-Received: by 2002:a05:622a:1891:: with SMTP id v17mr14366841qtc.138.1625512262558; Mon, 05 Jul 2021 12:11:02 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-5170-f33c-21eb-73eb.res6.spectrum.com. [2603:6081:7b01:cbda:5170:f33c:21eb:73eb]) by smtp.gmail.com with ESMTPSA id i10sm1486950qtx.80.2021.07.05.12.10.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Jul 2021 12:11:00 -0700 (PDT) Date: Mon, 5 Jul 2021 15:10:58 -0400 From: Tom Rini To: Wolfgang Denk Cc: Sean Anderson , u-boot@lists.denx.de, Marek =?iso-8859-1?Q?Beh=FAn?= , Simon Glass , Roland Gaudig , Heinrich Schuchardt , Kostas Michalopoulos Subject: Re: [RFC PATCH 02/28] cli: Add LIL shell Message-ID: <20210705191058.GB9516@bill-the-cat> References: <20210701061611.957918-1-seanga2@gmail.com> <20210701061611.957918-3-seanga2@gmail.com> <126700.1625223815@gemini.denx.de> <8bbdb7a1-5085-a3b7-614f-12ae9aee8e8b@gmail.com> <18831.1625340810@gemini.denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JwdeJJVnUaDT4bX5" Content-Disposition: inline In-Reply-To: <18831.1625340810@gemini.denx.de> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --JwdeJJVnUaDT4bX5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 03, 2021 at 09:33:30PM +0200, Wolfgang Denk wrote: > Dear Sean, >=20 > In message <8bbdb7a1-5085-a3b7-614f-12ae9aee8e8b@gmail.com> you wrote: > > > > > For a partial list, see > > >=20 > > > [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=3Dbar 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. Which of these things, from each column, can you do in the context of U-Boot? That's important too. > 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. This is I think the hard question. A draw of the current shell is that it it looks and acts like bash/sh/etc, for at least basic operations. That's something that's comfortable to a large audience. That has disadvantages when people want to start doing something complex. Sean has shown that several times and he's not the only one. LIL being tcl'ish is not. Something that has "sh" syntax but also clear to the user errors when trying to do something not supported would also be interesting to see. It seems like a lot of the frustration from users with our shell is that it's not clear where the line between "this is an sh-like shell" and "no, not like that" is. --=20 Tom --JwdeJJVnUaDT4bX5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDjWTcACgkQFHw5/5Y0 tyw1kQwAp1N2j9nQP2J2zTfg6nfBWnqftP0Riu5sFqgYYGqnNBF13n+qUk8CvH1D Smp/cEjnwLEphCqOlU/MChPi8HKZh74n4bxwoFa14MFoqJyaNdPfhRSXXia7no3g fJgarANCfoeFpuk78ZRfXa7HKp2N7OPWdkQg/nA95cd1M6CmT7Lte7tzgKUfmgbT USf5ZbGOGpqacw1kf2QO/dwj2Zsb06G/zUSeIq/20K2pQxxrh9Q7gh/HolAzHQdU BlAJii6vohTrFVkHMfYnqi1HrRaYYl09k5cqcSIG2llqQUlNou7z5W33MeNj7GXP Ro5QLVoDPTPM5CPRJNnVtjj+S1uTETsW2m1SX8z6t9GiwudQLQ80FfSyPatNDEH3 9VV2SkUM6TnHuH18H2dROdB1hM1kjdYkRJAIQjwte3rDmzYM/69qrHElWqWHe4UG +oxGJ1lvtYeZMvnUiw+kqn1uLWeLFi/oPMkSjBQyMaZoLZBwEXAszP2Ba0LXY1Qv BDdStIqm =jpBi -----END PGP SIGNATURE----- --JwdeJJVnUaDT4bX5--