For me the Rust code is easy to read. Personally I don't think it's reasonable to ask programming languages 'easy to read for people not familiar with them' / 'read like English' / or something similar.
Why is that? The number one reason I do not like Rust is the use of ', & and so on to represent something that would be trivial to implement with plain English.
I just have a hard time deciphering what the intention was with these single character things. Are you suggesting to use 'a_lifetime? What is that good reason? I usually use longer names to help the next person reading my code.
Rust was originally implemented in OCaml, and takes a lot of inspiration from it. The ‘a syntax is used by OCaml for generic type parameters.
Rust is in a weird spot because we have two different kinds of generic parameters: types and lifetimes. They need to be distinguished from one another somehow. Nobody loves the lifetime syntax, but nobody has ever proposed something that would end up significantly better.
I’m not proposing you should use ‘a_lifetime, I’m saying you could. In the end, it ends up obscuring more than helping.
> ...while baking in support for concurrent requests...
Timeout does not help here - if the api is for concurrent requests, it's bad that caller cannot do anything before `(the slowest request finished || timeout exceeded)`.
“People does not fight harmful ads for now“ does not mean coinhive should be added to web sites without users’ consensus.
And It’s more harmful than ads as users know explicitly whether there are ads on web sites and have a choice to not visit them anymore. But silently mining without warning users of that is worse.
You're confusing morality with legality. The morality regarding coinhive is a controversial topic, but its legality should still be defined under the rule of law. The Japanese police is acting on dubious legal grounds in arresting coinhive users given the lack of legal precedence and the vague wording of the law. Regardless of our opinions on coinhive, it is still worrying to see the police make arrests for seemingly arbitrary reasons.
That really depends; if it's communicated to the user that, by having the website open, they are mining cryptocurrency for the website owner as a sort of "payment" for being able to use the site, then that's totally ok. If they weren't informed, then it's still just a minor issue, at least compared to large-scale tracking of users that many other sites do.