Hi Andy,

There are many ways to write and design compilers.

Compilers that don’t understand import-by-semver just ignore the extension, no 
deviation is required.  They just import whichever arbitrary revision that they 
would have imported anyway, as specified by YANG 1.1.  The import-by-semver 
statement just reduces the set of valid modules revisions that can be used for 
import.

Thanks,
Rob


From: Andy Bierman <[email protected]>
Sent: 24 March 2019 12:07
To: Rob Wilton (rwilton) <[email protected]>
Cc: NetMod WG <[email protected]>
Subject: Re: [netmod] import-by-semver issue



On Sun, Mar 24, 2019 at 2:40 AM Rob Wilton (rwilton) 
<[email protected]<mailto:[email protected]>> wrote:
Hi Andy,

Yes we are currently implementing the module version field, although that may 
change depending on what different the final solution ends up being.

Support for import-by-version is less critical for us, and hence implementation 
would lag.

In terms of the issue that you raise:

-        I would expect that a compiler that understands semver to preload the 
semver extension, possibly allow with other common YANG type files, extensions).

-        For a compile that doesn’t understand semver then it would just ignore 
the extension, which should be fine.


Try to find even 1 compiler in the world that works this way.
Yes you can specially hack the extension implementation as if it were a 
built-in keyword.

I agree that it would be nice if this extension was part of the core YANG 
language, but I don’t think that is necessarily required.


I don't think any of semver is required for anything.
IMO it provides a minor improvement to  people familiar with the 
MAJOR.MINOR.PATCH numbering.
This improvement is lost as soon as extra letters are added and the string is 
no longer familiar.

Import-by-semver seems like it is part of the base module (no if-feature on the 
extension-stmt is even possible)
so skipping the implementation of it needs a deviation (oh wait, YANG 1.1 can't 
do that either).


Thanks,
Rob

Andy



From: netmod <[email protected]<mailto:[email protected]>> On 
Behalf Of Andy Bierman
Sent: 23 March 2019 19:01
To: NetMod WG <[email protected]<mailto:[email protected]>>
Subject: [netmod] import-by-semver issue

Hi,

I am wondering if there are implementations of this draft:

https://tools.ietf.org/html/draft-verdt-netmod-yang-semver-00


Specifically, implementation of the  'version' extension

https://tools.ietf.org/html/draft-verdt-netmod-yang-semver-00#section-3


IMO it is a really bad idea to put the semantics of how to import modules
in one of the modules that is imported.  Your example shows ietf-semver
imported first with no extension, but it could be last with a version extension.

          // all other imports, then last....


    import ietf-semver {

      prefix "semver";

      semver:version 1.1.2;

    }

Translation unit parsing is something that needs to be built into the compiler.
This should be part of YANG 1.2 if it is done.



  import example-module {

     prefix exmod;

     version 1.2.0+;

   }


To a compiler writer, the difference is huge. (ietf-semver extensions need to
be built-in statements in YANG, at least 'version')


BTW, all the import examples are missing the mandatory prefix-stmt


Andy

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to