Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
53 ms
·
541.
▲
by
Rusky
8y ago
It's not a general solution- you often need to access the page tables of other address spaces, and those aren't picked up by a recursive mapping. And while a single recursive mapping is a relatively small fraction of the address s
542.
▲
by
Rusky
8y ago
They get something else right, not async/await. That something can often be used for the same purpose, but it's a different tool.
543.
▲
by
Rusky
8y ago
Fair enough, typeclasses/traits were what I had in mind here. You're right that C# doesn't have a common interface to constrain your generics with for operator+/etc.
544.
▲
by
Rusky
8y ago
None of these require C++'s gradual typing- the only real reason C# can't meet them is that it lacks value parameters to generics, and perhaps some limitations to its value types.
545.
▲
by
Rusky
8y ago
I'm... not sure you replied to the right comment here? What I'm talking about is writing 2018-style paths (starting with `crate::`, etc) in a 2015-edition crate, so you don't have to switch between two path styles when you sw
546.
▲
by
Rusky
8y ago
A Rust async function doesn't work like Dart 1- it doesn't suspend immediately (i.e. return back to the event loop to be scheduled), it just doesn't run to the first await until it's actually awaited or otherwise `poll
547.
▲
by
Rusky
8y ago
Not quite yet- that's a planned change for 0.5.
548.
▲
by
Rusky
8y ago
No, they don't, because such a thing cannot exist for C++. Any attempt would basically recreate Rust, or something equivalently incompatible with existing C++ codebases.
549.
▲
by
Rusky
8y ago
For what it's worth you can write 2018-style modules code in 2015 crates (perhaps modulo a few edge cases?). So if you're willing to switch to that you can have one style across both editions.
550.
▲
by
Rusky
8y ago
All of them- it adds up. Calling conventions are a perfect place for this kind of microoptimization, because they apply pervasively and (assuming you want better error handling support) without additional change to program source. The same
551.
▲
by
Rusky
8y ago
The first problem is that the error-return-pointer-argument approach must go through memory, because the caller can request that the return value go anywhere at all. The second problem is that existing calling conventions for `struct { bo
552.
▲
by
Rusky
8y ago
The error handling proposal adds multiple return values- not as records/tuples, but as a sum type so only one can be returned from any given call. This could certainly be made more general, or just done via tagged unions (the way multi
553.
▲
by
Rusky
8y ago
No. 3D rotors are represented exactly the same way as quaternions- 4 scalars. The operations are the same as well, only the explanation is different.
554.
▲
by
Rusky
8y ago
C++'s ADTs are std::variant, which is horrific. C++'s type classes are concepts, which are hardly more than syntactic sugar over SFINAE. Neither can really compare to Rust's enums or traits.
555.
▲
by
Rusky
8y ago
I... what? Rust is hardly targeting "small, easy language for ignorant developers," and putting it in that camp because it has nice error messages is unreasonable. I'm even more perplexed by "Rust currently provides no b
556.
▲
by
Rusky
8y ago
This is arguably less readable, because it's missing some delimiters for your eyes to latch onto. It's also not realistically parseable- the Haskell/Ocaml-like removal of <>s and ()s relies on application being left-ass
557.
▲
by
Rusky
8y ago
I believe the GC integration is far more important for Javascript (or other host language) interoperability than for WASM-targeting languages. Many of them will probably be able to take advantage of it, but anything more special-purpose sho
558.
▲
by
Rusky
8y ago
That's not the sense of "depends on" that applies here. It's a textual relationship- in this case, I believe the last commit would depend on the second, which would depend on the first. If you're familiar with CRDTs
559.
▲
by
Rusky
8y ago
As I understand it this isn't really a meaningful operation to Pijul (or Darcs, or patch-theory-based version control in general). The version bump commit and the final commit don't depend on each other so they're not inheren
560.
▲
by
Rusky
8y ago
"Some kind of fat pointers or tagging" is exactly the sort of thing WebAssembly was created to get away from. You can use a language that provides them and targets WebAssembly, without taking away the thing that makes the platfo
561.
▲
by
Rusky
8y ago
> Even the new proposal for them is very incomplete. I agree with this assessment of the C++20 lifetimes stuff. It's great, it will probably catch a lot of bugs, but it doesn't catch the worst ones and that's where you n
562.
▲
by
Rusky
8y ago
Please, these are not interesting or useful talking points. You always get the same responses: Partially initialized arrays are a solved problem- anything more would just be baking `Vec` into the language. And backlinks are nowhere near &qu
563.
▲
by
Rusky
8y ago
Too bad we're stuck with concepts-lite, where templates are still untyped and the scoping is all still done the same old messy way.
564.
▲
by
Rusky
8y ago
I don't think I tend to be a passionate anti C++ commenter, though I agree with the sentiment. I've used C++ for around a decade, both professionally and as a hobby, in various domains. I use it because I either need (or merely wa
565.
▲
by
Rusky
8y ago
Most game devs also care about consoles, which adds several more platforms and toolchains.
566.
▲
by
Rusky
8y ago
Go solved the main downside the article cites with M:N threading- it replaced split stacks with growable stacks, via a precise garbage collector.
567.
▲
by
Rusky
8y ago
> But damn, when will the gaming community realize they need something like GC? I-- what does this even mean?? On the one hand, they don't need something like GC, as this clearly shows. Many larger games can't afford it, and
568.
▲
by
Rusky
8y ago
What I do instead (given the excellent sibling replies about how it's not that simple) is store the value in a `u64` and then provide a method to decode it into a non-layout-optimized enum. Since that enum is not stored anywhere but th
569.
▲
by
Rusky
8y ago
The example that kicked off this discussion, replacing references or pointers with array indices, is presumably one example you're thinking of? The problem with using that example to make this argument is that it is the equivalent co
570.
▲
by
Rusky
8y ago
> Is is really so different for the programmer who wrote the bug? Yes, absolutely. The symptoms may be similar (though the logic error will still never lead to memory corruption or segfaults), but debugging is much easier when you can st
More ›