Live data from Hacker News

Type resolution redesign, with language changes to taste

ziglang.org

271–280 of 284 posts

Re: Type resolution redesign, with language changes to taste

#271
post #268
post #260

Earlier quoted context omitted.

> You omitted Smalltalk. Exactly. It isn't functional. It doesn't use functions. It uses message passing instead. That is exactly why the term "object-oriented" was originally coined for Smalltalk. It didn't fit within the use of "imperative" and "functional" that preceded it. > But that kinda ruins the common ground thesis. That is the thesis: That Smalltalk is neither imperative nor functional. That is why it was g…

> That is exactly why the term "object-oriented" was originally coined for Smalltalk. Sure but your definition doesn't cover it. If language for which the term was coined, it's a bit meaningless, ain't it. Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C. I can see them being necessary but not eno…

> Sure but your definition doesn't cover it.

How does it not cover it?

> Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C.

Polymorphism? That was never mentioned. Let me reiterate the definitions:

- Imperative: Plain functions (C, Fortran, Pascal).

- Functional: Functions with encapsulation (C++, Java, Haskell, Erlang).

- Object-oriented: Message passing (Smalltalk, Objective-C, Ruby, Erlang).

Let me also reiterate that there are other axis of concerns. Imperative, functional, and object-oriented are not trying to categorize every last feature a programming language might have. Mutable/immutable, or polymorphic/monomorphic, etc. are others concern and can be independently labeled as such.

> Perhaps, but broadly speaking people agree that C++ and Java are OOP

Many do, but just as many hold on to the original definition. Try as you might, you're not going to find a common definition here, I'm afraid. If you want to use the term effectively, you're going to have to explicitly define it each time.

Re: Type resolution redesign, with language changes to taste

#272
post #237

Earlier quoted context omitted.

Absolutely. That's why it is best to stick to the already established definitions. Kay was quite explicit about what "object-oriented" meant when the term was uttered for the first time; including specifically calling out C++ as not being object-oriented. And yes, we all know the rest of the story about how the C++ guys were butthurt by that callout and have been on a mission to make up their own pet definition that…

Don't you think it's a bit silly to keep rehashing tribalistic arguments that people moved on from 40 years ago?

Once someone offers up the replacement name so that we can continue to talk about what "object-oriented" referred to 40 years ago — and still refers to today, sure. Nobody cares about the exact letters and sounds.

But, until then, no. It is still something we regularly talk about. It needs a name. And lucky for us it already has one — and has had one for 40 years.

Re: Type resolution redesign, with language changes to taste

#273
post #271
post #268

Earlier quoted context omitted.

> That is exactly why the term "object-oriented" was originally coined for Smalltalk. Sure but your definition doesn't cover it. If language for which the term was coined, it's a bit meaningless, ain't it. Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C. I can see them being necessary but not eno…

> Sure but your definition doesn't cover it. How does it not cover it? > Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C. Polymorphism? That was never mentioned. Let me reiterate the definitions: - Imperative: Plain functions (C, Fortran, Pascal). - Functional: Functions with encapsulation (C++,…

> Polymorphism? That was never mentioned. Let me reiterate the definitions

Sigh. Look at what started this whole discussion.

     > pjmlp: Plenty of OOP architectures can be implemented 1:1 in Rust type system.
It's pjmlp's insistence that Rust is object-oriented.

I'm fine with object-oriented meaning message passing.

I'm fine with object-oriented being used to describe inheritance based langs Java/C#/C++.

But where that fails miserably is when you try implementing inheritance based stuff like DOM in Rust.

You can't have your cake (all capabilities of OOP) and also eat it too (also most of them missing).

Rust was never about inheritance hierarchies or message passing.

It's just structs with privacy modifiers. And functions that are applied to them.

Re: Type resolution redesign, with language changes to taste

#275
post #273
post #271

Earlier quoted context omitted.

> Sure but your definition doesn't cover it. How does it not cover it? > Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C. Polymorphism? That was never mentioned. Let me reiterate the definitions: - Imperative: Plain functions (C, Fortran, Pascal). - Functional: Functions with encapsulation (C++,…

> Polymorphism? That was never mentioned. Let me reiterate the definitions Sigh. Look at what started this whole discussion. > pjmlp: Plenty of OOP architectures can be implemented 1:1 in Rust type system. It's pjmlp's insistence that Rust is object-oriented. I'm fine with object-oriented meaning message passing. I'm fine with object-oriented being used to describe inheritance based langs Java/C#/C++. But where that…

> Look at what started this whole discussion.

If you are pointing out that there is no consistent definition for OOP, I agree. I've said so multiple times. Yes, the proof is in the pudding, as they say.

It is not clear where you think that might otherwise fit into our discussion? I, to the best of my ability, spelled out the historical definitions that we are talking about so that we had a shared understanding. What someone else may have defined the same words as is irrelevant.

I think we can agree that these dividing lines aren't even useful, but the history behind them is understandable. In the beginning there was imperative programming, named to differentiate from unstructured programming. Then came encapsulation, which didn't fit under imperative, so they named it functional to separate it from imperative. But then came Smalltalk, and it recognized that it doesn't fit under imperative or functional, so it gave itself the name "object-oriented".

If we could go back in time we'd realize that none of these names bring any significance [hence why there is no consistent definition] and throw them away. But we cannot go back in time. We could recognize today that they are just a historical curiosity and throw them away now, but it seems there is too much emotional attachment to them at this point.

So, if you want to use them to satisfy your emotional desires, you can! But you need to also explicitly define them each time so that the reader/listener understands what you mean by it. Failure to do so means they will pick their own pet definition, and then you will talk past each other. There is no commonality found around these terms because, again, any definition you choose (pjmlp's, mine, yours, anyone's) none of them convey any truly useful information, so any definition offered is never retained by anyone else.

> It's pjmlp's insistence that Rust is object-oriented.

It is, for some definition of object-oriented. But this perfectly highlights how there isn't useful information to be found in the use of the term. Even if we all agreed on what object-oriented means, what would you learn from it? Nothing, is what. It was a pointless statement and we can accept it as such.

Re: Type resolution redesign, with language changes to taste

#276
post #275
post #273

Earlier quoted context omitted.

> Polymorphism? That was never mentioned. Let me reiterate the definitions Sigh. Look at what started this whole discussion. > pjmlp: Plenty of OOP architectures can be implemented 1:1 in Rust type system. It's pjmlp's insistence that Rust is object-oriented. I'm fine with object-oriented meaning message passing. I'm fine with object-oriented being used to describe inheritance based langs Java/C#/C++. But where that…

> Look at what started this whole discussion. If you are pointing out that there is no consistent definition for OOP, I agree. I've said so multiple times. Yes, the proof is in the pudding, as they say. It is not clear where you think that might otherwise fit into our discussion? I, to the best of my ability, spelled out the historical definitions that we are talking about so that we had a shared understanding. What…

> It is, for some definition of object-oriented.

Sure, for some definition of red, green is red. E.g., colorblind people. I'm interested in more broadly accepted jargon.

The problem is, Rust isn't really object-oriented either. I'm interested in a mostly consistent and hopefully majority definition.

It's not message-passing sense (can't do cool fancy things* a la Ruby or Smalltalk); nor is it inheritance-based (can't do inheritance-based nor prototype-based OOP patterns).

There is one more mathematical definition of whether two features are equal, but it involves languages, local macros, and Turing machines. See https://www.youtube.com/watch?v=43XaZEn2aLc

* There was some kind of message recorder and playback in Ruby/Smalltalk, that I can't find. Basically send methods to objects and record them, then playback them at later date. Will update if I find it.

Re: Type resolution redesign, with language changes to taste

#277
post #276
post #275

Earlier quoted context omitted.

> Look at what started this whole discussion. If you are pointing out that there is no consistent definition for OOP, I agree. I've said so multiple times. Yes, the proof is in the pudding, as they say. It is not clear where you think that might otherwise fit into our discussion? I, to the best of my ability, spelled out the historical definitions that we are talking about so that we had a shared understanding. What…

> It is, for some definition of object-oriented. Sure, for some definition of red, green is red. E.g., colorblind people. I'm interested in more broadly accepted jargon. The problem is, Rust isn't really object-oriented either. I'm interested in a mostly consistent and hopefully majority definition. It's not message-passing sense (can't do cool fancy things* a la Ruby or Smalltalk); nor is it inheritance-based (can't…

> The problem is, Rust isn't really object-oriented either. I'm interested in a mostly consistent and hopefully majority definition.

May I suggest "programming language"? I think you will find that most everyone agrees that Rust is a programming language.

In context, it's functional, but I think you rejecting that historical definition means that you agree with me that the attempt at categorization here doesn't provide any useful information. So, the question here is: What specific information is it that you think is failing to be effectively communicated?

If I take a walk down the street and tell the first guy I meet, "Hey, Rust is a programming language", what information did he miss out on that you find critical?

When we establish that, we might find out there is already a widely recognized term. You won't find it in "object-oriented", however. It has never been used in a context where the information was useful. Even the original message passing definition was never useful as you always had to explain what message passing is at the same time anyway, negating the value of a single word to use as a shorthand.

Words are not given to us naturally by the universe. They are a human invention. Consistent definitions for words only become accepted consistently when those humans find utility in adopting something consistent. "If you build it, they will come" only works in movies.

Re: Type resolution redesign, with language changes to taste

#278
post #264

Earlier quoted context omitted.

I can't see anything in OP's post where he says any of that. Everything you said seems like an incredibly ungenerous reading of what he wrote. Zig is a systems programming language. Moving from Python to Zig is a step down the tech stack, which brings with it exposure to underlying concepts and limitations that matter when writing any software, and which is especially valuable for a self-taught dev.

He wrote an XML parsing stack on hours instead of doing his job because doing it was, and I quote, "yawn".

Where did he say he did it in work hours? Or that he did it instead of doing his job?

He used the word "yawn" to describe using a popular library without understanding the underlying architecture, not in reference to doing his job.

Honestly, I can't even see a tenuous connection between what you're claiming and what was said in the post. The man is expressing joy about learning new things, and you're... upset about this? For some reason? Weird.

Re: Type resolution redesign, with language changes to taste

#279
post #277
post #276

Earlier quoted context omitted.

> It is, for some definition of object-oriented. Sure, for some definition of red, green is red. E.g., colorblind people. I'm interested in more broadly accepted jargon. The problem is, Rust isn't really object-oriented either. I'm interested in a mostly consistent and hopefully majority definition. It's not message-passing sense (can't do cool fancy things* a la Ruby or Smalltalk); nor is it inheritance-based (can't…

> The problem is, Rust isn't really object-oriented either. I'm interested in a mostly consistent and hopefully majority definition. May I suggest "programming language"? I think you will find that most everyone agrees that Rust is a programming language. In context, it's functional, but I think you rejecting that historical definition means that you agree with me that the attempt at categorization here doesn't provi…

> So, the question here is: What specific information is it that you think is failing to be effectively communicated?

Expressivity. As the video I linked before shows, there is a quantifiable and objective difference between a language that has exceptions and one that doesn't. Or lambda's or async.

What terms like "message passing" and "inheritance-based" capture is unique ability of each language to do something novel* other languages can't. Rust as of now lacks such capabilities, although it can probably simulate them to some extent.

*For message passing, it's the method record and replayer. For inheritance-based it can be something like easy DOM manipulation.

Re: Type resolution redesign, with language changes to taste

#280
post #269
post #268

Earlier quoted context omitted.

> That is exactly why the term "object-oriented" was originally coined for Smalltalk. Sure but your definition doesn't cover it. If language for which the term was coined, it's a bit meaningless, ain't it. Problem with making encapsulation and polymorphism essential to OOP definition, is that it then starts garbling up functional languages like Haskell and imperative like C. I can see them being necessary but not eno…

Fruit = { Apple, Cucumber, … } Veg = { Cucumber, … } Fruit As In = Fruit − Veg

Culinary they are separate. But fruit can refer to anything that develops from a pollinated flower. Including cucumber and strawberry.
Post reply on HN