HackerTrans
TopNewTrendsCommentsPastAskShowJobs

jcmoyer

no profile record

comments

jcmoyer
·2개월 전·discuss
There is a really convincing set of arguments against this idea by Robert Seacord[1]. I used to be in the signed size camp, but I've come around to preferring unsigned as much as possible because it's much easier to reason about. I think there are far more footguns than people realize when it comes to signed integers.

[1] https://www.youtube.com/watch?v=82jVpEmAEV4
jcmoyer
·작년·discuss
> logical operators do not short-circuit (so both sides of an or will execute even if the left side is true)

There are two syntaxes: `and` which doesn't short circuit, and `and then` which does. Ditto for `or` and `or else`.
jcmoyer
·2년 전·discuss
>Without compiler bugs, on stock Linux, you can achieve the same thing via /proc/self/mem.

The documentation addresses this case specifically: https://doc.rust-lang.org/stable/std/os/unix/io/index.html#p...

"Rust’s safety guarantees only cover what the program itself can do, and not what entities outside the program can do to it. /proc/self/mem is considered to be such an external entity..."
jcmoyer
·2년 전·discuss
Anecdotally, Chrome used to pin my hard drive at 100% usage until I killed a process called "software_reporter_tool.exe." I still have a version of the binary located at "%localappdata%\Google\Chrome\User Data\SwReporter\107.294.200" last modified 2022-11-02.
jcmoyer
·4년 전·discuss
Is the Rust compose backwards? Normally I would expect compose(f,g)(x) = (f∘g)(x) = f(g(x)), but in this post it's g(f(x)).

In Haskell for instance,

    (+2) . (*10) $ 2
    => 22
jcmoyer
·4년 전·discuss
Reading the manual, searching the stdlib for terms related to what I'm trying to do and reading tests, searching the issue tracker, and accidentally discovering things via LSP autocomplete. For higher level concepts that aren't implemented in language (like runtime polymorphism), I try to find examples of how it's done in the stdlib and copy that.