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=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 A4FC2C07E95 for ; Wed, 7 Jul 2021 13:32:30 +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 9A31161C6F for ; Wed, 7 Jul 2021 13:32:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A31161C6F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 9307182B30; Wed, 7 Jul 2021 15:32:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="soUNqr/h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2C91D82BD9; Wed, 7 Jul 2021 15:32:26 +0200 (CEST) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) (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 513C982B30 for ; Wed, 7 Jul 2021 15:32:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x82f.google.com with SMTP id x24so1960554qts.11 for ; Wed, 07 Jul 2021 06:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2X1XuHtv2cexTngkaT736h9Pj3T+0FabdlVQpzRlxCA=; b=soUNqr/hpaxRaWYJ8ycOyAbhc3r9F0RwQeS00dC4Kt5icTinIgwjZ1FLse2p2jbdYR 6pKOmnfB+k4MOOiICdzpOXLAjNHnK6CJofpxS28BeOMv5n0Enoay67cmysU8PdKTqYxh dJv0dduW+gZCTL8qmDpDZCt5ZCdnPyQkM301joLKA1ZpFOF0vbrGPp/aJ96j12HsuND8 gLjdM752Ml0yobZUgkn836fsnAvvJ89/3toPpZixIY90Brt5yqPItQ1+s3+FN8WNxPwm m8+BajF8rl68VlbxkJRH5mXwveqtVXiTdpDG9mXaWbQPYv0vjc7XBSVP/Pq2iwC5FZWE vHgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2X1XuHtv2cexTngkaT736h9Pj3T+0FabdlVQpzRlxCA=; b=LYW+cx/RInScCXav2jf/lgAVLxfznXsu7M2cSa9xkJnp/srHM5XJ8Vj6ll7eH56ID7 1TfpbXXvIZrSNDyzD9vyoGELrzKjjOT5B2jQTaxpZlCaf1y/cN/PqYOH083mbbGPUIdK WNCx8voR+ll5gUQU/XaUQm2zUFYR48OAwXFJcxP+qY9C+2+hxAL0qW6Xh9D3ilyUnNsB VMKZn/I1Vm3cbA/ViYXikJQ6iTXVT2dJJBSquaG+x/rrFG3in4G7YPdUOUc/zNMiFJGP vbiGhVycljLOdtIa/RxZgHf7u1dFVk/YN161oaj/Hp1cJqNdwzltVN63TEZT4NSFx88V h5yg== X-Gm-Message-State: AOAM532G98T0xaGvYCW73UYMeG/L2s1nUaHnv0u9+oc4QIymKIciNgUO PvDGMcnCamIoDOXRvFn8k0U= X-Google-Smtp-Source: ABdhPJwZ+8BKEXnDpl3ESUd1y15DvaKO1iuAPAdhB7v7ynYSCtmEvb8SJHK0XJvCFxobF1mdlv5igA== X-Received: by 2002:a05:622a:3d4:: with SMTP id k20mr22141178qtx.177.1625664737246; Wed, 07 Jul 2021 06:32:17 -0700 (PDT) Received: from [192.168.1.201] (pool-74-96-87-9.washdc.fios.verizon.net. [74.96.87.9]) by smtp.googlemail.com with ESMTPSA id e1sm6856188qti.27.2021.07.07.06.32.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jul 2021 06:32:16 -0700 (PDT) From: Sean Anderson Subject: Re: [RFC PATCH 02/28] cli: Add LIL shell To: Kostas Michalopoulos , Tom Rini , Wolfgang Denk Cc: u-boot@lists.denx.de, =?UTF-8?Q?Marek_Beh=c3=ban?= , Simon Glass , Roland Gaudig , Heinrich Schuchardt 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> <20210705191058.GB9516@bill-the-cat> <192103.1625557460@gemini.denx.de> <20210706154346.GT9516@bill-the-cat> Message-ID: <63ee3da3-8653-7a29-4696-b199ccfa99b1@gmail.com> Date: Wed, 7 Jul 2021 09:32:16 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 On 7/6/21 12:09 PM, Kostas Michalopoulos wrote: > On 7/6/2021 6:43 PM, Tom Rini wrote: >> I don't know if it's right either. But drawing on my comment just now >> and above about complex boot scripts, I also don't know if "it's sh but >> quirky and incomplete, WHY DOESN'T THIS WORK RIGHT" is better than "It's >> TCL? I don't know that, let me hit stackoverflow and do a little >> reading" as would be the common experience. Especially if we document >> up-front what the quirks we have are. > > I think the same would happen with Tcl and LIL. LIL might look similar > to Tcl (and it is inspired by it), but it doesn't have the same > syntax. A big difference comes from how variables are parsed with LIL > allowing more variables symbols than Tcl without requiring escaping > which affects some uses like expr, so e.g. in Tcl this > > set a 10 ; set b 20 ; expr $a+$b > > will give back 30 however in LIL will give back 20. This is because > Tcl parses "$a+$b" as "$a" "+" "$b" whereas LIL parses it as "$a+" > "$b", evaluates "$a+" as an empty string (there isn't any "a+" > variable), "$b" as 20 and then just runs expr with the single argument > "20". IMO both of these are nuts. I think the best thing to do here is to raise an error about a missing variable "a+" to force the user to rewrite this as set a 10 ; set b 20 ; expr ${a}+$b removing the ambiguity. Although I would generally like to follow TCL's lead, there are several places where TCL does crazy things (e.g. comments) which I have purposely not replicated. --Sean