Hacker News new | past | comments | ask | show | jobs | submit | randomdata's comments login

Depending on which implementation you use, the following may produce the same instructions as the example above. Go on, try it!

     package main

     import "fmt"

     func foo(x *X) int {
          return x.y
     }

     type X struct {
          y int
     }

     func main() {
          xx := X{3}
          fmt.Println(foo(&xx))
     }
Now, gc will give you two different sets of instructions from these two different programs. I expect that is what you are really trying and failing to say, but that is not something about Go. Go allows devirualizing and monomorphizing of the former program just fine. An implementation may choose not to, but the same can be said for C++. Correct me if I'm wrong, but from what I recall devirtualization/monomorphization is not a requirement of C++ any more than it is of Go. It is left to the discretion of the implementer.

> compile time duck typing

The term you are looking for is structural typing.


> Maybe it’s time to change the way we discuss.

My takeaway from your comment is not so much that we need to change the way we discuss, but that we more regularly need to remind ourselves that computers and people are not the same thing. As you suggest, when people have discussions it usually goes well, with all parties more or less wanting "boring" discussion that goes somewhere meaningful. It is when people have discussions with computers but confuse them as being people when it all goes off the rails.


are you a computer?

> Who here thinks twitter is a platform for rational discourse?

When considered in its entirety? No. Not at all. Within the curated segment of Twitter I have established? Yes! It is probably the most rational place on the internet that I know of. Those within that curated circle seem to genuinely want to share information in a productive manner without the silly vitriol.

That's the beauty of "the algorithm", I suppose. You can tune it to leave the garbage out.


> I would very much like to find (or create) forum(s) for discussions seeking understanding instead of arguments seeking to “win” wars or battles.

The users on chatgpt.com are quite good at staying cordial and come off as if they want to seek a genuine understanding. Granted, its UI is a little different from the traditional forum, only occasionally seeing additional users reply but being mostly geared to one-on-one interaction. That said, most discussions on more traditional forums like this one end up branching off into one-on-one discussions anyway, so I am not sure that is a terribly meaningful difference at the end of the day.

> My own attempts have shown the potential audience is small to non existent

Said discussion community has quite possibly become the most popular place for online discussion, so I am not sure about that. Understandably bootstrapping such a service is hard, though. "If you build it, they will come" only happens in the movies.

"Be careful of what you wish for", though. While what you describe sounds nice in theory, it ends up feeling rather sterile when you don't have all the quirkiness of the so-called battles. That's what brings me back here, and deep down that is probably why you are here too.


Nah. Those who have settled on some kind of final truth stop talking about it. Topics become boring once you are sure there is nothing left to be convinced of. If someone is wanting to talk about a subject, they are in a state of being unsure and are looking to be convinced of something other than what they are currently thinking.

But rarely is a topic so simple that "X is Y"; "no X is Z" provides enough information to move someone forward towards establishing a final truth. Even if "X is Z" is a true statement, it almost always lacks necessary context to fully satisfy what the other is in need of. It is hard for us to understand where the other person is coming from.

Furthermore, if you do end up truly convincing someone of something, the topic then becomes boring and they'll just stop engaging, so how do you even know whether the argument was 'productive' or if the other just ran out of free time? Of course, it doesn't actually matter, so...


I clearly perceive the world differently from you. Sure, once an argument is over, its boring to continue, thats pretty much a no-brainer. But to my experience, people discuss topics not because they are unsure, but because they basically do virtue-signalling by stating their position on the topic. But almost nobody is interested to actually change their position or, heaven forbid, learn something.

Virtue signal to whom, exactly? If nobody is interested in learning of or changing their opinion of your virtue...

How do you even measure the effectiveness towards the original poster? Logically, you are going to spend more time 'arguing' for what you don't believe in as a validation that you truly understand what you do believe in, so what onlookers read is not even a reflection of reality.

What makes you think 'winning' matters? What matters is that you are being entertained. Otherwise, why bother? And, if we are being honest, what is most entertaining on a message forum is getting a reaction. People would simply write in their private journal if they weren't looking for a reaction.

But that means that the content will be tuned to what the author thinks will most likely produce a reaction. Some audiences respond well to insults, others not so much.


> The more popular a language is (in large enterprise codebases), the more it will get used in new projects

It seems to me the more popular a language, the more poorly written libraries are found in it, which soon starts to draw people away from what is popular to a new language that has a limited library ecosystem thinking they can fix the mistakes they saw last time and make a name for themselves in the process. Lather, rinse, repeat.


> The parent is almost certainly aware macOS is BSD-based

Doubtful. Surely they would know macOS is XNU-based?


You say that like it's something completely different, but XNU is a BSD, with a lot of code inherited from FreeBSD in particular.

The "higher" levels of XNU are largely inherited from the BSD legacy, but we're clearly talking about what serves as the base. So even if you take an inheritance angle, XNU is based on Mach, not BSD. macOS is full of BSD/derivatives code, sure, but it is not based on them. The foundation is laid elsewhere.

> but we're clearly talking about what serves as the base

No, you just switched usages of the word "base" mid-conversion so you could say other people are wrong?

This conversation isn't advancing anyone's understanding. It's just pedantry.


> No, you just switched usages of the word "base" mid-conversion

The original assertion was: "Apple is BSD based". While we did move to assume Apple means macOS (iOS, et. al), we stayed the course with the remainder. There is nothing about macOS that is BSD-based. Containing some BSD code does not imply that it is the base. macOS also contains curl code. Would you say macOS is curl-based?

Regardless, what you may have missed is the additional context the followed: "not Linux". The parallel to Linux in macOS is XNU. Therefore, if other systems are Linux-based as we are to infer from the original comment, then macOS is XNU-based, not BSD-based. Yes, XNU contains some BSD code, but it is not BSD. It is very much its own distinct kernel maintained independently of BSD-adjacent organizations.

> This conversation isn't advancing anyone's understanding. It's just pedantry.

It could advance someone's understanding if they were open to seeing their understanding advance. I understand not everyone is accepting of new ideas and that many fear learning something new.


> There is nothing about macOS that is BSD-based. Containing some BSD code does not imply that it is the base. macOS also contains curl code. Would you say macOS is curl-based?

A decent chunk of the kernel was directly lifted from FreeBSD (and in bizarrely stubborn '90s-era design philosophy fashion, glued to Mach); some older stuff from NeXT came from earlier BSD codebases. I see 155 files in the ssh://git@github.com/apple-oss-distributions/xnu.gi repo that still have FreeBSD CVS version tags on them for some reason.

There is no curl code in the kernel. (If you want to be truly pedantic, and I see that you do, there is one shell script in that repo that assumes curl is installed.)


> A decent chunk of the kernel was directly lifted from FreeBSD

Sure, just as we already discussed at the very beginning of our exchange. Glad you able to learn something from our discussion, even if it has taken you an astoundingly long to time to get there. Here I was starting to think you were one of those who reject learning. I am happy to learn that you're just slow.


I am very aware of the situation of what Mac OS and Linux kernels and userspace are.

I work for Red Hat in the kernel maintenance team.

Edit: i just realised you were doubting the correctness that it was BSD, not that I knew.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: