3 ms·
After 18 months of development, I am glad to announce that I finally completed the first draft of my book: Data-Oriented Programming. I wanted to thank all the
by viebel 5y ago
After 18 months of development, I am glad to announce that I finally completed the first draft of my book: Data-Oriented Programming.
I wanted to thank all the people from the Clojure community that helped me in the thinking and the writing process.
The book is my attempt to formulate the underlying principles of Clojure approach to data and illustrate how to apply them in another language.
Here are the 4 principles of Data-Oriented Programming:
1. Separate code (behaviour) from data
2. Represent data with generic data structures
3. Data is immutable
4. Separate data schema from data representation
- jabajabadu 5y agoI am strongly considering buying a copy of your book and giving data-oriented programming a go in my day job. My only hesitation is data immutability. I work in a data-intensive scientific field where we frequently use custom, mutable data structures holding massive amounts of data. Creating persistent versions of these data structures would be an extremely complex undertaking. Do you have any thoughts about using data-oriented programming in situations when data mutability is difficult to avoid?
- viebel 5y agoCould you elaborate about the complexity involved in using immutable data structures in your use case? Is that a performance concern?
- jabajabadu 5y agoThat’s right. Our data structures are designed for working with large amounts of compressed text (dynamic FM-Index is one example). They are pretty hard to implement so making a persistent version of such a data structure would require a big time commitment. I imagine that my use case is not that unique and there are many situations where mutable data structures are hard to avoid.
- viebel 5y agoIn most languages, there are libraries that provide efficient implementation of persistent data structures. What languages do you use?
- jabajabadu 5y agoI use C++ and Rust. Unfortunately, there are no persistent versions of the data structures I need available in any language (using dynamic FM-index as an example again). It is just interesting to think about “hybrid” systems where most of the code follows principles of data-oriented programming and some of the code deals with any unavoidable mutability.
- viebel 5y agoI totally agree