Subject: [netmod] modularity

From: Ladislav Lhotka <[email-masked]>
Date: Thu, 20 Nov 2008 18:56:40 -0600

Hi,

section 4.2 in dsdl-map draft summarizes differences in modularity
features between YANG and RELAX NG and explains why it is difficult to
have the same modular structure in both, without any assumptions on what
the individual modules contain.

I am still not getting why it is such a big problem to compile an ad hoc
schema from YANG modules every time it is needed. If an agent wants to
run an XML validator with all the bloated libraries, a poor little
Python interpreter should be a piece of cake.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

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

---

From: Phil Shafer <[email-masked]>
Date: Fri, 21 Nov 2008 11:04:52 -0500

>the individual modules contain.

You can map the YANG module into two dsdl files, one which needs
to be included with a namespace and one which does not.

>Python interpreter should be a piece of cake.

Compare this with a set of C files that belong in a library.  You
don't want to recompile all the files in libc everytime you want
to compile your "hello world" program.  We should be able to find
a way to do the mapping once and reuse the generated files, even if
we need to resort to building a small "driver" dsdl file to include
the dsdl files generated by the mapping process.

Thanks,
 Phil

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 24 Nov 2008 10:49:34 +0100

> to compile your "hello world" program.  We should be able to find

This is very different. Our case is more like a source code translator
between say Python and C. If you have a Python application divided into
modules, you cannot in general expect to be able to translate each
module separately and still be able to compile and link them correctly
in C because the scoping rules are different, in Python you can
selectively import just certain symbols etc. You can indeed have a
useful modular structure in both languages, it is however not identical.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Phil Shafer <[email-masked]>
Date: Mon, 24 Nov 2008 09:08:39 -0500

Ladislav Lhotka writes:
>This is very different....

I guess my expectation is based on the ability to do this reasonably
well in XSD.  But if it just isn't possible, I'll stop whining and
face reality.  Bummer...

Thanks,
 Phil

---

From: Andy Bierman <[email-masked]>
Date: Tue, 25 Nov 2008 08:29:25 -0800

> useful modular structure in both languages, it is however not identical.

The analogy to real code only goes so far.
In fact, when you recompile foo.c, you do re-compile stdio.h
and stdlib.h and foo.h and whatever files are named in the #include
directives.

Let's not confuse the compiler and the linker (even if they
are both named gcc :-)

A compiler needs to be told the start file and how
to find #include files, and the deterministic language
does not allow #include loops.  Just like C or Python, every
symbol used in the start file must be accounted for with
local definitions or include/import directives.

A linker needs to be told all the files to link together,
and it is possible that 'duplicate symbol' errors can
show up that were not detectable by compiling any given
start file  (e.g., duplicate namespace URI values).

> Lada

Andy