Readers of this blog are familiar with notions of computability – basically, the question is, what can machines do without human assistance? And you are familiar with machines. Electronic ones of course, but I always like to think of machines as composed of gears, levers and pulleys.
Topology? That’s another story. Rubber doughnuts being continuously stretched but always preserving that hole. Or calculus and differential equations.
When Lucid first came out decades ago it was a very primitive language. It had only program variables and built-in operators and functions, like next or fby. Users could not define their own functions (or “subroutines” as they were often called). Yaghi code would change all that.
It was developed in a secret lab and released, after which it spread rapidly. COVID? (maybe …). But I’m talking about the new PyFL interpreter. It’s finally available for the general public at pyflang.com
To make things simple, in the form of a zip file – I’ll put it on GitHub if there’s enough interest.
Just read README.txt and follow the instructions. As it says you need Python 3, 3.10.1 being the latest stable version. . It all should work straight out of the box. Continue reading →
I wrote a program to play unbeatable tictactoe in my experimental functional language PYFL.
(PYFL = Python based functional language; henceforth PyFL)
Of course writing a tictactoe player is hardly a major challenge, but I wanted to see how it turned out in PyFL. It worked out rather well, as you’ll see. It made good use of most of PyFL”s new features, especially variable binding operators.
A very long time ago I had an interesting if flawed idea. The idea was to (optionally) replace instances of expression constructs with equations defining or referring to components of conventional compound structures. The special variables defined or used I called “pronouns” but now I prefer “parameters”.
I fixed the flaw … and in so doing discovered a promising new equational programming paradigm.
In the previous post I described the PyFL approach to input, which is (arguably) purely functional, drastically simpler, and trivial to implement, as compared to Haskell’s cumbersome IO monad. (Btw I have nothing against monads or Haskell in general, I’m just not impressed by the Haskell IO monad).
This time I’ll talk about PyFL’s output scheme. It ticks two of the three boxes just mentioned – it’s simple and easily implemented. Here’s some output (yep, Pascal’s triangle). I’ll show the program at the end of this post.
Haskell has been both a blessing and a curse for Functional Programming (FP.)
A blessing because it has allowed many thousands to experience FP firsthand – by writing functional programs. They’ve discovered that it’s not that hard, that you can do useful projects in FP, and (thanks to the cleverness stuffed into Glasgow Haskell) the performance is comparable if not superior to that of conventional languages like Java,
So what is the curse? The curse is that Haskell dominates FP like Tyrannosaurus Rex dominated the dinosaurs (and like LISP used to dominate FP). Any discussion of FP becomes a discussion of Haskell, any proposed feature becomes a proposal for extending Haskell, and any problems with Haskell seem inherent in FP. The FP ecosystem seriously lacks diversity
I’m going to fix that with PyFL (PYthon based Functional Language), designed and implemented from scratch, as you watch
[This reports on research carried out in collaboration with my PhD student Monem Shennat and former student Omar Alaqeeli]
Dimensionality is a big issue with multidimensional Lucid – it means figuring out which dimensions are relevant to calculating the values of a variable.
It’s a simple idea but surprisingly subtle. In this post I’ll deal with the simplest case, time sensistivity in ‘classical’ time-only Lucid. Calculating which variables need to know the value of the time parameter t.