[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: M4 in python

From: Doug McIlroy
Subject: Re: M4 in python
Date: Fri, 19 Feb 2016 12:07:05 -0500
User-agent: Heirloom mailx 12.5 7/5/10

> 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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]