Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Rusky
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
49 ms
·
511.
▲
by
Rusky
8y ago
Yes, we're discussing an alternative design here. An automatic move should change the semantics of the program, rendering later uses invalid. This does not break RAII- it merely changes the defaults. It should be copies that are mark
512.
▲
by
Rusky
8y ago
Vec::new doesn't allocate. Vec::try_reserve, on the other hand, simply uses a common `CollectionAllocError`, which is not really (a) or (b).
513.
▲
by
Rusky
8y ago
Rust moves don't allocate, and yet can still support recoverable allocation failure. The reason C++'s model is so much more complicated is because of backwards compatibility and nondestructive moves, not as a mechanism to support
514.
▲
by
Rusky
8y ago
It's unfortunate but some C++ standard library implementations do require allocation in some moves (notably, IIRC, Microsoft's std::list). So we're stuck with it.
515.
▲
by
Rusky
8y ago
Automatic moves don't imply that you can't use RAII to define dynamic scopes. In fact it's the reverse- moves give RAII much more power and flexibility around scopes. The problem, instead, is that C++ has no way to determine
516.
▲
by
Rusky
8y ago
From someone who wrote graphics drivers, D3D's spec is quite a bit better: https://twitter.com/rygorous/status/1115716179413176320
517.
▲
by
Rusky
8y ago
Those "politics" were there for a reason. Wasm is a solid improvement over PNaCl, which I will note you have curiously left out of all your other old-VM-worship claims.
518.
▲
by
Rusky
8y ago
Rasterization already makes heavy use of similar acceleration structures to avoid overdraw.
519.
▲
by
Rusky
8y ago
Sure, and we use software memory tagging with things like LLVM sanitizers. It's great. But a) the hardware Wasm needs to support doesn't have tagging, and b) the software equivalent requires support from the allocator and has a la
520.
▲
by
Rusky
8y ago
Using such a VM requires rewriting existing C code. Wasm's approach allows that to happen incrementally, where it matters, by using memory safe languages like Rust, instead of relying on the VM.
521.
▲
by
Rusky
8y ago
The JVM and wasm have completely different memory safety stories on the inside of the sandbox, because wasm can run arbitrary C, so it has to cope with that somehow. But the thing Steve is pointing out is that they're equivalent from t
522.
▲
by
Rusky
8y ago
I'm not conflating anything. And as I said, none of this is sandboxed like WebAssembly so it's hardly a comparison anyway.
523.
▲
by
Rusky
8y ago
True, I forgot about Graal. IIUC though that's somewhat different from what WebAssembly has done- Graal doesn't define any sort of stable compiler target for C, or produce JVM bytecode from C, but instead (via Truffle) JITs C sour
524.
▲
by
Rusky
8y ago
To the extent that their object and memory models match the JVM's, you might say they were. To the extent that they don't, their JVM implementations wind up with warts and inconsistencies. (But this is pedantry, you clearly know w
525.
▲
by
Rusky
8y ago
I was careful to say "unmodified." C++/CLI is hardly that. It's also not at all sandboxed the way wasm is. Why the chip on the shoulder?
526.
▲
by
Rusky
8y ago
The CLR is not a great target for running unmodified C code. I suspect that was included in "practically any language."
527.
▲
by
Rusky
8y ago
The JVM was designed as a compile target for a very particular kind of language. One with a Java-like object model, with some later concessions for more dynamic languages. C, C++, Rust, etc. do not fit into that model at all. There's a
528.
▲
by
Rusky
8y ago
The JVM doesn't run languages that weren't designed for it, like C or C++ or Rust. WebAssembly does. This is important for a lot of reasons- huge amounts of existing code you can now use without JNI or whatever, a higher ceiling f
529.
▲
by
Rusky
8y ago
Yes- but not only are C# and Java faster to compile in general, they're easier to process small pieces of in isolation. C++ requires everything referenced to be declared previously even just to parse . (Modules should help here, at le
530.
▲
by
Rusky
8y ago
Yes, as cquery's README states it has a huge memory overhead because it basically just builds the project and keeps the info around. This is rather like how Visual Studio's C++ IDE support used to work, and it was not fun to wai
531.
▲
by
Rusky
8y ago
There have been improvements for sure, but have you used a good Java or C# IDE? C++ support is still far behind in terms of performance and accuracy. (I work on a C++ IDE.)
532.
▲
by
Rusky
8y ago
As the article describes, it's a small (or large...) heap with some specific behavior and restrictions- space is allocated in order, making allocation extremely fast; and in exchange there's no way to free individual objects, you
533.
▲
by
Rusky
8y ago
The use case in the article does not hold onto a few of them, though- it holds on to exactly two at any time.
534.
▲
by
Rusky
8y ago
The question is to what degree.
535.
▲
Soak: a struct-of-arrays library in Rust
(abubalay.com)
2 points
by
Rusky
8y ago
|
0 comments
536.
▲
by
Rusky
8y ago
Sure, I certainly agree there. I just thought the OP was going a bit overboard- stifled creativity wasn't an issue here at all.
537.
▲
by
Rusky
8y ago
I don't see how the article is trying to be "comforting," or dismissing the value of skill and education. I also don't see how the `Send` trait featured in the article "doesn't give any freedom for creativity.&
538.
▲
by
Rusky
8y ago
> You can also simply translate your entire C/C++ codebase to V and make your build times up to 400 times faster. An automatic translator supports the latest standards of these languages. Is this saying you can actually get compile
539.
▲
by
Rusky
8y ago
This post is full of misinformation. Reposting my reply from Reddit: > what the futures.rs authors decided to do: cram futures.rs into std and add an entire language feature to hide the bloat behind a code generator. First the post estab
540.
▲
by
Rusky
8y ago
This is a rustup issue, not a Cargo issue. You can use a system-installed Cargo/rustc just fine.
More ›