Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
35 ms
·
301.
▲
by
Rusky
6y ago
Right, I've been telling you it's not relevant for the past three comments now. You seem to be under the impression that dlopen somehow interacts with language undefined behavior; it does not in either Rust or C++.
302.
▲
by
Rusky
6y ago
The behavior in that case is defined by the implementation of dlopen. This is entirely outside of Rust's control, but fortunately it's also perfectly well-defined by the platform. Again, does not intersect with the ODR violations
303.
▲
by
Rusky
6y ago
If you want to call Rust code from another language, you use its FFI tools to export an un-mangled API. This is typical for C++ as well- trying to interop with mangled C++ names requires a lot of coordination across the toolchains and so ev
304.
▲
by
Rusky
6y ago
That's much closer to a substantial and fair similarity between Rust and C++! Indeed, if I understand you correctly, it's a major cause of both languages' slow compile times, and a source of a lot of difficulties for humans
305.
▲
by
Rusky
6y ago
It carefully designs its name mangling such that this doesn't happen in the first place, even in the presence of multiple slightly-different builds of a library. The only way to get matching names is to ask for them explicitly, via FFI
306.
▲
by
Rusky
6y ago
Four of the five pieces of accidental complexity I listed were present in C++98, so I'm not sure what the relative ages have to do with this. (You've also not mentioned any accidental complexity in Rust...) Instead, I attribute it
307.
▲
by
Rusky
6y ago
I really don't see how Rust has most of C++'s problems. Slow compiler, sure, though things are changing. Most complex languages in history? Only if you squint at it from 10000 feet and ignore what the complexity is doing. C++ ha
308.
▲
by
Rusky
6y ago
I suspect people are talking about periods being negative specifically in IM/text message contexts, like Slack, where "send message" has taken over the role of period and period has morphed into an extra signal for something
309.
▲
by
Rusky
6y ago
Text/instant messages have evolved their own norms, as all language does. To many people, periods have a different meaning there. See e.g. https://www.npr.org/2020/09/05/909969004/before-texting-your
310.
▲
by
Rusky
6y ago
Really don't see how that announcement is an "extend" move, despite the surface-level phrasing. They're piping host-side drivers through into WSL, only to immediately wrap them back up in Mesa OpenGL and Vulkan. Their us
311.
▲
by
Rusky
6y ago
Doesn't that just make it tricky to put stuff in the sidebars again? The article doesn't really talk about that but it is implied.
312.
▲
by
Rusky
6y ago
What? Rust has both early return and unwinding, which interact with destructors the same way. Further, Rust has destructive move, making drop even more flexible.
313.
▲
by
Rusky
6y ago
In a sense even things like `TypeId::of` or `mem::size_of` violate parametricity.
314.
▲
by
Rusky
6y ago
The linked documentation ( https://support.mozilla.org/en-US/kb/control-audio-or-video-... ) mentions that this is only supported on Windows 8.1 or newer.
315.
▲
by
Rusky
6y ago
Those are not even the same kind of "range"...
316.
▲
by
Rusky
6y ago
Probably by using a third-party library, with a pre-concepts-based implementation which is heavy on compile times. Unlike Rust, where they're built in and don't really have that cost. The context here is comparison between Rust an
317.
▲
by
Rusky
6y ago
That would be neat, but it's not a pure win. It's more just a different set of trade-offs, because it defeats the CPU's return address stack predictor. For exception-like Result enums where you want to predict the Ok variant
318.
▲
by
Rusky
6y ago
Structured bindings work for simple cases, but Rust's are much simpler and more powerful.
319.
▲
by
Rusky
6y ago
Ranges don't really exist yet.
320.
▲
by
Rusky
6y ago
I'm just running with the original example, contrived as it may be. Nobody here is actually talking about anything specific to points of any dimension.
321.
▲
by
Rusky
6y ago
Here's a library in Rust that works this way: https://docs.rs/hecs/ You don't just have bare arrays sitting there. You have a separate part of your program that is responsible for managing them, playing a rol
322.
▲
by
Rusky
6y ago
> But now your Point2D code needs to be aware of the Point3D code. Not at all! You write the archetype management code once, and then the Point2D code just asks it for Point2Ds, nothing else, and that doesn't change no matter how yo
323.
▲
by
Rusky
6y ago
DOD has simple solutions for this, too. A popular one is to group your entities by "archetype"- you have two arrays of Point2Ds, one for those without a Z coordinate and one for those with a Z coordinate. Now if you want all Point
324.
▲
by
Rusky
6y ago
Whoops- the actual libraries I'm thinking of wrap those args in a tuple. I've updated the example.
325.
▲
by
Rusky
6y ago
It seems likely to me that Rust will use ECS queries as the idiomatic way to write struct-of-arrays code. In archetype-based ECS libraries (which the ecosystem seems to be converging on or near) you write a query asking for a particular sub
326.
▲
by
Rusky
6y ago
It was thrown around in early streams on Jai, but it was removed. (IIUC, with the intent to let it happen in a library using Jai's metaprogramming.)
327.
▲
by
Rusky
6y ago
(I think all they meant was "non-breaking" not "non-useful.")
328.
▲
by
Rusky
6y ago
This is probably not what was meant, but interestingly unique_ptr actually isn't zero-cost on some ABIs: https://www.youtube.com/watch?v=rHIkrotSwcc
329.
▲
by
Rusky
6y ago
That was a restriction from before 1.46 stabilized control flow in const functions. Now that we have worked out the details around `if`, we can also stabilize `&&` and `||`. (I'm a little surprised they weren't stabilized
330.
▲
by
Rusky
6y ago
Yeah, I do think it might be interesting (if somewhat of a backwards compatibility problem) to introduce the concept of an "unsafe macro." Along with https://github.com/rust-lang/rfcs/pull/2585 it w
More ›