Posts

Showing posts from 2024

Why the struggle with functional programming?

Slow FP adoption... Why no widespread adoption even though functional programming exists already now for over sixty years? Not so long ago I explained this as: The reason is actually pretty complicated: The strength of FP is much due to its ability to be very strong. This strength in the code weakens the ability of developers to make local changes. Initially, this sounds like something good, yet it creates a new challenge: developers are bound to the constraints of code written by others, and they are not only not happy, they are less productive! You can solve this by bringing your FP to the next level: math. A few companies do this, now a developer is not subject to constraints but to mathematics. If the developer understands the math she/he finds this acceptable. I am simplifying things a bit here, yet FP, or any language that is strong enough, brings in a whole complexity of technical ownership and people dynamics that does not need to be dealt with with OO. The realit...

A software mind's eye

I have been writing higher-order functional programming in Python for the last few weekends: hofppy ( https://github.com/equational/hofppy ) will be a Python library. For the moment it is a collection of Jupyter notebooks. My initial goal was to have a handy FP toolkit which supports applied math with JAX's JIT. Yet I realise that in fact what I am really doing is reimplementing the generic part of a compiler for a reactive (trading) language I wrote in 2010 in F#, while including a few tricks I picked up since then, the primary one being to think of code as implementing a synchronous execution model. There is really very little code like this on the web, therefore why I am doing this open source. This blog is in part written to mention the above, as already the first JAX JIT supporting monad and comonad models are "nice". Yet this blog is also to bring up the subject of the process of creating new technology. My recipe to do something new, such as lead a team on a new su...