Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
M4 (computer language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== Macro processors became popular when [[programmer]]s commonly used [[assembly language]]. In those early days of programming, programmers noted that much of their programs consisted of repeated text, and they invented simple means for reusing this text. Programmers soon discovered the advantages not only of reusing entire blocks of text, but also of substituting different values for similar parameters. This defined the usage range of macro processors at the time.<ref>{{citation |url=https://www.gnu.org/software/m4/manual/html_node/History.html |title=History of GNU m4}}</ref> In the 1960s, an early general-purpose macro processor, M6, was in use at [[Bell Labs|AT&T Bell Laboratories]], which was developed by [[Douglas McIlroy]], [[Robert Morris (cryptographer)|Robert Morris]] and Andrew Hall.<ref>{{cite report |last=Hall |first=Andrew D. |title=The M6 Macro Processor. Computing Science Technical Report #2 |year=1972 |publisher=Bell Labs |url=https://plan9.io/cm/cs/cstr/2.pdf}}</ref> Kernighan and Ritchie developed m4 in 1977, basing it on the ideas of [[Christopher Strachey]]. The distinguishing features of this style of macro preprocessing included: * free-form syntax (not line-based like a typical macro preprocessor designed for assembly-language processing) * the high degree of re-expansion (a macro's arguments get expanded twice: once during scanning and once at interpretation time) The implementation of [[Ratfor|Rational Fortran]] used m4 as its macro engine from the beginning, and most [[Unix]] variants ship with it. {{As of |2024}} many applications continue to use m4 as part of the [[GNU]] Project's [[autoconf]]. It also appears in the configuration process of [[sendmail]] (a widespread{{fact|date=December 2024}} [[mail transfer agent]]) and for generating footprints in the [[gEDA]] toolsuite. The [[SELinux]] Reference Policy relies heavily on the m4 macro processor. m4 has many uses in [[Automatic programming|code generation]], but (as with any macro processor) problems can be hard to debug.<ref name='Turner1994'>Kenneth J. Turner. Exploiting the m4 macro language. Technical Report CSM-126, Department of Computing Science and Mathematics, University of Stirling, Scotland, September 1994. [http://www.cs.stir.ac.uk/~kjt/research/pdf/expl-m4.pdf pdf]</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)