Glider from the game of Life, rising from the left

Unity

Archives

Blogroll

Topic: #models-of-computation

The Sieve of Eratosthenes, Imperatively and Functionally

2018-09-20⊺09:32:06-05:00

An advocate of functional programming walks through several implementations of the Sieve of Eratosthenes. The first is a typical implementation using the imperative model of computation, but the rest use higher-order functions and other apparatus of the functional model with varying degrees of success.

I enjoyed reading through the various approaches and thinking about their strengths and weaknesses, but it was a little surprising to see that, even though all of his implementations were written in Java, he never considered any implementation that used the object-oriented model of computation in any significant way.

“The Functional Style — Part 4: First-Class Functions II: Filter, Reduce and More”
Richard Wild, Codurance: Craft at Heart, September 19, 2018
https://codurance.com/2018/09/19/the-functional-style-part-4

#functional-programming #models-of-computation

Hashtag index

This work is licensed under a Creative Commons Attribution-ShareAlike License.

Atom feed

John David Stone (havgl@unity.homelinux.net)

created June 1, 2014 · last revised December 10, 2018