News for hackers. Stuff that matters.
Re:Show HN: tere – A Faster Alternative to cd+ls by reaperducer on Friday July 15, 2022 @09:44AM (#32108115)
hashbrown, smawk, corasick, parking_lot, itoa, ryu

Writing in Rust looks like casting spells in an Infocom game.

Gnusto rezrov!

Re:Show HN: tere – A Faster Alternative to cd+ls by mynameisvlad on Friday July 15, 2022 @10:58AM (#32108846)
Really? itoa is one of your "magic incantations"?

https://en.m.wikibooks.org/wiki/C_Programming/stdlib.h/itoa

I get the others, but that ones a pretty standard type converter, the opposite of the C standard atoi

Re:Show HN: tere – A Faster Alternative to cd+ls by nicoburns on Friday July 15, 2022 @04:15PM (#32112275)
In fairness, C standard library functions mostly look like magic incantations to me (I think due in large part to the old-school convention of abbreviating function names). malloc, sprintf, atoi, etc don't exactly read like english... (unless you happen to already know what they stand for)
Re:Show HN: tere – A Faster Alternative to cd+ls by mgunyho on Friday July 15, 2022 @11:03AM (#32108893)
Also, aho-corasick comes from the name of this algorithm that is named after its inventors https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm
Re:Show HN: tere – A Faster Alternative to cd+ls by enriquto on Friday July 15, 2022 @11:03AM (#32108894)
What is the point of this function? In rust, there's no equivalent to sprintf?
Re:Show HN: tere – A Faster Alternative to cd+ls by mynameisvlad on Friday July 15, 2022 @11:07AM (#32108935)
https://doc.rust-lang.org/std/fmt/

Different tools for the same job. One is explicitly integer to string conversion the other is sting formatting.

You can technically use the latter, but some prefer a function which explicitly does one thing and one thing only.

Re:Show HN: tere – A Faster Alternative to cd+ls by pie_flavor on Friday July 15, 2022 @02:20PM (#32111232)
More accurately, some prefer a function that is statically dispatched and does not talk to std::fmt::Formatter.
Re:Show HN: tere – A Faster Alternative to cd+ls by MichaelCollins on Friday July 15, 2022 @12:10PM (#32109592)
atoi is a classic example of the sort of bad naming C has long been infamous for. It's not a word, it's an initialism, and the common documentation for it doesn't even say what the initialism actually means. It's relatively easy to infer what it means from the description of what it does (ascii to integer), but can easily be incorrectly inferred ([character] array to integer.)

C kind of gets a pass for this stuff because C was old and in the early days they were limited by token size. But to still be using this term today in a new language seems fairly derisible.