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

Vinod Kumar <vinods.kumar@gmail.com> Fri, 01 July 2016 13:21 UTC

Return-Path: <vinods.kumar@gmail.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 B3D0D12D5D2 for <netmod@ietfa.amsl.com>; Fri, 1 Jul 2016 06:21:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 bMhNvdPlAfA1 for <netmod@ietfa.amsl.com>; Fri, 1 Jul 2016 06:21:24 -0700 (PDT)
Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4450D12D537 for <netmod@ietf.org>; Fri, 1 Jul 2016 06:21:24 -0700 (PDT)
Received: by mail-qk0-x233.google.com with SMTP id j2so146684352qkf.3 for <netmod@ietf.org>; Fri, 01 Jul 2016 06:21:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uyo6TzyLIXKcXiqt8pmeh+xROo9NyneOUGaRvU1DphQ=; b=d/N73SKBWNJ2Vp7S/Ppd3GbARX0/lpUJfKFlBkrofdreb7Hlecl+wHZcw30OnZOkDD +X8+7yeNr9pKbmt/X90u04RdRAxdpBCwTGRbBKifrWQi2TjoX3IpWwmhUUluuqKqlKdJ BzBagtaRI4mu6SewG1pHu6EVj1aB2oIiT/TVDdQ/I/3ok5+bcWBWKqIyOsIS+i6ku71r CEyw8A4WiMzglQjIq5OYamOlA96TyDWKINYX8dCIANwi1ow9ycSfyl9fWDQCkJ9KyhCs H1YRs3mlVVwYybGn1AqeZ5mi4T9M2wKdtDtlvHNfSuU+NBpOgmYE9NMP55aXS05jXeEi K0xQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uyo6TzyLIXKcXiqt8pmeh+xROo9NyneOUGaRvU1DphQ=; b=VyFYbiKI2uNuiTv/AAKLIucPwwFkNKd1w3hVuuKXSo85NgsP92yn/XKpTDEP8w/NFQ KfqlIPAowEX1PX/ucfLy99COLNXUOMODlOHg6QBxTCI0eeIxk+keFUCgNZMAP9SIJKWg 8CGVfHQduko6VFwRRr06ODVsWdaTB3D5uvMPGaZnzuMA5dV6GPJ9kV+7gPPLIaFB4vhE qNbCfnON4bCFhBFPHJNpsmxn9M/VlcMxF13jC9Emtoxj2Pj4NRgujtecIEBbx1zZjGfI 0UDu7HCXa8m7x612o1jaFJLyx5gSNMBYQhTYdrojKqlZ/ynkHsP2xWIBPL2c2cBCFV21 FVjA==
X-Gm-Message-State: ALyK8tJ8ppOxBNmeDljl3IcyG7Zk8LASlQkLNs+CEWFcwxDxYSq62qRJT/I2kxsmLesYqjBH8N1jCRYWx1fwSQ==
X-Received: by 10.129.43.84 with SMTP id r81mr9590938ywr.283.1467379283385; Fri, 01 Jul 2016 06:21:23 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.24.131 with HTTP; Fri, 1 Jul 2016 06:21:22 -0700 (PDT)
In-Reply-To: <20160701.104034.227190528657031397.mbj@tail-f.com>
References: <20160701.104034.227190528657031397.mbj@tail-f.com>
From: Vinod Kumar <vinods.kumar@gmail.com>
Date: Fri, 01 Jul 2016 18:51:22 +0530
Message-ID: <CAJtQF==TCE1cyGqngJqW8PXpFqKp1iukoC8MQsSJzh9Daerpaw@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Content-Type: multipart/alternative; boundary="001a11413a52efe2f6053692dc4c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/ynBB4DE3CDcfWL3Fra_yOV_IvOc>
Cc: "vinods.kumar@huawei.com" <vinods.kumar@huawei.com>, "Anil Kumar S N (VRP Network BL)" <anil.sn@huawei.com>, Gaurav Agarwal <gauravjbp3ster@gmail.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 13:21:27 -0000

Dear Martin,

    Thanks for your valuable comments.

    Initially we also wanted to define them as individual extensions and
use them in the YANG file as indicated by you.

    Below are some reasons, which compelled us to add them as a separate
annotations(metadata) in YANG file.

    - These extensions are not required while defining the schema, it is
only required while implementing a schema in a server or client. It is used
by applications to instruct the YANG utilities or compilers to automate the
application development related to data organization / processing.
    - These extension are of internal scope, and should be masked while
server advertises its schema resources.
    - These extension values for a given YANG file may not match in server
and client.

    We felt that annotating is a good option, similar to other languages
where-in by looking at annotation itself utilities/compilers can perform
additional functionality as instructed.

    As you have pointed out, it is not a valid YANG 1.0, so we can modify
it as extensions to be compatible.

   We feel that annotation (compiler) support in YANG is an important
requirement which needs to be standardized for all compiler implementation,
hence we believe there is a need to incorporate annotations in YANG 2.0.

Looking forward for your opinion/feedback.

Thanks and Regards,
Vinod Kumar S.

On Fri, Jul 1, 2016 at 2:10 PM, Martin Bjorklund <mbj@tail-f.com> wrote:

> "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
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>