Re: New release of programming in bare m4
Johnicholas Hines <[email protected]> Fri, 25 Jul 2025 08:53:34 -0400
| Newsgroups | gmane.comp.gnu.m4.general |
|---|---|
| Message-ID | <CALv2aroxfOZxKUWm03DN9i_qRKAG6ETN1HDb0_JPQ5-j=T23YQ@mail.gmail.com> |
--000000000000b4c1c8063ac06ef2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Wow awesome On Fri, Jul 25, 2025, 8:33=E2=80=AFAM Douglas McIlroy <douglas.mcilroy@dart= mouth.edu> wrote: > A new version of www.cs.dartmouth.edu/~doug/barem4.m4 enables > functional programming within m4. This thoroughly annotated > implementation of barem4 uses no builtin macros other than `define', > thereby demonstrating that the heart of m4 is Turing complete. In > particular, it provides conditional execution and a full complement of > arithmetic and comparison operations on unlimited-precision binary > integers. The most notable advances over the original version are > > 1. Equality testing of arbitrary identifiers, not just predefined sets > of identifiers. > > 2. Handling of encoded strings of alphanumerics. > > 3. Iteration over lists. > > 4. Higher order functions `foldl', `foldr', and `zip' inspired by Haskel= l. > > 5. More exploitation of m4 to generate code for itself. > > A test suite, www.cs.dartmouth.edu/~doug/testbarem4.m4 accompanies the > file of m4 definitions. > > Building on barem4, Eric Blake has made a simulator of an "intcode" > computer capable of running impressive applications. > > Doug > > --000000000000b4c1c8063ac06ef2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">Wow awesome</div><br><div class=3D"gmail_quote gmail_quot= e_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul 25, 2025, 8:= 33=E2=80=AFAM Douglas McIlroy <<a href=3D"mailto:douglas.mcilroy@dartmou= th.edu">[email protected]</a>> wrote:<br></div><blockquote c= lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli= d rgb(204,204,204);padding-left:1ex">A new version of <a href=3D"http://www= .cs.dartmouth.edu/~doug/barem4.m4" rel=3D"noreferrer noreferrer" target=3D"= _blank">www.cs.dartmouth.edu/~doug/barem4.m4</a> enables<br> functional programming within m4. This thoroughly annotated<br> implementation of barem4 uses no builtin macros other than `define',<br= > thereby demonstrating that the heart of m4 is Turing complete. In<br> particular, it provides conditional execution and a full complement of<br> arithmetic and comparison operations on unlimited-precision binary<br> integers. The most notable advances over the original version are<br> <br> 1. Equality testing of arbitrary identifiers, not just predefined sets<br> of identifiers.<br> <br> 2. Handling of encoded strings of alphanumerics.<br> <br> 3. Iteration over lists.<br> <br> 4. Higher order functions `foldl',=C2=A0 `foldr', and `zip' ins= pired by Haskell.<br> <br> 5.=C2=A0 More exploitation of m4 to generate code for itself.<br> <br> A test suite, <a href=3D"http://www.cs.dartmouth.edu/~doug/testbarem4.m4" r= el=3D"noreferrer noreferrer" target=3D"_blank">www.cs.dartmouth.edu/~doug/t= estbarem4.m4</a> accompanies the<br> file of m4 definitions.<br> <br> Building on barem4, Eric Blake has made a simulator of an "intcode&quo= t;<br> computer capable of running impressive applications.<br> <br> Doug<br> <br> </blockquote></div> --000000000000b4c1c8063ac06ef2--