Dear Netmod WG,
we're currently trying to create a YANG-described API for BIRD. The
interface will be (at least) one large C file generated from the YANG
files, as we want the implementation to be directly tied to the
specification. What we're aiming to do, though, is to have the code
generator as simple as possible, maybe even completely
language-agnostic, and putting pieces of C code directly into our YANG
files.
Reasons why to do it this way, finally boil down to this:
* we don't want BIRD to have any additional layer of data structures
between API and internals, so there will be specific code for most
of the YANG tree nodes anyway
* we also want to provide the clients with a semantics-aware
interface, to e.g. canonically format the structured data for
human-readable output
There is an alternative approach, towrite a separate generator for each
usecase. We haven't decided yet whether it is viable for us. What I
personally see most valuable on the YANG extension approach, is a
possibility to easily ship and update access libraries with a native
object model for each supported language. (If you smell a new Bison from
this, you are quite right.)
My major question is for now, whether there is any work or thoughts in
this direction; I couldn't find any but it may be just my bad search skill.
Then it depends → if this approach has already been proven wrong, please
point me to the discussion to learn how to do the right way. Otherwise,
would there be any interest on designing a canonical extension to the
YANG syntax? I would call it somehow like YANG-With-Embedded-Code
(YWEC), which could be then processed by toolings, generating the "bare"
YANG and all the code files from one normative YWEC.
Thank you all for considering this topic.
Maria and the BIRD Team
--
Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod