Live data from Hacker News

Viewing profile — kprotty

kprotty

HN member
Joined
Wed, Nov 27, 2019, 5:05 PM UTC
HN karma
180
Public activity
59 items

About kprotty

No profile information was provided.

Recent public activity

  1. comment
    Comment #47335748

    Zig gives things we really dont have yet: C + generics + good const eval + good build system + easy cross compilation + modern niceties (optionals, errors, sum types, slices, vecto…

  2. comment
    Comment #47335699

    There are places a language could be a better fit, but which haven't adopted it. E.g. most languages over typescript on the backend, most systems programming languages over Java fo…

  3. comment
    Comment #47335352

    Yes, I've written a few unsafe-focused crates [0], some of which have been modified & merged into the stdlib [1] [2] exposing them to the fringe edge-cases of Rust like strict prov…

  4. comment
    Comment #47332680

    I've worked on two "production" zig codebases: tigerbeetle [0] and sig [1]. These larger zig projects will stick to a tagged release (which doesn't change), and upgrade to newly ta…

  5. comment
    Comment #46037840

    > so you have no clue if the shared data might be incompletely modified or otherwise logically corrupted. One can make a panic wrapper type if they cared: It's what the stdlib Mute…

  6. comment
    Comment #44211354

    C++'s `::` vs Zig's `.` C++'s `__builtin_` (or arguably `_`/`__`) vs Zig's `@`

  7. comment
    Comment #42963199

    There's compiler-level traits like `Iterator` and `Future` which enforce references. If wanting to do intrusive pointers into them, one risks creating overlapping references: https…

  8. comment
    Comment #40955475

    Tokio's focus is on low tail -latencies for networking applications (as mentioned). But it doesn't employs yield_now for waiting on a concurrent condition to occur, even as a backo…

  9. comment
    Comment #38243604

    Thanks, seems like most are from LLVM or packed structs.

  10. comment
    Comment #38229049

    Are there any links / examples for the miscompilations?

  11. comment
    Comment #38039294

    > Green threads give you all the advantages of async They require more memory over stackless coroutines as it stores the callstack instead of changing a single state. They also all…

  12. comment
    Comment #37451204

    This would imply a single/global runtime along with an unrealistic API surface; For 1) It's common enough to have multiple runtimes in the same process, each setup possibly differe…

  13. comment
    Comment #37447834

    Preemption simulates localized concurrency (running multiple distinct things logically at the same time) not parallelism (running them physically at the same time). You can have co…

  14. comment
    Comment #37447757

    getaddrinfo() is a synchronous function that can do network requests to resolve DNS. The network property isn't reflected in its function signature becoming async. You can have an …

  15. comment
    Comment #37447731

    no, .Wait in C# or block_on in Rust keep the caller sync while evaluating the async callee, preventing the "bubble up".

  16. comment
    Comment #37447710

    > The main problem is that tokio futures are 'static An important distinction to make is that tokio Futures aren't 'static, you can instead only spawn (take advantage of the runtim…

  17. comment
    Comment #37447540

    Replacing Pin with Rc is what they refer to as "Arc shit up". Pin avoids the need for a heap allocation like Rc/Arc entirely.

  18. comment
    Comment #37447441

    Tokio and glommio using interrupts is ironically another misconception. They're cooperatively scheduled so yes, a misbehaving blocking task can stall the scheduler. They can't real…

  19. comment
    Comment #37447310

    The cost of switching goroutines, rust Futures, Zig async Frames, or fibers/userspace-tasks in general is on the other of a few nano-seconds whereas it's in the micro-second range …

  20. comment
    Comment #37447197

    Both qualify for writing tiny web servers, cli/byte-manipulation scripts, server automation jobs, in-house GUI applications, and other small stuff. Could technically argue that the…

  21. comment
    Comment #37447069

    1) That's no longer "running async code in Drop" as it's spawned/detached and semantically/can run outside the Drop. This distinction is important for something like `select` which…

  22. comment
    Comment #37443666

    > what prevents it from ensuring that a runtime is present when it does? The runtime being a library instead of a language/compiler level feature. Custom runtimes is necessary for …

  23. comment
    Comment #37443612

    To run async in Drop in rust, you need to use block_on() as you can't natively await (unlike in Go). This is the "blocking on Drop" mentioned and can result in deadlocks if the asy…

  24. comment
    Comment #37443598

    Not sure I follow; the cancellation logic is on both threads/tasks 1) the operation itself waiting for either the result or a cancel notification and 2) the cancellation thread sen…

  25. comment
    Comment #37441386

    You cancel a sync IO op similar to how you cancel an async one: have another task (i.e OS thread in this case) issue the cancellation. Select semantically spawns a task per case/va…