Simon Willison’s Weblog

Subscribe
Atom feed for functional-programming

6 items tagged “functional-programming”

2024

Statically Typed Functional Programming with Python 3.12 (via) Oskar Wickström builds a simple expression evaluator that demonstrates some new patterns enabled by Python 3.12, incorporating the match operator, generic types and type aliases.

# 26th May 2024, 8:12 am / functional-programming, python

2023

On Endings: Why & How We Retired Elm at Culture Amp (via) Culture Amp made extensive use of Elm—a ML-like functional language that compiles to JavaScript—between 2016 and 2020 while building their company’s frontend. They eventually decided to move away from it, for reasons described at length in this post primarily relating to its integration with React. This piece is worth reading mainly as a thoughtful approach to engineering management challenge of deprecating a well-loved piece of technology from the recommended stack at a company.

# 10th April 2023, 2:11 am / functional-programming, react, management, javascript, kevinyank

2020

Better Python Object Serialization. TIL about functions.singledispatch, a decorator which makes it easy to create Python functions with implementations that vary based on the type of their arguments and which can have additional implementations registered after the fact—great for things like custom JSON serialization.

# 7th January 2020, 8:35 pm / functional-programming, json, python, serialization

2011

There is plenty of evidence in the ecosystem to support the hypothesis that, if given the tools to do so easily, object-oriented programmers are ready to embrace functional techniques (such as immutability) and work them into an object-oriented view of the world, and will write better, less error-prone code as a result. Simply put, we believe the best thing we can do for Java developers is to give them a gentle push towards a more functional style of programming.

Brian Goetz

# 19th August 2011, 12:20 pm / functional-programming, java, recovered

2008

php: rfc: closures (via) I never thought I’d see the day, but a patch adding closures to PHP has been both proposed and accepted! Looks like a solid implementation—the syntax is similar to JavaScript but makes explicit which variables are to be captured. As with much of PHP, values are copied in to the closure by default but you can use an ampersand to specify JavaScript-style pass-by-reference instead.

# 19th July 2008, 10:58 pm / closures, php, functional-programming, javascript

2003

In praise of functional programming

Via Joe Gregorio, Functional programming in Python Part 1 and Part 2. I’m reading Structure and Interpretation of Computer Programs at the moment (available for free online, but I’ve got a library copy) and it has been getting me seriously interested in the functional programming paradigm. It’s also by far the most enlightening (in terms of “wow, that really makes sense”) computer science text book I’ve ever read. There’s something naturally elegant about the functional style, probably thanks to the encapsulation encouraged by the lack of global variables and the extensive use of recursion in functional code examples. It’s definitely true that exposure to a variety of programming styles encourages you to think about problems in different ways.