Thinking about multi-paradigm programming. Why FP ...
# thinking-together
g
Thinking about multi-paradigm programming. Why FP isn't enough, IMO... https://programmingsimplicity.substack.com/p/single-paradigm-vs-multi-paradigm-d7e?r=1egdky
j
It was a little jarring to have it start off saying "people impose weird constraints on computing like insisting on functions as a base when assembly doesn't have them" and then a little while later essentially say "let's pretend that shared memory is literally impossible" "we'll consider the concurrency as only being between two machines separated by a single wire, ignoring the existence of multi-core CPUs" That seems like a weird constraint? Or maybe I'm misunderstanding. Aren't those two sections essentially at odds?
I'd be very interested to learn about non-function-based computing though. Sounds fascinating.
g
I've been trying to figure out how to answer your questions. Hope these help, let me know. I'm spiralling in, hoping to be more clear. Everyone's comments help ... https://programmingsimplicity.substack.com/p/yet-more-about-single-paradigm-and?r=1egdky, https://programmingsimplicity.substack.com/p/synchronous-execution-of-code?r=1egdky
PROLOG is a good mind-bending first example of non-function-based thinking. PROLOG uses the same Gutenberg type-setting syntax as is used in most popular programming languages, like Haskell, Rust, Python, Javascript, etc. Despite the shallow similar appearance, though, PROLOG rules are not functions-as-we-know-them. For example, PROLOG syntax allows certain actions to happen in what-look-like parameter lists.
a
This seems analog to "can programming be liberated from the von neumann style" but rather "can programming be liberated from the functional style". What's unclear to me is that programming is overall currently in a functional style. Is this more a critique of modern languages, PL academics or something else? On the notion of a base paradigm, functions may be awkward for encoding some other paradigms but I imagine they're easier to reason about rather than going back to the von neumann model for everything.
With regards to Synchronous Execution of Code, advanced compilers will not blindly implement functions as subroutines. So I wonder if this is more a critique of sequential processes/subroutines under the guise of functions.
g
Hmm, I will endeavour to explain better. In general, I believe that most people think that FP, Rust, Haskell are better than C++, Python, Javascript - AND, that the best of these languages constitutes 100% of the gamut of "programming". I think that these are just variations on the SAME theme and represent only something like 20% of "programming".
a
It's unclear to me that most people think FP is better than the standard imperative languages. I'm definitely on the functional side over imperative for most common problems that I face, but I'm still a big fan of other paradigms: logic programming, relational programming, dataflow, etc. What's interesting to me is whether or not these paradigms are easier to reason about when done through a functional lens (or at least some other substrate) rather than reasoning over them all from first principles. I may fall trap to everything-is-an-x, but it seems useful for both interoperability as well as reasoning to not have our only common denominator be hardware.