Readit News logoReadit News
krukah commented on Understanding Rust Closures   antoine.vandecreme.net/bl... · Posted by u/avandecreme
andy_xor_andrew · 2 months ago
if I'm not mistaken (and I very well may be!) my primary confusion with closures comes from the fact that: the trait they implement (FnOnce / Fn / FnMut) depends entirely upon what happens inside the closure.

It will automatically implement the most general, relaxed version (FnMut I think?) and only restrict itself further to FnOnce and Fn based on what you do inside the closure.

So, it can be tricky to know what's going on, and making a code change can change the contract of the closure and therefore where and how it can be used.

(I invite rust experts to correct me if any of the above is mistaken - I always forget the order of precedence for FnOnce/Fn/FnMut and which implies which)

krukah · 2 months ago
Easiest mnemonic to remember precedence is simply ordering by the length of their names.

FnOnce

FnMut

Fn

krukah commented on Terrence Malick's Disciples   yalereview.org/article/bi... · Posted by u/prismatic
krukah · 3 months ago
Tree Of Life is nothing short of a masterpiece IMO. Influential on me personally as my first exposure to how much editing and structure (or lack thereof) build directorial style. It left an impression on me to feel so much for a film that explicitly says so little.

Obligatory mention of that iconic low-angle shot of The Mother floating gracefully across the plains. One of the best of all time.

krukah commented on Rust in Android: move fast and fix things   security.googleblog.com/2... · Posted by u/abraham
tick_tock_tick · 4 months ago
I mean we know for sure Rust is unsafe there is whole bug tracker dedicated to all the ways it's unsafe. My favorite is that you can cast any lifetime to static no matter how short it actually is in 100% safe Rust.

(doesn't mean it's not an improvement on C++)

krukah · 4 months ago
I think referencing the well-known cases in cve-rs[1] is quite a bad faith effort. Of course if you try reeeally hard to write unsound code, you can write unsound code. An edge case in the type system downstream of lifetime variance rules is simply not something that matters in any practical attempt to write safe software. I find the tracker interesting since it probes the boundary of the compiler, but it says absolute nothing to the effect of "Rust is unsafe".

[1] https://github.com/Speykious/cve-rs

krukah commented on Ask HN: Who is hiring? (November 2025)    · Posted by u/whoishiring
krukah · 4 months ago
Novig | Multiple Roles | New York | Onsite | Full-time

Novig is rebuilding sports betting from first principles as a prediction market exchange. Legacy sportsbooks are extractive middlemen with misaligned incentives, dark patterns, and predatory mechanics. We're creating the alternative: a transparent exchange where users trade against each other at fair odds.

We're building core infrastructure around order routing, risk management, data pipelines, low-latency networking, and market integrity at scale. We write Rust extensively. We believe correctness, performance, and expressive code are necessities rather than luxuries. Ideal candidates care deeply about infrastructure, security, and performance. It certainly won't hurt to also care about prediction markets, traditional markets, or well-designed distributed systems.

Tech stack: Rust, Node, PostgreSQL, Kafka, Linux, distributed systems.

jobs@novig.co | https://job-boards.greenhouse.io/novig/jobs/4588745006

krukah commented on Uncertain<T>   nshipster.com/uncertainty... · Posted by u/samtheprogram
krukah · 6 months ago
Monads are really undefeated. This particular application feels to me akin to wavefunction evolution? Density matrices as probability monads over Hilbert space, with unitary evolution as bind, measurement/collapse as pure/return. I guess everything just seems to rhyme under a category theory lens.
krukah commented on Comptime.ts: compile-time expressions for TypeScript   comptime.js.org/... · Posted by u/excalo
apatheticonion · 7 months ago
I literally just want Rust style macros and proc macros in JavaScript. e.g. using

``` const MyComponent = () => jsx!(<div></div>) ```

rather than a .tsx file.

That or wasm to be usable so I can just write my web apps in Rust

krukah · 7 months ago
Maybe the (relative) lack of ecosystem has kept you away, but I really recommend checking out both Dioxus and Leptos. Leptos is incredibly similar to React, but with Rust ergonomics, and it's been a pleasure to learn and use. With an LLM by my side that knows React and Rust pretty well, I've found myself not even needing the React libraries that I thought I would, since I can easily build on the fly the features/components I actually need.

I too, eventually gave up on React <> WASM <> Rust but I was able to port all my existing React over into Leptos in a few hours.

krukah commented on Peacock feathers can be lasers   science.org/content/artic... · Posted by u/ohjeez
krukah · 7 months ago
Yesterday was Pigeons As Hard Drives, today is Peacocks As Lasers.

I look forward to what tomorrow brings.

krukah commented on Numbering should start at zero (1982)   cs.utexas.edu/~EWD/transc... · Posted by u/checkyoursudo
IshKebab · a year ago
That's a very confused way of thinking about it IMO. I say:

* Start from 0 if you are indexing. I.e. you are identifying an item or its position.

* Start from 1 if you are counting. I.e. you are saying how many items there are.

It doesn't matter what it is. I don't know why you think pages in a book are somehow different to memory addresses.

krukah · a year ago
You know what I like this much better...rule of thumb updated.
krukah commented on Numbering should start at zero (1982)   cs.utexas.edu/~EWD/transc... · Posted by u/checkyoursudo
krukah · a year ago
Whenever I explain to someone when or why to use 0-indexing, I like to say:

Start from 0 if you are counting boundaries (fenceposts, memory addresses)

Start from 1 if you are counting spaces (pages in a book, ordinals)

Floors are a case where both make intuitive sense, which is maybe how we ended up with European vs American floor numbering.

u/krukah

KarmaCake day132March 21, 2022
About
co-founder & cto @ novig obsessively curious
View Original