miriam_e: from my drawing MoonGirl (Default)
miriam_e ([personal profile] miriam_e) wrote2026-03-10 09:13 am

More L-systems

One of the main reasons I wanted the graphics server was to experiment with l-systems. There is a bit of a bug in the angle-distance command I'd designed specifically for that task, but in the meantime it can be worked around. Here are some l-system images programmed with awk via the graphics server. Remember, awk doesn't have any graphics commands, so I love the fact that I can do this so easily with awk.

Why awk?
  • It is pretty-much guaranteed to already be on all Unix and linux computers.
  • It is a small language that nevertheless has extraordinary capability.
  • Being small means it is relatively easy to learn.
  • Also, being small means it is easy to include on any computer -- Unix, linux, Windows, Amiga... anything, even embedded systems. The current version of gawk (GNU awk -- the most popular awk) is a single file only about 3MB.
  • It is a very fast language.
  • It is interpreted, making the cycle time fast for developing programs.
  • It has loose typing, which allows more flexibility for the programmer instead of being constrained by what the computer allows.(Theoretically this makes it more difficult to debug, but in practice that is rarely the case.)

Here, behind the cut-tag, are some examples of l-systems using awk and the graphics server: