Live data from Hacker News

Closing this as we are no longer pursuing Swift adoption

github.com

301–310 of 332 posts

Re: Closing this as we are no longer pursuing Swift adoption

#301
post #299

Earlier quoted context omitted.

Ok, I've now read through the rest of this thread and I think I understand where you're coming from, but I also think you're making my point for me. You're using a definition of OOP where only Smalltalk-style message passing counts. By that definition, you're right: Swift is closer, because `@objc` exists. But by that definition, neither Swift nor Rust is an OOP language in any meaningful sense, and the delta between…

> When C++ developers say "OOP" they mean classes, inheritance hierarchies, virtual methods. Okay, but for that to be true in this case then you must explain how Swift has "better OOP support". If there is no rational explanation for now Swift has "better OOP support" by the metrics you are imagining, as you, me, and everyone else has alluded to earlier, then clearly that isn't what they meant. > I get the logic chai…

> Okay, but for that to be true in this case then you must explain how Swift has "better OOP support" by that token.

I did. Swift has `class` types with implementation inheritance. Rust does not. If you're porting a C++ codebase with deep class hierarchies (like, say, a browser DOM), Swift lets you transliterate those hierarchies directly. Rust makes you rethink them into composition and traits. That's a real difference that matters to a team mid-migration, and it's an extremely rational explanation for why a C++ dev would say Swift has "strictly better OOP support."

You don't have to agree it's a large difference (I don't, which was my original point), but "there is no rational explanation" just isn't true. There's a very obvious one, it's just boring.

> If there is no rational explanation, as you, me, and everyone else has alluded to earlier, then clearly that isn't what they meant.

My position was never "there is no rational explanation." My position was "the difference is small enough that 'strictly better' was a weird thing to say." Those are different claims! You're kind of merging me into your argument when we don't actually agree.

> Won't help communicate with anyone else meaning that you are the only one capable of understanding the logic chain?

No, I meant that if you say "C++ is a functional programming language" to mass, any working programmer, they will not understand you, because that is not what those words mean to them. It's not about intelligence, it's about shared vocabulary. You've built a internally-consistent taxonomy where functional = data + functions, OOP = data + message passing, and imperative = data and functions separate. I can follow it fine. But you've redefined three terms that already have widespread, different meanings, and then you're treating disagreement as confusion. That's the communication problem.

Re: Closing this as we are no longer pursuing Swift adoption

#302
post #299

Earlier quoted context omitted.

> When C++ developers say "OOP" they mean classes, inheritance hierarchies, virtual methods. Okay, but for that to be true in this case then you must explain how Swift has "better OOP support". If there is no rational explanation for now Swift has "better OOP support" by the metrics you are imagining, as you, me, and everyone else has alluded to earlier, then clearly that isn't what they meant. > I get the logic chai…

> Okay, but for that to be true in this case then you must explain how Swift has "better OOP support" by that token. I did. Swift has `class` types with implementation inheritance. Rust does not. If you're porting a C++ codebase with deep class hierarchies (like, say, a browser DOM), Swift lets you transliterate those hierarchies directly. Rust makes you rethink them into composition and traits. That's a real differe…

> You've built a internally-consistent taxonomy

I'm certainly not clever enough to have built it. Not to mention that the person who coined OOP is quite famous for having done so. I am not him, I can assure you. I have merely ingested it from what is out there in widespread circulation.

I can appreciate that you live in a different bubble and what is widespread there is not the same. It's a pretty big world out there. However, it doesn't really matter as if "C++ is a functional programming language" doesn't jive with your understanding, as you'll simply ask: "What ever do you mean?" and which point "functional programming language" will be defined and a shared understanding will be reached.

This isn't the problem you are imagining.

> I did.

Right. Seems we encountered a communication barrier again. "That's the thing man, there isn't anything." in my world would read "That's the thing man, there are things and here they are: ..." However, this highlights again that it doesn't actually harm communication as further clarification follows and eventually everyone will reach a shared understanding. Communication isn't some kind of TV game show where you have to get the right answer on your first try. This is not a problem in any way, shape, or form.

Re: Closing this as we are no longer pursuing Swift adoption

#303
post #302

Earlier quoted context omitted.

> Okay, but for that to be true in this case then you must explain how Swift has "better OOP support" by that token. I did. Swift has `class` types with implementation inheritance. Rust does not. If you're porting a C++ codebase with deep class hierarchies (like, say, a browser DOM), Swift lets you transliterate those hierarchies directly. Rust makes you rethink them into composition and traits. That's a real differe…

> You've built a internally-consistent taxonomy I'm certainly not clever enough to have built it. Not to mention that the person who coined OOP is quite famous for having done so. I am not him, I can assure you. I have merely ingested it from what is out there in widespread circulation. I can appreciate that you live in a different bubble and what is widespread there is not the same. It's a pretty big world out there…

> I'm certainly not clever enough to have built it.

Ha, don't sell yourself short, you're doing a great job defending it.

> However, it doesn't really matter as if "C++ is a functional programming language" doesn't jive with your understanding, you'll simply ask: "What ever do you mean?"

Okay, genuinely, let's try this exercise. You say to me "C++ is a functional programming language." I ask "What ever do you mean?" You say "data is grouped with functions." I say "...that's also true of Python, JavaScript, Kotlin, Scala, Dart, TypeScript, and basically every language designed after 1990. What term do you use for Haskell?" And now we're in another 20-message thread defining terms from scratch instead of talking about the actual thing.

Like, you've got a taxonomy where imperative/functional/OOP is a clean trichotomy based on how data relates to code. That's elegant! But it also means "functional programming" contains both Haskell and Java, which in practice need to be distinguished from each other far more often than they need to be grouped together. The Kay-pure definitions give you clean categories at the cost of useful ones.

*Obj-C doesn't even pass muster of the Kay-pure definition, which renders the whole conversation moot.*

> "That's the thing man, there isn't anything." in my world would read "That's the thing man, there are things and here they are: ..."

Okay, fair hit. :) What I meant was: there's nothing that would make a C++ team say "strictly better." Swift has classes with inheritance, sure. But "strictly better" implies Rust can't even get close, and it can-you just model things differently. The Ladybird team discovered this themselves, which is... kind of the whole story here? They said "strictly better OOP support," tried it, and now have removed Swift. The claim didn't survive contact with their own codebase. That was the entire point of my original comment sitting at -3. (now at +2)

> Communication isn't some kind of TV game show where you have to get the right answer on your first try.

No, but Hacker News comments at -3 do get grayed out and collapsed, so in practice it kind of is, unfortunately.

Re: Closing this as we are no longer pursuing Swift adoption

#304
post #302

Earlier quoted context omitted.

> You've built a internally-consistent taxonomy I'm certainly not clever enough to have built it. Not to mention that the person who coined OOP is quite famous for having done so. I am not him, I can assure you. I have merely ingested it from what is out there in widespread circulation. I can appreciate that you live in a different bubble and what is widespread there is not the same. It's a pretty big world out there…

> I'm certainly not clever enough to have built it. Ha, don't sell yourself short, you're doing a great job defending it. > However, it doesn't really matter as if "C++ is a functional programming language" doesn't jive with your understanding, you'll simply ask: "What ever do you mean?" Okay, genuinely, let's try this exercise. You say to me "C++ is a functional programming language." I ask "What ever do you mean?"…

> What term do you use for Haskell?

In the context of the dimension we have been talking about, it is also functional. There is no difference between Haskell, Python, Java, etc. in that particular dimension. All of those languages you list are quite different in other dimensions, of course. Are you under the impression that programming languages are one dimensional? Unfortunately, that is not the case.

> And now we're in another 20-message thread defining terms from scratch instead of talking about the actual thing.

Especially when we find out that what we really wanted to talk about was type systems. Thinking of programming languages as being one dimensional is a fool's errand.

> But it also means "functional programming" contains both Haskell and Java, which in practice need to be distinguished from each other far more often than they need to be grouped together.

Right, there may be a need to separate them, but sensibly you would separate them on the dimension that is relevant to the separation intent, not some other arbitrary quality. For example, perhaps your interest is in separating mutability and immutability. Therefore, something like "Haskell is an immutable-by-default programming language" would be an appropriate statement in that desired context. "Haskell is a statically-typed programming language", not so much.

> No, but Hacker News comments at -3 do get grayed out and collapsed, so in practice it kind of is, unfortunately.

I'll still read your comments if they turn grey. I don't care about what color they are. This isn't a problem.

Re: Closing this as we are no longer pursuing Swift adoption

#305

Earlier quoted context omitted.

I know the Rust trait system has an answer to every OO concept. Another is that data field inheritance is replaced by composition. But these are more workarounds for the rarer cases you want to do OO in Rust, not the intended usual path, and doing OOP this way will get tedious. Otherwise, there'd be no difference and everyone would call Rust an OO language. Not so sure about not needing GC. Many times a problem seems…

> But these are more workarounds for the rarer cases you want to do OO in Rust, not the intended usual path, and doing OOP this way will get tedious. It sounds like you're speculating. But this doesn't match the reality of actual Rust code. For example, here's the complete, actual code for the `Widget` trait implementation for the `Button` struct in the egui framework: impl Widget for Button { fn ui(self, ui: &mut Ui…

Indeed, chapter 18 in The Book stops short of claiming that Rust is object oriented. But it's clearly written to highlight the good parts of object-oriented design that Rust has adopted.

Re: Closing this as we are no longer pursuing Swift adoption

#306
post #268

Earlier quoted context omitted.

seq = [0,1] while len(seq) > I am claiming that (0,1, + ...*)[^20] is a nicer rut. If it's so fantastic, then why on earth do you go out of your way to add extra lines and complexity to the Python?

err - I cut and pasted the Python directly from ChatGPT ;-)

But it doesn't do the same thing at all as the raku.

It doesn't build a list, rather it dumps it as it goes.

It has an explicit print.

It uses a named constant for 20 rather than a literal.

etc, etc...

Re: Closing this as we are no longer pursuing Swift adoption

#307

Earlier quoted context omitted.

Not sure how I feel about Shakespeare and JK Rowling living in the same parenthesis! Computer languages are the opposite of natural languages - they are for formalising and limiting thought, the exact opposite of literature. These two things are not comparable. If natural language was so good for programs, we’d be using it - many many people have tried from literate programming onward.

I fully accept that formalism is an important factor in programming language design. But all HLLs (well, even ASM) are a compromise between machine speak ( https://youtu.be/CTjolEUj00g?si=79zMVRl0oMQo4Tby ) and human speak. My case is that the current fashion is to draw the line at an overly simple level, and that there are ways to wrap the formalism in more natural constructs that trigger the parts of the brain that…

Have you looked at all the previous attempts?

Your example is not compelling I’m afraid but you should try building a language to see. Also read literate programming if you haven’t already.

Re: Closing this as we are no longer pursuing Swift adoption

#308
post #216

Earlier quoted context omitted.

You're re-stating his exact problem while trying to refute him.

No, I’m not. OP is conflating multiple guidelines for different purposes and attempting to use them all simultaneously.

> OP is ... attempting to use [multiple guidelines] simultaneously.

No, he's literally explaining why the guidelines can't be used simultaneously.

Re: Closing this as we are no longer pursuing Swift adoption

#309
post #300
post #284

Earlier quoted context omitted.

Complexity-wise, this version is more complicated (mixing different styles and paradigms) and it's barely less tokens. Lines of code don't matter anyway, cognitive load does. Even though I barely know Raku (but I do have experience with FP), it took way less time to intuitively grasp what the Raku was doing, vs. both the Python versions. If you're only used to imperative code, then yeah, maybe the Python looks more f…

> Complexity-wise, this version is more complicated (mixing different styles and paradigms) Really? In the other Python version the author went out of his way to keep two variables, and shit out intermediate results as you went. The raku version generates a sequence that doesn't even actually get output if you're executing inside a program, but that can be used later as a sequence, if you bind it to something. I kept…

Reminds me a bit of the fish anecdote told by DFW... they've only swam in water their entire life, so they don't even understand what water is.

Here are the mixed paradigms/styles in these Python snippets:

- Statements vs. expressions

- Eager list comprehensions vs. lazy generator expressions

- Mutable vs. immutable data structures / imperative reference vs. functional semantics

(note that the Raku version only picks _one_ side of those)

> seq.extend(sum(seq[-2:]) for _ in range(18))

I mean, this is the worst Python code yet. To explain what this does to a beginner, or even intermediate programmer.... oooooh boy.

You have the hidden inner iteration loop inside the `.extend` standard library method driving the lazy generator expression with _unspecified_ one-step-at-a-time semantics, which causes `seq[-2:]` to be evaluated at exactly the right time, and then `seq` is extended even _before_ the `.extend` finishes (which is very surprising!), causing the next generator iteration to read a _partially_ updated `seq`...

This is almost all the footguns of standard imperative programming condensed into a single expression. Like ~half of the "programming"-type bugs I see in code reviews are related to tricky temporal (execution order) logic, combined with mutability, that depend on unclearly specified semantics.

> It's about twisty stupid special symbol meanings.

Some people program in APL/J/K/Q just fine, and they prefer their symbols. Calling it "stupid" is showing your prejudice. (I don't and can't write APL but still respect it)

> What's not fine is to make up bogus comparisons and bogus implications about the people who don't like it.

That's a quite irrational take. I didn't make any bogus comparisons. I justified or can justify all my points. I did not imply anything about people who don't like Raku. I don't even use Raku myself...

Re: Closing this as we are no longer pursuing Swift adoption

#310

Earlier quoted context omitted.

Sick burn my man. Hope you check out Mojo lang vs arguing about rounding errors. I’m still unclear why I’m supposed to steer clear of Lattner which was what we were discussing.

Not sure what you're even talking about. You said something I was curious about since I thought you knew something about it I didn't but then you told me to look it up myself, for some reason, and I did. I don't know how you construed that as a "sick burn" or that you're "supposed to steer clear of Lattner," both of which I never said or implied.

It is all not important and I'm moving on as I'm sure you are as well. I assume good faith so I'm thinking we talked past each other a bit plus I was grouchy at one point (I apologize).

Here's the nut from the relevant comment: "There's no way to say this without sounding mean: Everything Chris Lattner has done has been a "successful mess". He's obviously smart, but a horrible engineer. No one should allow him to design anything."

I can't support a take like this (the commenter's, not yours) it is not helpful or informative. That original comment was edited too, or added onto. On the face of it, the sentiment that Swift and Mojo and LLVM are these awful abominations is beyond the pale for me from an engineering standpoint. I think there are some FOSS feelings in play that stir up strongly held ideologies.

Post reply on HN