Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
48 ms
·
571.
▲
by
Rusky
8y ago
I don't know if this is what you meant, but plenty of game engines definitely have separate backends for Direct3D and OpenGL that are more than just translation shims. There's the big ones like Unreal, Unity, etc. The same is tr
572.
▲
by
Rusky
8y ago
Yes, I know- that was my point. The comment I replied to was talking about CPU/RAM errors somehow bypassing that proof.
573.
▲
by
Rusky
8y ago
That sounds exactly like an error of degree- Rust does have "no memory errors" proof tools already, built into the language.
574.
▲
by
Rusky
8y ago
I'm all for leaving asserts in release builds, but leaving in dead code based on uninhabited types isn't gonna help you catch RAM or CPU errors. You'll just continue into the error branch with an impossible value instead. It&
575.
▲
by
Rusky
8y ago
Yes, but that requires a lot of language-specific work and heuristics to make work, and there are still a lot of places where the approach falls down. (Source: I work on precisely that sort of tool for C++.) So you need the text-based fallb
576.
▲
by
Rusky
8y ago
Structural editors are great, and normal text-based programming editors should probably support the same kinds of transforms, both precisely and fuzzily. But a typical editing session will go through a lot of "invalid" states by
577.
▲
by
Rusky
8y ago
> Whereas exceptions (in the C++/Java style) are free when they don’t fire, but very expensive when they do -- hundreds or thousands of cycles to parse exception tables and unwind the stack. This isn't the whole story. The unwi
578.
▲
by
Rusky
8y ago
> Rust will eventually solve its crisis by creating something equivalent to "do" notation. This is... not at all true? Rust already has the `?` operator, and there's no indication of this being replaced with do notation or
579.
▲
by
Rusky
8y ago
This work is far more foundational than any of that. It applies to references just as much as raw pointers- it determines how much the borrow checker is allowed to permit, for example. You can't even begin to write the sorts of things
580.
▲
by
Rusky
8y ago
On top of the sibling comments pointing out that Rust doesn't use LLVM coroutines, which allocate each coroutine frame by default, you misunderstand the control flow of Rust async functions: A Rust future is also "responsible fo
581.
▲
by
Rusky
8y ago
> when you async call a function, it does eagerly evaluate until the first suspend point. This is less overhead than immediately suspending, plus it removes the dependency of the language feature on a userland event loop. This seems wron
582.
▲
by
Rusky
8y ago
A Rust-flavored effect system is quite a bit different from do-notation. You're probably right that such a thing could achieve the same ergonomics and efficiency as built-in async/await, but you're also probably right that it
583.
▲
by
Rusky
8y ago
Where? The post cites C11 section 6.5.8 paragraph 5, which seems to disagree with you. Of course == comparing unrelated pointers is something you need to be able to do, but relational comparisons (including those based on pointer arithmetic
584.
▲
by
Rusky
8y ago
They're from different objects, so it's not meaningful (according to the standard) to compare them. That's what makes it UB.
585.
▲
by
Rusky
8y ago
Okay, but most Scheme code doesn't use call/cc, and even when it does the vast majority of the continuations in use are also "abstract function call stacks." You said it yourself- a stack is a useful tool for implementin
586.
▲
by
Rusky
8y ago
> unlike C, it is not a fundamental part of the lower level semantics I don't think this is an accurate characterization of C, actually. Unless I'm forgetting something, an implementation of C that heap-allocated automatic stor
587.
▲
by
Rusky
8y ago
That's not a very satisfying answer, as it doesn't apply to the languages typically compared with C- C++, Rust, or even D, Nim, Zig, etc.
588.
▲
by
Rusky
8y ago
I don't think the LSP includes any debugging support?
589.
▲
by
Rusky
8y ago
Ah, right; missed that part of what you were saying. If you switch the compiler version on my godbolt link to beta, the &mut i32 and &mut UnsafeCell<i32> both have the noalias attribute, so looks like it's on track. :)
590.
▲
by
Rusky
8y ago
Good thing Send is implemented automatically for types based on their contents, then. If you're trying to send a value to another thread, Rust will only stop you if the author of some type somewhere inside it has opted out, and none of
591.
▲
by
Rusky
8y ago
> there's a level of indirection which is abstracted over by the Deref trait. There isn't, though. Box and Rc have the same number of levels of indirection as the built-in pointers: one. The double * you see in the Box source y
592.
▲
by
Rusky
8y ago
Right, so if &mut is always unique anyway then the presence of an UnsafeCell shouldn't affect it, since it's about weakening guarantees. In fact, looking at the compiler output ( https://godbolt.org/g/kt2
593.
▲
by
Rusky
8y ago
Box totally implements Send: https://doc.rust-lang.org/std/boxed/struct.Box.html#syntheti... Also I'm not sure how ? obscures control flow to the same level as C++, which propagates exceptions with no synta
594.
▲
by
Rusky
8y ago
Doesn't UnsafeCell only affect &T, not &mut T? &mut is always unique.
595.
▲
by
Rusky
8y ago
This is wrong. Passing a large struct by value does introduce a memcpy... in the caller: https://godbolt.org/g/26annS The same is true in Rust, though it's trickier to show on godbolt because the equivalent of `
596.
▲
by
Rusky
8y ago
The Google proposal does have quite a few things going for it, IMO. The TS heap-allocates all coroutine frames by default and hopes that can be optimized out; the Google proposal treats the coroutine frame as an anonymously-typed object m
597.
▲
by
Rusky
8y ago
`getChar` is not of type `() -> SomeType`, but directly of type `SomeType`. (Though yes, `f` also is a constant... it's just a constant that happens to be a function, which `getChar` is not.)
598.
▲
by
Rusky
8y ago
Plain `pub` actually isn't quite local, and that's part of the confusion that `crate` is intended to address. There's also the confusion of looking at a `pub` declaration and not knowing whether or not it's visible to th
599.
▲
by
Rusky
8y ago
That's usually what "capture" means when talking about closures.
600.
▲
by
Rusky
8y ago
Virtual DOM isn't what makes things declarative. You can solve the same problem by diffing the model instead of the render output- the important part is that you have a comprehensive way to tell what parts of the view need to change.
More ›