paul at prescod.net
Thu Aug 12 17:11:40 CEST 1999
Phil Hunt wrote:
> That is a persuasive argument. One counterargument would be that
> any application that uses that approach would need a built-in
> XML parser and Parrot run-time library, thus creating code bloat;
One thing I've noticed is that sometimes you write these code generators
and then find that you still need a runtime library and it isn't much
smaller than the one you would have done directly.
Plus you have the cost of the duplicated redundant code created by the
code generator. So then you look at that duplicated code and you say: "I
should move as much as possible into the runtime library." So the
runtime library gets larger and eventually you say: "The 'generated
code' is really just a declarative specification that depends on a ton
of runtime code. So then you say: "I'm just converting one declarative
specification to another. That doesn't seem right."
As far as the size of the parser goes, there are two ways to minimize
that. You can either use a syntax that the language already has a parser
for (increasingly the case with XML) or you can use a syntax that is
really trivial to parse (Lisp S-exprs?).
More information about the Python-list