Re: Any basic cpp capability m4 cannot do?

Eric Blake <[email protected]> Sat, 10 May 2014 13:52:53 -0600
Newsgroups gmane.comp.gnu.m4.general
Organization Red Hat, Inc.
Message-ID <[email protected]>
On 05/10/2014 01:39 PM, Daniel Goldman wrote:

> Not to go too much on a tangent, I feel uncomfortable labeling m4
> "Turing Complete". I am no expert, but based on my best understanding,
> "Turing Complete" refers to programming languages, and does not apply to
> pre-processors.

M4 is a pre-processor that also happens to be a programming language.
It may not be the most efficient language, and you are correct that no
one would use it to write an OS, but that does not diminish the fact
that it is still a programming language.

> But I think maybe it's going to far to say m4 is "Turing Complete" and
> "can do anything". Maybe it's enough that it's very useful, and can do
> needed pre-processing tasks.

Just because something is Turing Complete doesn't mean it is useful in
an efficient time-frame for all tasks, merely that all tasks that can be
done in finite resources can be done in that language.  You are correct
that different languages have different strengths, and that m4's
strength is in pre-processing tasks, while other tasks easy in many
languages are rather convoluted in m4.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc (application/pgp-signature, 604 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJTboOVAAoJEKeha0olJ0NqeXIH/i767PbAqhK3UEyRkceOtBhE
kvTdbOlaJvxdTWPpm3cj/LxapVL/fcdBptL968dDW2J33MWNd88VxZ6UwRJANDAI
2MksIEnIJ2MIJtI1RTFcsC9AE1ZXYqiICqvZxQ62D+Krql7ui4NhrLvT7htN2IFn
c/fIJX5Xrt06zd9gStssDZJRUFNWKf9g4lEY4OSVTbRwhIC78fwEaG8JVKeku0w0
pdY1tk7hRdRrqZwnA5mJy8cjM282tYe1hfPtYd0LAzjFJIdn7+3kJJDVwAIjIYdQ
1bZGOidcbDkGhHIr47TThuiQi2IRw0kWRU4JY8cRvKgG2IuPOJCCFB7DEYOwmHk=
=xhRV
-----END PGP SIGNATURE-----