Re: [netmod] Request to review the YANG compiler annotations draft.

Martin Bjorklund <mbj@tail-f.com> Fri, 01 July 2016 08:40 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B3A9612D1E6 for <netmod@ietfa.amsl.com>; Fri, 1 Jul 2016 01:40:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.327
X-Spam-Level:
X-Spam-Status: No, score=-3.327 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-1.426, 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 RfRjB29RhP0F for <netmod@ietfa.amsl.com>; Fri, 1 Jul 2016 01:40:11 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id E933E12B018 for <netmod@ietf.org>; Fri, 1 Jul 2016 01:40:10 -0700 (PDT)
Received: from localhost (unknown [173.38.220.44]) by mail.tail-f.com (Postfix) with ESMTPSA id 725EC1AE0398; Fri, 1 Jul 2016 10:40:09 +0200 (CEST)
Date: Fri, 01 Jul 2016 10:40:34 +0200
Message-Id: <20160701.104034.227190528657031397.mbj@tail-f.com>
To: vinods.kumar@huawei.com
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <049901d1d361$32003d60$9600b820$@kumar@huawei.com>
References: <049901d1d361$32003d60$9600b820$@kumar@huawei.com>
X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Lf8Os6PAKZ_qw8ioxJ29OAj-ueE>
Cc: anil.sn@huawei.com, netmod@ietf.org
Subject: Re: [netmod] Request to review the YANG compiler annotations draft.
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Jul 2016 08:40:13 -0000

"vinods.kumar" <vinods.kumar@huawei.com> wrote:
> Dear All,
> 
>     We have written a draft, to add annotation in YANG definition which can
> be used by the YANG compilers.
> 
> We are implementing these drafts as a reference implementation in the IETF
> 96 hackathon on ONOS YANG utilities.
> 
> Request you to review the below drafts and provide your comments/feedback.
> 
> Draft(s):
> https://datatracker.ietf.org/doc/draft-agv-netmod-yang-compiler-metadata/
> 
>  
> https://datatracker.ietf.org/doc/draft-agv-netmod-yang-annotation-ds-and-der
> ived/

I have looked at these drafts.  I have two high-level comments.

  1)  What you propose is not valid YANG.  This new syntax would
      require a new version of the YANG language.

  2)  What you propose is not necessary; it can be done (and is being
      done in several existing implementations) with current YANG
      syntax and semantics, with normal YANG extension statements.

      For example, the draft proposes this:

       list server {
         ca:compiler-annotation{
           @MappedCollection(collection-type='map', map-key='name')
           @OverrideImpl('DefaultServer');
         }
         ...

      It can be done today as:

        list server {
           xx:mapped-collection {
             xx:collection-type map;
             xx:map-key name;
           }
           xx:override-impl DefaultServer;
           ...


/martin