> implementing m4 in python could be expensive effort The basic architecture of M4 is a simple character-stream processor that switches sources at macro calls and sinks at macro definitions. Gnu M4 has become a big program with lots of extra builtins, which may or may not be useful for particular applications.
As a stream processor, M4 would seem to be a natural candidate for implementation with Python generators. Unfortunately I don't know Python well enough to predict whether the frequent stream redirections can be efficiently done in Python. It's an interesting prospect, though, to have the basic M4 model built in a framework that was intended for stream processing. Doug McIlroy
