If you're interested in L-systems you may also enjoy reading about Shape Grammars. Sort of an evolutionary dead-end in terms of system design, but intriguing. As far as I can tell they were basically superceded by other types of programmatic or parametric design systems. Some references:
Thanks for sharing, I never heard about this before! The Wikipedia article on shape grammar has a link to an old website[1] from a workshop at MIT that links to many more interesting resources, including the “Shape” book by George Stiny you mentioned as a free download (not sure if the author agreed to this, so I’ll just use it as a reading sample and buy the book if I like it), course material, presentations, etc.
I also found a more recent book[2] by George Stiny called “Shapes of Imagination: Calculating in Coleridge's Magical Realm” that is also about shape grammars and is actually open access. Coming from a design background, I am sure to take a closer look at some of this stuff.
This is a fantastic collection of links and makes me wish there were one modern site that summarized all this work, maybe with a working Javascript demo.
That's on the long list of blog posts that I've never written. Feel free to start with these and go forward! Make sure to get a physical copy of Shape, it's one of the most baffling textbooks I've ever tried to read.
I did a solo project on L-Systems for my bachelors degree at university two decades ago (sadly looks lost to time).
Embedding different symbols you can add more than just draw and rotation in one plane:
* Rotation in 3D space
* Stochastic steps
* Stacks to remember where the cursor was and return when done drawing a branch
* Depth-limited steps (can simulate gravity's effect on tree branches)
With this I was rendering biological life (trees, coral etc) in three dimensions.
I also tried applying it to MIDI, with "draw" being play a note, and symbols going up and down the scales. It made for interesting fractal music, but I never figured out the best approach for, say, a decent-sounding fugue.
I designed and teached a bachelors class in Generative Grammar Structures for few years at Sofia University. And L-systems were part of the curriculum. We also had Chris Coyne’s CFDG and Structure Synth in the classes.
Interestingly l-systems are semi-Thue grammars, not Chomsky grammars and their inventor was a biologist modelling tree growth.
The class made huge impact on everyone’s ability to comprehend discreet math concepts such as state space, regex, FSMs and alike by actually showing these visually. I’m convinced CFdG has to be included in higher school curriculum the same way spatial analysis augments/complements greatly classic geography courses.
It had a chapter on L-systems with some very nice examples. One of my earliest programs which I put online was a Tkinter based GUI to do this. https://github.com/nibrahim/PFractL
I first heard about L-Systems a number of years ago in the context of an elective masters course on computer graphics, where we briefly touched on approaches for procedural geometry generation.
The way it was introduced to us, was to basically apply a parsing grammar backwards, IIRC using an iterative match-and-generate approach, to produce a command stream for a renderer.
I remember finding the idea of using a parsing grammar in this way quite interesting and wondered about other areas where this could be used. For some reason, programmable shell-completion came to my mind, i.e. encode a command line options for a program using a recursive grammar with "expand a file path here" or "call an external helper (e.g. git)" as terminal symbols. Throw in capture groups for terminals and this kills most use cases where the imperative approach in Bash gets very tedious.
I keep recalling that idea from the back of my mind every time I see L-Systems featured on HN. I guess/hope most newer shells learnt from Bash and already do something like this, but I honestly was just too lazy to investigate this any further (so far).
The way I understand it is applying Chomsky grammar rules (eg. A -> ABF; B -> CFF) but in singular passes rather than expanding to its full length. Eg:
By drawing/considering these iterations you can model cell/biological growth over time; applying the grammar in its whole immediately would only get you to the end result, plus would never end if you had fractal/infinite sequences.
Always fun to see an interactive L-System implementation!
This one seemed to have odd line weights to me... until I realized that the default F-Reproduction value seems to have a bug: I think it's supposed to be "F[-F]F[+F]F" instead of "F[-F]F[+F][F]"?
BrainFuck? no. L-systems are a string rewriting language basically. L-systems though are more about the patterns they make when they're interpreted more than anything else.
I had a side project a while back which has a few fun presets . You can click-and-drag to animate the pattern by changing its branching angle:
http://benvan.co.uk/lsys/#?i=30&r=L%20%3A%20S%0AS%20%3A%20F%...