News for hackers. Stuff that matters.
Re:Ask HN: Data-Oriented programming vs. Functional programming by amboo7 on Friday March 12, 2021 @08:38AM (#26435662)
How about trying to define both first? I am not sure what data-oriented means.
Re:Ask HN: Data-Oriented programming vs. Functional programming by eternalban on Friday March 12, 2021 @09:17AM (#26436046)
He's defined that elsewhere in a book he just wrote for Manning. What is mildly annoying is that he is not really asking HN for advice here. He is pimping his book.
Re:Ask HN: Data-Oriented programming vs. Functional programming by viebel on Friday March 12, 2021 @09:24AM (#26436111)
My purpose here is not to promote the book but to learn from FP experts what they think about the relevance of DOP approach to FP languages.
Re:Ask HN: Data-Oriented programming vs. Functional programming by eternalban on Friday March 12, 2021 @09:45AM (#26436314)
Wouldn't it be more honest to actually put that in your message and make it a "Show HN"? "I have a book on DoD and am looking for critical feedback from FP experts".

p.s. given that I strongly disagree with your definitions of DO and FP.

DOD/P: Data oriented design and programming is structuring code in light of form, size, access patterns of data. Efficient access and ops on domain specific data is the name of the game. Strictly speaking, this is an optimization approach and not a genuine general programming paradigm. In sum: organize your data layout to maximize efficient processing suited to your application. (DB analog: 1st normal form is DoD. 5th normal form is anti-DOD.)

FP: true to its mathematical origins, FP is mainly about transformation of data via a methematical treatment. Arguably, algorithms are far more central to FP than data. A significant manifestation of this fact is the existence of "lazy" and "strict" evaluation in FP runtimes which flies in the face of the primary concerns of Data Oriented Programming (which came from gaming). FP in no way addresses memory layout as a primary concern. FP is a conceptual general purpose paradigm.

Re:Ask HN: Data-Oriented programming vs. Functional programming by viebel on Friday March 12, 2021 @10:03AM (#26436513)
Please, don't confuse DoD and DoP
Re:Ask HN: Data-Oriented programming vs. Functional programming by mercer on Friday March 12, 2021 @11:53AM (#26437798)
I feel you're making a distinction that some people decided to make, but that is not really widely shared by others to warrant imposing it.

I see you also posted two differently-titled links to your "Data Oriented Programming" book last month. That does make it feel a bit like you're submarining your book with an 'Ask HN'.

My apologies if I sound negative. On a more positive note: perhaps write a good blog post about this, and perhaps the core of what your book is about? I imagine that would be much more appreciated than just a low effort link to the book or "Ask HN".

Re:Ask HN: Data-Oriented programming vs. Functional programming by viebel on Friday March 12, 2021 @08:58AM (#26435850)
Data-oriented programming is about representing data with immutable generic data structures (e.g. maps and lists) and manipulating data with general purpose functions
Re:Ask HN: Data-Oriented programming vs. Functional programming by hctaw on Friday March 12, 2021 @09:50AM (#26436369)
That's no definition of DO I've ever heard. A list is a classic example of a non-data oriented structure!

DO as I understand it is about recognizing how data is actually laid out and interacted with by a processor, as opposed to meaningful abstract relationships to a programmer. It's about breaking down costly abstractions, rather than ignoring the cost of higher level abstractions.

DO exists primarily in opposition to OO, not FP. The classic example is the array of structs to struct of arrays (OO to DO transformation).

Re:Ask HN: Data-Oriented programming vs. Functional programming by viebel on Friday March 12, 2021 @10:00AM (#26436475)
You are referring to Data-Oriented design, while I am referring to Data-Oriented programming

https://blog.klipse.tech/visualization/2021/02/16/data-relat...

Re:Ask HN: Data-Oriented programming vs. Functional programming by karmakaze on Friday March 12, 2021 @10:30AM (#26436833)
Useful:

> Data-oriented design => Increase performance via Data layout

> Data-driven programming => Increase clarity via Behaviour described by data

> Data-oriented programming => via Reduce complexity via Data representation

Re:Ask HN: Data-Oriented programming vs. Functional programming by hctaw on Friday March 12, 2021 @10:06AM (#26436559)
Perhaps pick a better name that isn't confusing. In industry what your definition refers to is called "generic programming" if I understand correctly.
Re:Ask HN: Data-Oriented programming vs. Functional programming by viebel on Friday March 12, 2021 @10:16AM (#26436670)
I didn't choose the term "Data-Oriented programming" It was used by Cognitect folks to promote clojure [1] and actually it was coined by Eugene Kutznetsov in 2004 [2]

As you know, naming is one of the two hard things in programming.

[1]: https://www.cognitect.com/blog/2016/6/28/the-new-normal-data... [2]: https://adtmag.com/articles/2004/08/05/data-integration-a-li...