Interesting... thanks for this additional context. I wasn't aware of all of these.
This is a bit funny, because I realize I have frequently called the thing I am talking about "data-driven programming", which apparently is already a term for something which I see as related but different (though it does list Clojure in that article).
However, I do think there is a distinct concept from the above descriptions which encapsulates both data oriented programming as I gather you see it, as well as this particular notion of a data-oriented approach to declarative programming, as described above.
And the connection is simple: Data oriented declarative programming (if we need to be distinct about it), is specifically data oriented programming applied to declarative programming. How do you represent the "declarations"? AS DATA!
So I see this more specific application as a specific instance or subclass of the other
This is my perspective at least.
I'm curious to hear what others have to say.
And thank you for sharing views different to mine. It's been interesting (re-)evaluating how I describe and refer to these ideas.
Yeah. I have been doing lots of research over the last year to be able to “distill the essence” of data-oriented programming and how it reduces the complexity of the system we build.
In Clojure, it’s so natural that we don’t pay attention to it
My vision is to spread the word about DOP among non Clojure developers
For that, we need to make sure we (the Clojure developers) understand clearly what DOP is and how it reduces complexity
I see there are several levels at which DOP could be applied: (A) In the small, i.e. DOP at the function and fn composition level in terms of program design, (B) In libraries that encompasses a completely orthogonal concern, e.g. a data-oriented rule engine such as O’Doyle etc, web framework such as Ring etc., (C) In the large, i.e. DOP at a distributed systems scale (refer Rich Hickey’s Language of the system
talk) where he talks about Storm and Riemann.
In the “implementation context”, since pure data transformation has to be interleaved with I/O for real life programs, DOP has a dual in “Functional Core, Imperative Shell” approach (as in the “Onion Architecture”).
@kumarshantanu Would you like to add a section about applications of DOP in the Wikipedia article https://en.wikipedia.org/wiki/Draft:Data-oriented_programming ?
I will think about the content/pitch/structure.
Great
Ping me after you add your content to the draft
@metasoarous Take a look at what @didibus wrote about the various data-* paradigms
https://clojureverse.org/t/review-what-is-data-oriented-programming/6065/6?u=yehonathan_sharvit
Does what @didibus call “data-driven programming” resonate with what you had in mind?
Does anyone know In the manning book Data Orientated Programming, what language are the code snippets in?
Most of them are in JavaScript.
I am considering to add a version of the snippets for Java
Wouldyou say the book is ok for someone who doesnt have lot of experience in javascript?
As I undestand it, the concepts are language agnostic
Definitely. The concepts are language agnostic and we illustrate them with JavaScript, using only the simple parts of JavaScript (no fancy features of the language). Most snippets read as pseudo code
I am going to write a blog post that clarifies the distinction between 3 concepts that contain data in their name. • Data-oriented programming • Data-oriented design • Data-driven programming
Here is what I have for now:
Data-oriented programming is not really a new concept. It is a paradigm that is applied by developers from different programming languages. What’s new is the fact that this paradigm has an official name. The purpose of this article is to distinguish between Data-oriented programming and two other programming paradigms: Data-oriented design and Data-driven programming. > There are only two hard things in Computer Science: cache invalidation and naming things. — Phil Karlton ## Data-oriented design Data-oriented design is a program optimization approach motivated by efficient usage of the CPU cache, used mostly in video game development. The approach is to focus on the data layout, separating and sorting fields according to when they are needed, and to think about transformations of data. In this context, what’s important is how the data resides in memory. The objective of this paradigm is to improve the performance of the system. ## Data-driven programming Data-driven programming is the idea that you create domain specific languages (DSLs) which are made out of descriptive data. It is a branch of declarative programming. In this context, what’s important is to describe the behaviour of a program in terms of data. The objective of this paradigm is to increase code clarity and to reduce the risk of bugs related to mistakes in the implementation of the expected behaviour of the program. ## Data-oriented programming Data-oriented programming is a paradigm that treats the data of the system as a first-class citizen. The data is represented by generic immutable data structures (like maps and vectors) that are manipulated by general purpose functions (like map, filter, select, group-by ...). In this context, what’s important is how the representation of data by the program. The objective of this paradigm is to reduce the complexity of the system.
Feedback welcome
Welcome @merklefabian to our community
Could you tell us a bit about yourself and your interest in DOP?
Hey I just saw your talk on YouTube. I’m developing a game in Clojure and want to use DOP to accelerate my development.
DOP or DOD?
Are you interested to accelerate the time it takes to develop the game or accelerate the time it takes the CPU to render the game?
the time it takes to develop. CPU is not an issue currently
DOP will definitely help you!
Do you know of any example game projects where it was applied?
No
Ask on the channel
Do you know of any example project where DOP is applied in game development?
I'll admit I've also been using the term "data oriented programming" to describe the hybrid approach of using DDP and DOP together (as defined by @viebel above). For example, I consider the approach of such libraries like reitit
and malli
to be declarative descriptions of computation and behavior, that are taking advantage of the fact that by reusing existing generic immutable data structures can lean on all the benefits of existing Clojure tooling. So does that make them a hybrid of DDP and DOP? OTOH, something like meander
is clearly a declarative description of computation that is a more custom DSL that I would not consider transforming as easily via regular clojure data functions (so DDP, but not DOP).
Is that a fair assessment? And is there a term for something that is both DDP and DOP? (Since I find lots of Clojure code is moving in that direction - and it does have certain interesting benefits over just DDP)
Also, are computation graph libraries (e.g. plumatic/graph
, onyx
, pathom
) that use normal Clojure data structures to define computations declaratively via an EDN dependency graph (+ opaque resolving function) considered DDP/DOP/both/neither?
@merklefabian You may want to check out O’Doyle rules engine, which was originally created to develop games quite productively. O’Doyle is heavily data oriented.
And this video for a demo: https://www.youtube.com/watch?v=XONRaJJAhpA&ab_channel=sekao