News for hackers. Stuff that matters.
Re:Functional programming is finally going mainstream by naasking on Tuesday July 12, 2022 @08:09PM (#32077460)
> At some level of software complexity, programmers MUST start to organize data into composite objects.

I don't understand this point. All functional programming languages have algebraic data types and records, which are composite types. If this is not a "composite object", you'll have to clarify what you mean.

> Copying memory around to enable to facilitate these immutable structures is SLOW.

Slower than what and in what context? Append-only logs in relational databases are immutable data structures, and they enable multiversion concurrency control, which is faster and more scalable than locking when there's lots of contention.

Unqualified claims like "immutable data structures are slow" is just wrong.

Re:Functional programming is finally going mainstream by Izkata on Tuesday July 12, 2022 @11:38PM (#32078787)
> I don't understand this point. All functional programming languages have algebraic data types and records, which are composite types. If this is not a "composite object", you'll have to clarify what you mean.

I think they meant data structures, not data types. Things like lists of records that each contain further records.

Re:Functional programming is finally going mainstream by naasking on Wednesday July 13, 2022 @12:26AM (#32079038)
Data types like records and algebraic types are data structures. Here's an algebraic type for polymorphic lists:

    type 'a list = Nil | Cons of 'a
Re:Functional programming is finally going mainstream by deltaonenine on Wednesday July 13, 2022 @04:02AM (#32080085)
You and the other person don't understand.

All data structures have types. EVEN lists of records that each contain further records. A type or a data structure is an orthogonal concept to FP, because types exist in imperative programming and data structures also exist in FP.

Re:Functional programming is finally going mainstream by gurjeet on Tuesday July 12, 2022 @10:58PM (#32078562)
Note: the log (aka write-ahead-log) in Postgres, and its ilk, enables the D(urability) of ACID. MVCC in Postgres is implemented by storing the visibility info of each row in the row-header (search: xmin, xmax).

Some commercial RDBMSs do use their logs for MVCC, though.

Re:Functional programming is finally going mainstream by jayd16 on Tuesday July 12, 2022 @10:28PM (#32078379)
Why have immutable data structures not taken over in the general case if it's a strict improvement? Sometimes they're good and sometimes there not. The issue is functional programming needs them to be used in every case.

Personally I'm of the opinion that purity is impossible so if a paradigm needs purity it's going to be an uphill battle.

Re:Functional programming is finally going mainstream by christophilus on Tuesday July 12, 2022 @10:45PM (#32078485)
FP doesn’t require their use in every case. For example, Clojure allows mutation as an optimization. But for the normal path, immutable data structures are just fine and help avoid a whole host of bugs.
Re:Functional programming is finally going mainstream by yencabulator on Wednesday July 13, 2022 @01:39PM (#32086106)
I'd argue that means Clojure lets you use paradigms other than FP. FP is still FP.