HNHacker News
TopNewBestAskShowJobs

CryZe

383 karma · joined December 9, 2016

submissionscomments
CryZe··on From a WebAssembly Perspective
> And it's not like you are going to get a huge performance benefit using Rust or C++ over assembly script.

Or do they? Unlike Assembly Script, Rust and C++ use LLVM, which is a lot better at optimizing than binaryen.

CryZe··on Rust 1.63
If those terms mean anything to you: const is an rvalue, static is an lvalue.
CryZe··on Safety: A comparaison between Rust, C++ and Go
> In C++ the community "default" is `absl::flat_hash_map`/`folly::F14`, which use SIMD to compare a whole stripe of key-prefixes simultaneously.

Just to be clear, the Rust HashMap does the same thing.

CryZe··on Rumor: Google Stadia May Be Getting Shut Down
According to this comment on Reddit https://www.reddit.com/r/gaming/comments/wb4jl6/comment/ii5d...:

- Stadia signed multimillion deal with EA for Fifa23 and is taking preorders for this game.

- Stadia takes preorders for another game releasing in Autumn.

- Stadia announced expansion to Mexico later this year.

- they are recruiting new staff.

CryZe··on Async Rust: What is a runtime? how Tokio works under the hood
You can always just do let no_async = block_on(something_async);
CryZe··on GitHub Copilot is generally available
> it just needs to filter out verbatim exact snippets so it only outputs original, unattributable code.

That's a setting now.

CryZe··on GitHub Copilot is generally available
You apparently can "opt out of public code" now. I didn't find an explanation for whether that properly limits it to permissive licenses though.

Update: It seems like they check whether the code it emits matches the training set and if it does it won't suggest it.

CryZe··on GitHub Copilot is generally available
You can opt out of that.
CryZe··on Rust: A Critical Retrospective
You can write libraries against alloc on stable, but not any executables, because executables not using std need to specify the alloc_error_handler, which you can't do on stable yet: https://github.com/rust-lang/rust/issues/51540
CryZe··on Rustc: Add do yeet expressions to allow experimentation in nightly
That's not all it does. It "breaks" to the nearest "try" barrier. It's basically the desugaring of the Err branch in the ? operator, that you can't currently express yourself. It's mostly relevant for try blocks. I guess you'd most commonly see this in "control flow like" macros that are similar to the ? operator, like various assertion macros that want to "yeet" an error in case the assertion fails (instead of panicking like those in std).

So in a sense it actually is very similar to `throw` in traditional languages, as it can be caught inside the same function and isn't forced to `return` the error outside the function.

CryZe··on Text Rendering Hates You (2019)
They just extended the COLR spec to COLRv1 which essentially is a whole new canvas API in fonts: https://github.com/googlefonts/colr-gradients-spec/blob/main...
CryZe··on C2rust: Transpile C to Rust
You can compile the C code to WASM and then compile the WASM to safe Rust (I wrote a prototype for this and it works). Though as with all WASM, it protects the environment from the C code, but the C code can still corrupt its own WASM memory. iirc Firefox is even starting to use this approach to sandbox some of its components (though they compile the WASM back to C).
CryZe··on Rust Moderation Team Resigns
No, that has been deconfirmed on Reddit: Edit 2 https://www.reddit.com/r/rust/comments/qzme1z/comment/hlne24...
CryZe··on C++ Coroutines Do Not Spark Joy
While I agree that Rust changed a lot, it was mostly fixing edge cases (like borrow checker limitations or associated types not being allowed to have generics) or obvious missing features in the language (const fn, const generics, async await) that have been known for a long time. Most of these have been implemented since then (at least in MVP form) to the point where there's barely any new ideas anymore and most old ones got implemented. So Rust really feels like it's nearing a "point of completion". You can see this with the Rust 2021 edition as well that contained very few changes.
CryZe··on A Rust optimization story
One thing that is stable is marking a function as cold which usually has the effect of marking the calling basic block as unlikely.
CryZe··on Things Go needs more than generics
One issue I've noticed is that indexing into a T[] array where T can't be undefined, results in the expression to be of type T, not T | undefined, despite an out of bounds index evaluating to undefined. I believe I've seen that they recently added a setting that changes this though.
CryZe··on Show HN: Go playground powered by WASM that runs in the browser
This was supposedly fixed by at least Safari 14.1 (or earlier).
CryZe··on Rust 1.55.0
Well arrays never allocate in the first place, but you'd need some sort of specialized iterator api that either:

- Handles the iterator not being the same size as the array you want to collect the iterator into and turns it into some sort of Result<[T; N], ArrayCollectError>.

- By itself knows the exact size of the iterator as part of the iterator type and thus can ensure via the type system that the iterator has exactly as many elements as the array needs.

CryZe··on GitHub Copilot is ‘unacceptable and unjust,’ says Free Software Foundation
Funnily enough I just used Copilot to write a reasonably huge PR (it did like 95% of the work), which was indeed mostly a copy paste job (the whole library is a SIMD library with lots of similarities between the different types and operations) and Copilot made zero mistakes when it didn't suggest something completely different whereas the human copy pasted code that was already in there had tons of mistakes that I noticed as I went through the library. So interestingly when it comes to code that is mostly copy paste, but requires some subtle changes here and there (based on the type and operation, ...), Copilot is much better at it than humans.
CryZe··on Linux Rust Support
I don't fully understand it either, but they seem to be merged into linux-next, whatever that exactly means.
CryZe··on Duolingo S-1 IPO
> Run out of hearts, you're restricted from proceeding further in your studies. You must buy hearts to stay on their platform.

This is not true. It just means you made enough mistakes that you should use their practice mode rather than continuing learning new stuff. The practice mode is entirely free and rewards you with new hearts.

CryZe··on Windows 11 will create heaps of needless trash
The equivalent list for Windows 10 is missing many CPUs that run Windows 10 just fine... so yeah I don't think this list means anything for the actual consumer.
CryZe··on Wasmer 2.0
It is also released in Firefox (x86 only, ARM is in the next release iirc)
CryZe··on IndexedDB is completely broken in latest Safari
WASM still needs IndexedDB (or other storage) to store data in the browser.
CryZe··on Methods for Array Initialization in Rust (2018)
There's also an open Pull Request for adding std::array::from_fn which calls the function / closure provided N times to initialize an array. This basically brings the array-init functionality into std.

https://github.com/rust-lang/rust/pull/75644

CryZe··on Six Years of Rust
The "was been" certainly is a typo at least.
CryZe··on Rust Language Cheat Sheet
This is actually planned already. Not sure how far along the implementation and progress to stabilization is though.
CryZe··on Show HN: Video Game in a Font
Chrome definitely supports them on Windows at least, I don't know if it supports them on other operating systems. Here's a test page for the various kinds of color font tables: https://yoksel.github.io/color-fonts-demo/
CryZe··on Show HN: Video Game in a Font
They could use the CPAL and COLR tables to turn each glyph / frame of the game into multiple RGBA layers.
CryZe··on Reflections on IDEA vs VS Code
rust-analyzer is not a compiler. They plan on sharing a lot of code though.
← PreviousPage 3 of 4Next →