You are viewing archived messages.
Go here to search the history.

Christopher Shank 2022-12-23 17:48:02

“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.

info.ucl.ac.be/~pvr/VanRoyChapter.pdf

Christopher Shank 2022-12-23 17:48:27

More is not better (or worse) than less, just different.

– The paradigm paradox.

Christopher Shank 2022-12-23 17:51:24

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.

Christopher Shank 2022-12-23 17:52:04
Christopher Shank 2022-12-23 17:52:26
Jack Rusher 2022-12-23 17:55:51

Concepts, Techniques, and Models of Computer Programming is well worth anyone's time.

Christopher Shank 2022-12-23 18:41:07

Ooh thanks for the rec!

Christopher Shank 2022-12-23 18:41:26

oh gosh it’s 900+ pages 🥲

Duncan Cragg 2022-12-23 19:31:29

A couple of times in the past I've tried and failed to find the place in this diagram ("Figure 2") for my own language.

Anyone else have this problem? 😮

Konrad Hinsen 2022-12-23 19:44:31

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.

Duncan Cragg 2022-12-23 20:07:05

Right: mine is akin to term rewriting

Duncan Cragg 2022-12-23 20:08:17

Although for me they needn't be TC, cos they transform persistent state

Duncan Cragg 2022-12-23 20:08:39

So have to terminate for one thing!

Konrad Hinsen 2022-12-24 09:32:45

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 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.

Duncan Cragg 2022-12-24 14:18:30

"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.

"

Duncan Cragg 2022-12-24 14:19:02

I asked ChatGPT 😃😃

Duncan Cragg 2022-12-24 14:22:24

Actually isn't Clean one?

Konrad Hinsen 2022-12-25 08:38:08

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.

"Wolfram language" is just the new name for Mathematica. Which is by now more than a computer algebra system, but I am not sure I'd call it a programming language. It's in an interesting grey zone (which I'd love to see more of).

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.

Konrad Hinsen 2022-12-26 07:58:48

Thanks for the reminder Duncan Cragg. I just added my project (last column for now).