“Programming Paradigms for Dummies: What Every Pro...
# reading-together
c
“Programming Paradigms for Dummies: What Every Programmer Should Know” by Peter Van Roy (2012)
This chapter gives an introduction to all the main programming paradigms, their un- derlying concepts, and the relationships between them. We give a broad view to help programmers choose the right concepts they need to solve the problems at hand. We give a taxonomy of almost 30 useful programming paradigms and how they are related. Most of them differ only in one or a few concepts, but this can make a world of difference in programming. We explain briefly how programming paradigms influence language design, and we show two sweet spots: dual-paradigm languages and a definitive lan- guage. We introduce the main concepts of programming languages: records, closures, independence (concurrency), and named state. We explain the main principles of data abstraction and how it lets us organize large programs. Finally, we conclude by focus- ing on concurrency, which is widely considered the hardest concept to program with. We present four little-known but important paradigms that greatly simplify concurrent programming with respect to mainstream languages: declarative concurrency (both ea- ger and lazy), functional reactive programming, discrete synchronous programming, and constraint programming. These paradigms have no race conditions and can be used in cases where no other paradigm works. We explain why for multi-core processors and we give several examples from computer music, which often uses these paradigms.
https://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf
More is not better (or worse) than less, just different.
– The paradigm paradox.
I think this paper is a fascinating read. I like the way it frames programming paradigms. I like the emphasis that turning completeness isn’t much of a differentiator for programing languages anymore, but rather it’s how a PL brings multiple paradigms into a coherent vision.
j
Concepts, Techniques, and Models of Computer Programming is well worth anyone's time.
c
Ooh thanks for the rec!
oh gosh 900+ pages 🥲
d
A couple of times in the past I've tried and failed to find the place in this diagram for my own language. Anyone else have this problem? 😮
k
Me too. Term rewriting is not in the diagram, whose entry point into Turing completeness is labelled “procedures”. But it’s a good book nevertheless.
d
Right: mine is akin to term rewriting
Although for me they needn't be TC, cos they transform persistent state
So have to terminate for one thing!
k
I have always wondered about the relation that PL people have with term rewriting. They know it, they refer to it, they use it in tools, but they don't seem to consider it a foundation for PLs. I am aware of exactly one PL based on term rewriting: Pure https://agraef.github.io/pure-lang/. On the other hand, there are plenty of systems based on term rewriting that are PLs without programming being their main purpose. Computer algebra systems, for example.
d
Sure, here is a list of general-purpose programming languages that make use of term rewriting: Maude: Maude is a high-performance, reflective, executable specification language that supports both equational and rewriting logic. It is based on the idea of term rewriting and is used for specifying and prototyping systems, as well as for verification and validation of software. Pure: Pure is a functional programming language that is based on term rewriting. It is a high-level, concise, and expressive language that is designed for rapid prototyping and development of numerical and symbolic computing applications. Pure is implemented in C and uses term rewriting to implement its functional language features, including pattern matching, anonymous functions, and higher-order functions. Redex: Redex is a domain-specific language for specifying reduction semantics of programming languages. It is based on term rewriting and is used to specify the operational semantics of programming languages, as well as to reason about the properties of programs written in those languages.
I asked ChatGPT 😃😃
Actually isn't Clean one?
k
Interesting, thanks! Wikipedia is still more useful than ChatGPT 🙂 Maude and its ancestor OBJ are in the same category as computer algebra system in my opinion: Turing-complete languages that are not practically useful for programming. I have actually used Maude quite a bit as I my original idea was to turn Maude into a digital scientific notation, rather than invent my own. But Maude is a closed universe: you cannot interface to code nor data that is not a Maude module. I don't know much about the other languages listed on Wikipedia. I have heard of Clean and Refal, but just enough to recognize the names.
d
What's your language/project, @Konrad Hinsen? You're not in the spreadsheet! https://docs.google.com/spreadsheets/d/12sTu7RT-s_QlAupY1v-3DfI1Mm9NEX5YMWWTDAKHLfc/edit#gid=0
k
Thanks for the reminder @Duncan Cragg. I just added my project (last column for now).
d
I've done minor formatting and moved it over to its proper column! (team size, then project age)
I think you could do with some more Bret Victoresque live examples!!
k
That’s on my to-do list. But… that oist is getting longer rather than shorter 😒