Re: [yang-doctors] YANG dialects?

Ladislav Lhotka <lhotka@nic.cz> Thu, 19 December 2019 19:17 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EF54A120B28 for <yang-doctors@ietfa.amsl.com>; Thu, 19 Dec 2019 11:17:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.997
X-Spam-Level:
X-Spam-Status: No, score=-6.997 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iDdn4S-yBAzG for <yang-doctors@ietfa.amsl.com>; Thu, 19 Dec 2019 11:17:20 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 506C2120639 for <yang-doctors@ietf.org>; Thu, 19 Dec 2019 11:17:20 -0800 (PST)
Received: from birdie (unknown [IPv6:2a01:5e0:29:ffff:8592:b8e4:c3d4:5af6]) by mail.nic.cz (Postfix) with ESMTPSA id A0FC5140DC6 for <yang-doctors@ietf.org>; Thu, 19 Dec 2019 20:17:18 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1576783038; bh=dzKvGERXp//v9w8FFSwgdzDF91Qusx7+GMCF/8hbopM=; h=From:To:Date; b=xSropIs7ISYGjW4X+PZytlL4WWB6qfiGcBKg9fSHeK2MuCwjN4SdAPpR+W7T4oGK6 IaW+YrO75S8OP2OLDYwq1yMbzTCoIDFEKFtVUESUYSRx6JoNvG9hZI05T4Zzqc2rJT Wscyt81duthunMROMUv7w+LGnIWfLUJWPVh4zBic=
Message-ID: <1b398c323c72edc5970e90af06b70226b6eed755.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: yang-doctors@ietf.org
Date: Thu, 19 Dec 2019 20:17:17 +0100
In-Reply-To: <6684E0F3-DC49-4E94-B4FB-1109662F394D@tail-f.com>
References: <CABCOCHTB+V6sV8hRcAC+OfseBBN=jUQnHQxzEVB_1drWhaEVXg@mail.gmail.com> <20191218.220130.545256750871048075.mbj@tail-f.com> <CABCOCHRfNrz+cNMA8ciRYGEM-7aR=S2NYJzU-t8JQ620Zs=hvQ@mail.gmail.com> <20191219.090708.1031388562992503497.mbj@tail-f.com> <MN2PR11MB4366F797234C963E23734BA1B5520@MN2PR11MB4366.namprd11.prod.outlook.com> <6684E0F3-DC49-4E94-B4FB-1109662F394D@tail-f.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.2
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.101.4 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/LXKECNxLWd9v4PKu9PSf8ADaEnQ>
Subject: Re: [yang-doctors] YANG dialects?
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Dec 2019 19:17:23 -0000

On Thu, 2019-12-19 at 18:36 +0100, Jan Lindblad wrote:
> > > > > > Not so easy for all of them.
> > > > > > (1)
> > > > > > The pattern-stmt disaster cannot be addressed.
> > > > > 
> > > > > I think the solution is trivial, and it has been proposed to
> > > > > OpenConfig -
> > > > > introduce a new extension statement oc:posix-pattern.
> > > > > This will make the modules *legal*, and tools can use existing
> > > > > mechanisms
> > > > > to deal (or not) with this new statement.
> > > I don't think it is legal, because
> > > 
> > > o  extension: An extension attaches non-YANG semantics to statements.
> > > 
> > > This is not the case here, it is only syntactically compatible. If tool A
> > > says
> > > that some instance data is valid, but tool B says it isn't, then the
> > > standard is
> > > gone.
> > > 
> > > Lada
> 
> Of course it would be legal. It's always legal for a NETCONF server to reject
> an edit-config for no apparent reason (from a YANG perspective), so all device
> YANG models would still be legal if all pattern statements were removed, but
> the same string pattern constraints still enforced by the devices. The OC
> group could therefore remove their pattern statements and introduce a YANG
> extension oc:posix-pattern (or oc:go-pattern, or whatever) that gives a hint
> to some clients what is expected. The clients that don't understand this
> extension would just se a rejection for no apparent reason (from a YANG
> perspective).

I strongly disagree. Why then do we have so much text about constraints,
validity etc. in RFC 7950? The benefit of schema validation is that an
implementation can rely on an external validator and needn't clutter the code
with all kinds of input data checks. But if the validation result depends on
whether I choose library A or B, this concept simply falls apart.

Lada
> 
> > But, as I understand it, the regex implementations are not POSIX either.
> >  E.g. I think that they are using RE2 for Go, which is somewhat derived from
> > PCRE which is derived from POSIX regex, but not exactly compatible either.
> > 
> > So, it would end up replacing one regex language that can't be 100% directly
> > implemented with another regex language that can't be 100% directly
> > implemented.  This seems to make the life more complex not less.
> > 
> > I still believe that the only solution is to define as subset of XML regex
> > that can easily be translated into common regex engines. Although, as
> > Juergen has stated previously, this effectively defines a new regex language
> > ...
> 
> I don't think a subset is possible here. The subset would be the null set,
> since basically all the posix expressions have caret+dollar ^(...)$
> surrounding the actual expression, which are interpreted very differently than
> intended in the W3C world. So two separate pattern statements will be needed.
> 
> /jan
> 
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67