Re: [yang-doctors] YANG dialects?

Jan Lindblad <janl@tail-f.com> Thu, 19 December 2019 17:36 UTC

Return-Path: <janl@tail-f.com>
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 4D268120905 for <yang-doctors@ietfa.amsl.com>; Thu, 19 Dec 2019 09:36:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 mnee9EzyWXoD for <yang-doctors@ietfa.amsl.com>; Thu, 19 Dec 2019 09:36:28 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 82533120900 for <yang-doctors@ietf.org>; Thu, 19 Dec 2019 09:36:28 -0800 (PST)
Received: from [10.147.40.106] (unknown [173.38.220.50]) by mail.tail-f.com (Postfix) with ESMTPSA id 22DEF1AE0389; Thu, 19 Dec 2019 18:36:27 +0100 (CET)
From: Jan Lindblad <janl@tail-f.com>
Message-Id: <6684E0F3-DC49-4E94-B4FB-1109662F394D@tail-f.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_B1FD4D09-D21C-4919-B845-647C7B9DA795"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Thu, 19 Dec 2019 18:36:25 +0100
In-Reply-To: <MN2PR11MB4366F797234C963E23734BA1B5520@MN2PR11MB4366.namprd11.prod.outlook.com>
Cc: Martin Bjorklund <mbj@tail-f.com>, "andy@yumaworks.com" <andy@yumaworks.com>, "yang-doctors@ietf.org" <yang-doctors@ietf.org>
To: "Rob Wilton (rwilton)" <rwilton@cisco.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>
X-Mailer: Apple Mail (2.3445.104.11)
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/3iSV40JvY-m9xIMsIom00U8c-MY>
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 17:36:30 -0000

>>>>> 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).

> 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