Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
94 ms
·
931.
▲
by
Rusky
11y ago
So if a parent does something their child doesn't like, but for a good reason, they must be one of 1) a bad parent, 2) incapable of doing anything better, or 3) unaware that the child won't like it? Given a deity and an afterlife,
932.
▲
by
Rusky
11y ago
The return value is going to stay in a register the whole time anyway, so a char won't save you anything. But regardless, the point of that sentence is nothing to do with memory usage, but with semantics. Whether you or the compiler pa
933.
▲
by
Rusky
11y ago
Yeah, those are pretty common pain points in Rust. There is some potential to add tail calls in the future, though, through a reserved keyword "be" (since destructors + tail call optimization don't get along well).
934.
▲
by
Rusky
11y ago
Oh, yeah, definitely. I guess I was responding more to the "Rust isn't my favorite language" part of your comment- what would you like a language in that niche to do differently than Rust? Or do you just prefer when you can g
935.
▲
by
Rusky
11y ago
What sort of features would you like to see in a C/C++ replacement?
936.
▲
by
Rusky
11y ago
It doesn't guarantee destructors will run, that's true, but that's for things like Rc cycles. Take a look at the RFC for std::panic::recover- it definitely takes exception safety into account: https://github.com&#x
937.
▲
by
Rusky
11y ago
Are you saying C++ make it easy to write exception-safe code? Because Rust explicitly encodes exception safety into the type system with the RecoverySafe trait, you need to write unsafe code to bypass that, and the documentation on unsafe e
938.
▲
by
Rusky
11y ago
That's not a very meaningful distinction to make- Rust doesn't even have a standard right now. Besides, -fno-exceptions is quite useful today, not just because of 90s compiler deficiencies, and is pretty well-supported by compiler
939.
▲
by
Rusky
11y ago
Even C++ doesn't have mandatory exception support, and even Rust can catch panics from failure-oblivious code.
940.
▲
by
Rusky
11y ago
...and the same is true of Rust, just with different defaults. Switch allocation failure from an abort to a panic and catch the panic just like you would in C++. What's incomplete about that? It's not like C++ can't be switch
941.
▲
by
Rusky
11y ago
Exceptions can be turned into aborts in C++ as well, and are in many types of programs, because exceptions do have downsides for some problem domains. If Rust forced exceptions on everyone, there'd be people complaining about that ju
942.
▲
by
Rusky
11y ago
The compiler is just as much written by random humans as anything else.
943.
▲
by
Rusky
11y ago
Even if the language pulled some magic trick where it could verify collection implementations without unsafe, all you'd have done is move the unsafety into the type checker and compiler backend. The only difference is that Rust 1) move
944.
▲
by
Rusky
11y ago
And what about systems that don't have a stable interface below dynamically linking that platform's system-provided libc? Just let every program break when the system updates?
945.
▲
by
Rusky
11y ago
And removing a blue checkmark next to someone's username is censorship... how?
946.
▲
by
Rusky
11y ago
That's not really how it works. Rust's rules for when an object is freed are very simple, basically the same as C++- they don't depend on references or anything. The complicated part is that the compiler makes sure no referen
947.
▲
by
Rusky
11y ago
The closest thing that comes to mind is total functional languages- the compiler doesn't deal with complexity classes, but it does prove termination. It's mostly used in dependently-typed languages and theorem provers so they can
948.
▲
by
Rusky
11y ago
That still doesn't sound like the cache line "bouncing around" any more than it would if a single-core app did the same work. There's no contention on it the way there would be on a shared mutable value, at least.
949.
▲
by
Rusky
11y ago
Wouldn't globalFlag just be shared in a duplicated cache line between all cores until one of them modifies it?
950.
▲
Rust Parallel Iterators Part 2: Producers
(smallcultfollowing.com)
1 points
by
Rusky
11y ago
|
0 comments
951.
▲
by
Rusky
11y ago
Sharing data layout between implementations of a trait is much more manual and tedious in Rust than it is in something with inheritance. You can often change your design to avoid that issue, but Servo, for example, needs to implement the DO
952.
▲
by
Rusky
11y ago
I don't see any reason to assume the free market will solve those problems- the local markets are doing just fine with the rich (spoiled?) part of the population, and have little to no incentive to change; dumb startups are doing just
953.
▲
by
Rusky
11y ago
How is Rust crippled by affine types? From my perspective it simultaneously eliminates bugs and enables new techniques.
954.
▲
by
Rusky
11y ago
What do you see as unusable about Rust's error handling? It's heavily inspired by monadic exceptions.
955.
▲
by
Rusky
11y ago
A blog I've really enjoyed on that subject is Mechanical Sympathy: http://mechanical-sympathy.blogspot.com/
956.
▲
by
Rusky
11y ago
He barely mentions Rust and only to dismiss it as a "big idea language" because it's memory-safe. Not a very interesting critique, IMO- he doesn't talk at all about any of the other features of Rust that improve on C and
957.
▲
by
Rusky
11y ago
I doubt you'd have the sort of trouble with pointers and unsafe blocks that you suggest. Most typical pointer patterns don't even require lifetime annotations, let alone bypassing the borrow checker. I also think the "conveni
958.
▲
by
Rusky
11y ago
The author does mention Rust: > New and hip GC'd languages don't care about the priorities efficient game engine code has. Safety-enforcing languages like Rust are going somewhat off already by definition, as they're focus
959.
▲
by
Rusky
11y ago
The intent is exactly like assembly/machine code, though they haven't really nailed down the format yet. Current implementation(s?) just use s-exprs, though I don't think they want that to be the final form.
960.
▲
by
Rusky
11y ago
WebAssembly's GC isn't just some arbitrary new GC, it's the JavaScript GC. The benefit there is so wasm apps can integrate with JS and the DOM directly the same way things like Python or Ruby plugins written in C integrate wi
More ›