News for hackers. Stuff that matters.
Re:Performance Showdown: Rust vs Javascript (2020) by edflsafoiewq on Friday February 12, 2021 @07:22AM (#26112895)
IMO this is no small part of why C still has its reputation for speed. Think how you'd write this in C. Maybe

  /*
    Recursively removes doublets from input. A doublet is a pair of adjacent chars,
    identical or differing only in capitalization (eg. "aa" or "aA"). The result is
    written to output, which must be at least input_length bytes long.
    Returns the number of bytes in the result.
  */
  size_t remove_doublets(char * output, const char * input, size_t input_length);
and the body is a dozen lines of pointer pushing and tolower. Do you faff around with malloc? unicode case conversions? hashmaps??? Of course not, that would be too hard, so you just write the stupid C code. For all its faults, the C idiom really does push you towards the simple, stupid answer to code like this.
Re:Performance Showdown: Rust vs Javascript (2020) by ziml77 on Friday February 12, 2021 @09:17AM (#26113855)
That's also a problem with C though. Because the complex answer is such a pain to write, people go for the simple answer that doesn't handle all the cases that it actually should. Like ignoring Unicode case conversions means that it will only work as expected on English input.

Really, no matter what the language is, people need to actually put some thought into what they're doing.

Re:Performance Showdown: Rust vs Javascript (2020) by brundolf on Friday February 12, 2021 @11:56AM (#26115670)
Both good points. C gives you rope to hang yourself with when it comes to correctness; Rust gives you rope to hang yourself with when it comes to performance. Personally I prefer the latter, but awareness and understanding of what's really going on is important no matter what language you're using.
Re:Performance Showdown: Rust vs Javascript (2020) by bobthebuilders on Friday February 12, 2021 @05:56PM (#26119528)
The other thing is say algorithm selection. Some data structures may be more performant for the job at hand, but do you really want to package or build them yourself? A lot of the time the answer is no.
Re:Performance Showdown: Rust vs Javascript (2020) by higerordermap on Friday February 12, 2021 @10:32AM (#26114731)
Among new languages, zig aims to make all allocations obvious.