Earlier quoted context omitted.
> I'd consider something OOP if it has the same expressive power i.e. things expressible in OOP languages are easily expressible in another OOP language as well. That doesn't even make sense on its face. There are things which are trivially expressible in Smalltalk and I'm not sure even possible to wrangle in Java.
That's because Smalltalk OOP isn't the OOP in the sense Java is, some refer to Java Style as Class oriented Programming.
How I went about learning Rust
291–300 of 303 posts
Re: How I went about learning Rust
#292Earlier quoted context omitted.
>"90% of the time this is dumb overhead, but 10% of the time it found a bug in some edge case, so I learned to appreciate it as a tough teacher, and my designs got better for it." Sounds kind of like Stockholm syndrome
And you sound like you are part of the reason why we still have exploitable null-pointer bugs in 2022. Imagine a structural engineer that would say "all that static and dynamic analysis is dumb overhead 90% of the time, so I am going to skip it" . Imagine an electrical engineer who would go like "all these wire gauge calculations are exhausting, 90% of the time my installations don't catch fire" Seriously, I sometime…
Re: How I went about learning Rust
#293Earlier quoted context omitted.
> The danger with these arguments is that you only notice the cases that don't work. That's a 100% failure rate! Can't get more stupid than that! I’m gonna go out on a limb and suggest maybe you’re too close to this. I notice the “clear win” cases frequently too. At best they’re very clearly and awkwardly editorialized. I click on them frequently just to reassure myself that I’m aware I’m not mistaking reality for fi…
What's "\d" in this context?
Re: How I went about learning Rust
#294Re: How I went about learning Rust
#295Earlier quoted context omitted.
How "large" is the garbage collector penalty? My understanding is that the Go GC is significantly more efficient than for example JS's mark/sweep approach. Apples to oranges for sure, but I am interested in better understanding how expensive the Go GC is vs Rust performance.
Check out the discord article I posted in the original reply. If I interpret the graphs correctly, I see: Golang: * baseline 20% cpu + spikes to 35% once the GC runs. * response times of about 1ms + spikes up to 10ms. Rust: * baseline 12% cpu + flat, no spiking. * response times of 20us + flat, no spiking (!). In terms of scaling, I interpret the results in favor of Rust. My reasoning is the more you run the GC, the…
Re: How I went about learning Rust
#296Earlier quoted context omitted.
Check out the discord article I posted in the original reply. If I interpret the graphs correctly, I see: Golang: * baseline 20% cpu + spikes to 35% once the GC runs. * response times of about 1ms + spikes up to 10ms. Rust: * baseline 12% cpu + flat, no spiking. * response times of 20us + flat, no spiking (!). In terms of scaling, I interpret the results in favor of Rust. My reasoning is the more you run the GC, the…
Posting links to his blog post is misleading in 2022. The issue they mention in their blog was fixed so it's not an issue now.
Re: How I went about learning Rust
#297Re: How I went about learning Rust
#298Earlier quoted context omitted.
> I.e. if you pass maybe-scores to something that computes the mean, you'll get a compiler error. The writer of the mean function doesn't need to care you've overloaded an error value onto your numbers. If I pass a null into something that calculates an average, taking numbers, the TS compiler will complain now. The writer of mean() (assuming mean() is typed) doesn’t have to know anything about my code.
This only works for non-sentinels. I.e. if "-1" happens to be the value indicating NoScore, I don't think the TS compiler can catch that?
Re: How I went about learning Rust
#299Earlier quoted context omitted.
Yes but that’s no less work than checking for null in TypeScript. The parent said: > In your example, you still have to manually check if there's a value every time, but this is not compiler-enforced.
Sure, it's the same amount of work, but you're forced to do it and the compiler will be able to reject invalid programs. In languages that allow null (including TS, it doesn't 100% enforce the stuff that Haskell, etc. does), you can skip that check, saving some work I suppose, at the risk of your code exploding at runtime. Having stack traces which jump across 50,000 lines of code because someone forgot to check for…