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
Author: jeremy pereira
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
State of the Blog and Future Ideas
It's the end of summer, 2021. It's some time since I have posted anything, mainly because, this year things like music festivals have been allowed to take place in the UK, so I've been taking advantage of them instead of sitting in front of my computer writing material for this blog. I'd like to apologise, … Continue reading State of the Blog and Future Ideas
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