A Functional Approach to Dictionaries

Dictionaries are extremely useful data objects. A dictionary is an associative store, basically a set of key-value pairs. A dictionary takes a key and returns the associated value.

Python has dictionaries and the Python engineers have put a lot of effort into making them efficient in both space and time. The PyFL interpreter makes extensive use of dictionaries and they are responsible for major improvements in performance. (PyFL is my experimental functional language.)

The obvious conclusion is that PyFL, too, should have dictionaries. A PyFL dictionary could simply be a Python dictionary wrapped in a functional interface.

Continue reading
Posted in Uncategorized | Tagged , , | Leave a comment

Functional OO in PyFL [130 views]

For along time I thought about adding object-oriented features to PyFL but couldn’t figure out how. Classes and methods don’t seem to fit into the declarative model, where all objects are immutable. But then I stumbled on an answer almost by accident.

My lucky break came when I figured out how to add structs to PyFl.

Structs

Almost every other programming language has some form of struct. A struct is a record with named components. For example, in most languages you can declare something like

struct Person {
    name: string
    surname: string
    dob: date
    job: occupation
}
Continue reading
Posted in Uncategorized | Tagged , , , | Leave a comment

PyFL and its While Clauses [130 views]

[This is another excerpt from the paper we were going to submit to ICFP 2025. Unfortunately it was immediately rejected because we included our names, contrary to the instructions that it is anonymous. Sigh]

PyFL is a pure and lazy functional language and yet has a limited, declarative form of iteration – a while loop construct (sounds impossible, but true). The while clause not only makes the coding easier, the iterative versions are often much more efficient.

Continue reading
Posted in Uncategorized | Tagged , , | Leave a comment

The Yin and Yang of Programming [3000 views]

[This is from a paper we’re submitting to the International Conference on Functional Programming (ICFP 2025)][update: the paper was rejected because we included our names, violating anonymity]

Introduction

Recursion and iteration are the Yin and Yang of programming. Conventional languages support both, but tend to favor the Yang – iteration. Java and C, for example, have elaborate while and/or for statements but can’t easily return functions as results. Python is a bit better. The Yin, we might say, is strong in that one. 

Continue reading
Posted in Uncategorized | Tagged , , | Leave a comment

The Root of all Evil- more sayings [210 views]

“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.” ~ Donald Knuth

“Both women and computer science are the losers when a geeky stereotype serves as an unnecessary gatekeeper to the profession.” ~ Cordelia Fine

“All problems in Computer Science can be solved by another level of indirection.” ~ Butler Lampson

Continue reading
Posted in Uncategorized | Tagged , , | Leave a comment

“Computers are Useless” and Other Sayings [480 views]

“Computers are useless. They can only give you answers.” ~ Pablo Picasso

“Science is to computer science as hydrodynamics is to plumbing.” ~ Stan Kelly-Bootle

Back then, the entire Internet consisted of two slow, boxcar-sized UNIVAC computers about 50 feet apart, connected by a wire. It would take one of these computers an entire day to send an email to the other one, which would immediately delete it, because it was a Viagra ad.
Dave Barry

Continue reading
Posted in Uncategorized | Tagged , , , | 2 Comments

Old Masters, New Technology

Ive been looking at paintings a lot lately, and started to wonder, what would the old masters like Rembrandt make of new technology: trains, cars, TV etc? In particular, what would they make of computers and smart phones. How would they portray them in their paintings?

Impossible to know, you say. Yes, but we can guess – thanks to AI!

Continue reading
Posted in Uncategorized | Tagged , , , , , , | Leave a comment

The complete story of Gödel incompleteness. [4200 views]

The famous mathematician Kurt Gödel proved two “incompleteness” theorems. This is their story.

Continue reading
Posted in Uncategorized | 1 Comment

The Rise and Fall of GOFAI [3000 views]

Recently various pundits (including myself) have announced the end of Good Old Fashioned AI (GOFAI). But it has an impressive history, and encountered failure only on the verge of what would have been its greatest triumph.

What is GOFAI? Some say it is what grew out of the 1956 Dartmouth AI meeting. However others have described it as based on “symbolic reasoning”, which has a history well before 1956. We’ll adopt this definition.

Continue reading
Posted in Uncategorized | Tagged , , , , | 2 Comments

The Autocomplete Myth [ 180 views]

AI naysayers often disparage chatGPT by dismissing it as a glorified autocomplete. Supposedly it repeatedly computes the next likely word and selects it at random based on weighted probabilities.

I don’t believe it.

Continue reading

Posted in Uncategorized | 5 Comments