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
Category: Programming
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
Signal Handling in Swift
For my series of posts on the Lambda Calculus, I have developed a lambda calculator. At the time of writing, it only works in "single step mode": you hit the return key having typed in a lambda expression and it does one beta reduction. Hit the return key again and it does another beta reduction. … Continue reading Signal Handling in Swift
Protocol OrientedProgramming part 2
This post is all about how I achieved stage 1 of the conversion of the Lambda Calculator. It follows on from Protocol Oriented Programming. I have commented out all of the code in Expression.swift and added a protocol Expressible. All the functions that were "abstract" in Expression become protocol requirements and all of the functions … Continue reading Protocol OrientedProgramming part 2
Protocol Oriented Programming
This is technically a post in the Lambda Calculus series but I am concerned with the implementation of my Lambda calculator today. Anybody who has looked at the code will see I have used a class hierarchy to represent Lambda expressions. I use classes because I want my objects to be of reference types so … Continue reading Protocol Oriented Programming
Numbers in The Lambda Calculus
God created the natural numbers. All else is the work of man.Leopold Kronecker We've got lists and with lists we can do pretty much any data structure we like. However, in computing, we also need numbers. Usually, numbers are thought of as fairly basic entities with respect to computing, but, in the Lambda Calculus they … Continue reading Numbers in The Lambda Calculus
Lambda Calculus: Recursion
"When preceded by its quotation yields falsehood" when preceded by its quotation yields falsehood.Willard Van Orman Quine Before we start, recursion is a tricky subject. I suggest you read this article before continuing. Also, you're going to need at least version 1.3.1 of the lambda calculator to try out the examples. This version allows variable … Continue reading Lambda Calculus: Recursion
