Live data from Hacker News

The Repeated Deaths of OOP (2015)

loup-vaillant.fr

191–200 of 220 posts

Re: The Repeated Deaths of OOP (2015)

#191
post #189

Earlier quoted context omitted.

> generated C from its AST as the target assembly language, relying then on the C compiler's optimizer and machine-code generator. That qualifies as a preprocessor to me. You can get the sources to it, as late as 3.0.3 from 1994 here. http://www.softwarepreservation.org/projects/c_plus_plus/ind...

If "preprocessor" means anything at all, it means a program that alters incoming text according to textual rules, without analyzing language semantics. The C preprocessor operates strictly on text patterns. Likewise Ratfor. Likewise m4. Otherwise every compiler is a preprocessor, and the word is meaningless. Making words meaningless could be a way to make yourself feel important, but it does not advance understanding…

Of course, something using C as a target language can be a substantial compiler. But not everything that outputs C is in the special category of taking "C with classes" to "C without classes".

My root comment is strictly about the initial impetus and proof-of-concept implementation, not ISO C++20.

Oh look, here is a quote from Stroustrup's HOPL paper about the history of C++:

In October of 1979 I had a pre−processor, called Cpre, that added Simula−like classes to C running and in March of 1980 this pre−processor had been refined to the point where it supported one real project and several experiments.

I think, if it's okay for Stroustrup to say "preprocessor" (and even put "pre" in the thing's name), it's okay for me.

Re: The Repeated Deaths of OOP (2015)

#192
post #189

Earlier quoted context omitted.

If "preprocessor" means anything at all, it means a program that alters incoming text according to textual rules, without analyzing language semantics. The C preprocessor operates strictly on text patterns. Likewise Ratfor. Likewise m4. Otherwise every compiler is a preprocessor, and the word is meaningless. Making words meaningless could be a way to make yourself feel important, but it does not advance understanding…

Of course, something using C as a target language can be a substantial compiler. But not everything that outputs C is in the special category of taking "C with classes" to "C without classes". My root comment is strictly about the initial impetus and proof-of-concept implementation, not ISO C++20. Oh look, here is a quote from Stroustrup's HOPL paper about the history of C++: In October of 1979 I had a pre−processor,…

Terminology has stabilized, since. Cpre parsed and analyzed C-with-classes code, and synthesized C code just like any of the later compilers, and Cfront.

Re: The Repeated Deaths of OOP (2015)

#193
post #190

Earlier quoted context omitted.

Why are you so quickly assuming that you know better what I mean than I do? Could you point out a specific point in my answer that is not compatible / or contradcits with the common definition of referential transparency?

I didn’t mean to assume anything, I just wanted to note that the common definition used in FP circles is not correct. So just exchanging ref. transparency with “not having side effects” in your otherwise perfectly fine and interesting reply will make it correct — since for example Java is also referentially transparent which I guess you would not consider being a pure FP language. (Exchanging a value with a variable…

Sorry, but I find your language inappropriate.

> what you mean is simply side-effect freeness

This really makes it sound like an assumption. And:

> So just exchanging ref. transparency with “not having side effects” in your otherwise perfectly fine and interesting reply will make it correct

You implying my answer is incorrect here but you are not giving an example of what is wrong even though I asked for it.

That being said, I believe that the definition of referential transparency (and therefore FP) is not useful at all without making "semantics" a part of it. And this is the point where discussion can happen. For example, is the performance characteristics of a function part of the program semantics? I would say no. Even though it matters in practice. Same goes for logging: one can argue that logging (that can not blow up due to e.g. lack of disk space) can be considered irrelevant for program semantics and hence a function that logs something with a "print" can still be pure.

If you remove semantics from the definition then the definition becomes rather useless imho. In that case I would rather change its meaning or switch to a different definition alltogether.

Re: The Repeated Deaths of OOP (2015)

#194
post #183
post #169

Earlier quoted context omitted.

> System acts over two or more Components is very common, and looping itself is not good enough for those cases (because you get O(n^2), O(n^3), O(n^4), etc, etc complexity), so it's nowhere near as simple as that. Am I missing something? Sort your data structure and quickly loop over them? Why would you ever do things at n^4 complexity? > then it's only fair to say that OOP is also just a design pattern Yup. It is.…

> Am I missing something? Yeah. You're missing the part where I said ECS is not just looping. It's clearly also not just sorting, if you know how ECS is structured. You need either indexing, like databases, or you need to watch for changes and cache them before usage, like in SQL materialised views. If you want to keep discussing the basics of ECS I strongly suggest searching at least how it is structured, its goals,…

Perhaps I should because it seems like you simply listed ways to sort.

My understanding is any ECS implementation would always spend the time bookkeeping to prevent O(n^4) or other combinatoric explosion. Systems run every frame while entities are spawned much less often, if at all between load screens.

Nested linear searches as you suggest would also blow out any locality improvements, which made the suggestion even more confusing to me.

Unity's implementation is deeply focused on keeping component data tightly packed so systems can quickly loop over them with SIMD, or even batch them across other threads. They keep entities sorted in buckets by component list, eg entities with components A, B, and AB are grouped separately (but still as arrays of the underlying component data).

They can trivially pass organized sets of arrays to any system that may need them. No linear searching is required as the arrays of separate component data are naturally matched. If a system needs to operate on A and B, the paired arrays are ready made.

...but what do they know?

Re: The Repeated Deaths of OOP (2015)

#195
post #156

Earlier quoted context omitted.

ML modules are definitely OO

See, that's just ridiculous and shows how undefined and vague "OO" is. The only relevant feature there is encapsulation, that most languages provide in some way. How is that OO? I vote for just not using this term anymore and talk about class based langusges or prototype languages or whatever.

> The only relevant feature there is encapsulation, that most languages provide in some way. How is that OO?

PL researches seem to have no trouble finding equivalences between ML modules and OO :

https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.53...

My personal opinion which tries to be as general as possible to encompass most definitions is that OO just means that semantic entities can bind a set of named values with a set of named operations / functions / methods / whatever you call them.

    struct foo {
      int bar;
      void (*compute)(int x, int y); 
    };
is also OO.

Re: The Repeated Deaths of OOP (2015)

#196
post #190

Earlier quoted context omitted.

I didn’t mean to assume anything, I just wanted to note that the common definition used in FP circles is not correct. So just exchanging ref. transparency with “not having side effects” in your otherwise perfectly fine and interesting reply will make it correct — since for example Java is also referentially transparent which I guess you would not consider being a pure FP language. (Exchanging a value with a variable…

Sorry, but I find your language inappropriate. > what you mean is simply side-effect freeness This really makes it sound like an assumption. And: > So just exchanging ref. transparency with “not having side effects” in your otherwise perfectly fine and interesting reply will make it correct You implying my answer is incorrect here but you are not giving an example of what is wrong even though I asked for it. That bei…

I didn't want to repeat myself as the exact meaning was debated in two threads in this post already, for more details please have a look at them.

And I agree, we do have to specify what is the denotation of an expression that shall remain constant after replacing a sub-expression with that part's denotation -- for example choosing value of expression after evaluation is not too interesting, as it is shared by the majority of languages, and can only be "violated" by macros for example. Choosing the denotation as "value and side-effects" doesn't add much over saying simply that the language is pure and as you also note, purity has different levels.

Re: The Repeated Deaths of OOP (2015)

#197
post #177

Earlier quoted context omitted.

I've seen a couple of his talks and read some of his comments here and elsewhere. I've never seen any territorial claims, quite the opposite. Can you give me an example?

Kay has promoted many different definitions of "object-oriented", over the years, and many disjoint variations on Smalltalk's early history. It is probably best to stick to the very oldest interviews if you care to learn the real history.

I don't come here to bicker, but I would like to see an example of a "territorial claim" you mentioned. For now it seems that when questioned about specific examples to your claims, you revert to some more unrelated claims.

Re: The Repeated Deaths of OOP (2015)

#198
post #196

Earlier quoted context omitted.

Sorry, but I find your language inappropriate. > what you mean is simply side-effect freeness This really makes it sound like an assumption. And: > So just exchanging ref. transparency with “not having side effects” in your otherwise perfectly fine and interesting reply will make it correct You implying my answer is incorrect here but you are not giving an example of what is wrong even though I asked for it. That bei…

I didn't want to repeat myself as the exact meaning was debated in two threads in this post already, for more details please have a look at them. And I agree, we do have to specify what is the denotation of an expression that shall remain constant after replacing a sub-expression with that part's denotation -- for example choosing value of expression after evaluation is not too interesting, as it is shared by the maj…

If you do not point out any contradictions even after being asked twice then I have to conclude that you simply cannot. You could have also referred specifically or quoted the important lines from the other threads, but you did neither. That's not helpful in a discussion.

> Choosing the denotation as "value and side-effects" doesn't add much over saying simply that the language is pure

You are aware that, regarding the discussion between us two, it was you and not me who even used the term "side-effect" first, right?

Re: The Repeated Deaths of OOP (2015)

#199
post #21
post #9

> Enough with the ECS advocacy however. Entity/component/system sounds like model/view/controller. But I like to think of data/logic/presentation. The point being that keeping these dimensions orthogonal is more imoprtant than how they are labeled.

> Entity/component/system sounds like model/view/controller. Maybe to someone who has no idea what ECS is. ECS is not three things named "entity", "component" and "system". Instead you have entities separated into components which are transformed by one or more systems that operate on all of them in bulk. There's literally no overlap between ECS and MVC. > But I like to think of data/logic/presentation. It's OK to th…

> model: data+logic

My point regarding orthogonality is that lif is better when the state is pure. Just the database table and its rows.

The logic functions operating on that state are better kept to map, filter, and fold as much as possible.

Re: The Repeated Deaths of OOP (2015)

#200
post #171
post #138

Earlier quoted context omitted.

Well, give it a go! Or alternatively, look for languages that have been successful in enforcing any kind of purity and that also permit unrestricted use of higher order functions.

It's very hard to make Haskell look attractive to me, I deal with open systems (i.e. systems which interact with many other heterogenous systems which evolve in time), and Haskell is optimized for precisely the opposite case (a walled garden built out of elaborate types for verifying correctness). Haskell is the weird introvert guy in an extrovert world.

Interesting - for me it is the opposite. Non-functional languages usually work better if there is no concurrency involved. And 3rd party systems always introduce a certain amount of concurrency, sometimes more, sometimes less.

I would say pure FP languages such as Haskell are actually the best for such a case. Because in these languages the order/timing of lines of code are decoupled from the execution order/timing.

Post reply on HN