In my last post, I introduced the concept of an L-system (or Lindenmeyer system). An L-system is an alphabet of symbols, an axiom (which is a string of symbols from the alphabet) and a set of production rules that generate new strings from existing strings. We also talked about an alternative way to interpret the … Continue reading L-Systems part 2 – Push and Pop
Blog
L-Systems
An L-system, or Lindenmeyer system is a rewriting system for generating structured strings of symbols. The idea is named for Aristid Lindenmeyer who invented it to help him model the growth of algae and other simple organisms. An L-system consists of the following: An alphabet of symbols. These are the symbols used in strings that … Continue reading L-Systems
Lambda Calculus: Finding Primes
It's nearly two years since I wrote anything on this series - or anything else, so I think it is time to resurrect this blog. This post will be the last post discussing the traditional Lambda Calculus. We will be using the Lambda Calculus to find lists of primes using the Sieve of Eratosthenes. If … Continue reading Lambda Calculus: Finding Primes
Lambda Calculus: More Numbers
Recap In the last post not dealing with the internals of the Lambda Calculator, we introduced Church Numerals and some basic operations. There are actually only two operations that are needed and these are: isZero which is true if the number is zero and false otherwisesucc which gives us the successor of any Church numeral … Continue reading Lambda Calculus: More Numbers
Wordle
Before we start, this post is going to contain what some people might consider to be spoilers for the game of Wordle. I'll be using an actual solution as an example. Are you annoyed by all your friends posting their Wordle answers online? Do you think of a word and then go blank when presented … Continue reading Wordle
A Line Editing Library
This post announces the availability of linenoise-swift-utf8: A Swift replacement for GNU readline. There is a very useful library called GNU readline which enables line editing and history (and more) for command line programs. I've written a few command line programs and I know that having this functionality, or similar, makes them very much easier … Continue reading A Line Editing Library
Forth Interpreting Itself adDendum
Last weekend I eliminated the last Swift from the interpreting loop. There are now two pre-predefined words: an outer loop that reads a line of text and calls the the interpreter from the last post and the inner loop that interprets words from a line. The code for each looks something like this: : .readLoop … Continue reading Forth Interpreting Itself adDendum
Forth interpreting Itself
In which we interpret Forth using Forth and a bit of cheating With an implementation of refill, we are in the position of implementing the interpreter loop in Forth itself. In the previous post, we defined the interpreter loop like this: attempt to read a line into the input buffer while last read was successful … Continue reading Forth interpreting Itself
Forth Inside Out part 2
In which we internalise the read-execute loop, or die in the attempt. In Forth: Inside Out I did some refactoring on the read-execute loop. In this part I and going to re-engineer it entirely and implement it in Forth. The reason for doing this is that it will play better with some of the core … Continue reading Forth Inside Out part 2
Forth: Inside Out
In which we turn the interpreter inside out My Forth interpreter is working fairly well so far, but I think there is some unnecessary complexity. The interpreter is event driven, which means that everything it does is driven by some event, which is always receipt of some text input. This works OK and I chose … Continue reading Forth: Inside Out
