13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions
comment 7y ago · link · parent
I don't know. I'm unconvinced that this is a meaningful metric, and I worry more about typosquatting/ malicious dependencies, which, to my knowledge, crates.io does almost nothing to proactively deal with.
comment 7y ago · link · parent
Seems like this is survivorship bias. All of the common names get squatted by people who never push code, and then anyone who's actually going to build something will need to pick something unique.
Reqwest is more popular than request, for example. It's not exactly what most would expect, and if you search "request" you get the much less popular crate.
comment 7y ago · link · parent
I'm confused because the entire thread is about answering this question and I even detailed it explicitly in the previous post.
It provides the safety from invalid state transitions in the form of opt-in state machine type encoding.
What else is there to discuss? I just gave you a concrete example, which you challenged on the basis that it was not impactful, so I provided you research showing otherwise.
comment 7y ago · link · parent
> I see this statement is oft repeated on HN, but no proof is offered in its support.
Where "this statement" refers to
> It’s more safe than those languages because of its type system. Memory safety isn’t the only kind of safety, after all. :)
To paraphrase, you did not have proof that Rust had features that enabled safety beyond memory safety. I gave you an example of such a feature, and explained how it provides a type of safety beyond memory safety.
> And the lack of evidence in this area
There's plenty of evidence. Abstractly, the "program is in invalid state but continues" is a huge error in general.
More concretely, in terms of research,
https://www.microsoft.com/en-us/research/blog/p-programming-...
I could likely find thousands of other applications of FSMs (or papers on the subject) for safety critical work.
Here's one of the first results when I looked,
https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/201600...
> To this end, state machine analysis offers a method to support engineering and operational efforts, identify and avert undesirable or potentially hazardous system states, and evaluate system requirements.
I don't really feel the need to argue that state machines are a powerful tool for improving correctness of code. I think I've already addressed that Rust provides safety features that are:
a) Not easy to express in other mainstream langauges
b) Do not fall into the category of memory safety
comment 7y ago · link · parent
Whether you care about that or think it's valuable does not change that it is a way of encoding a model into your type system to make a class of errors impossible.
comment 7y ago · link · parent
This has no bearing on the issue. Yes, browsers are fast moving codebases. No one is arguing otherwise.
> In 10 years Firefox will perhaps be 50% Rust and still full of vulnerabilities.
Someone has already cited a case study from Mozilla showing a significant improvement in memory safety for components moved over to Rust, so all evidence at this point is to the contrary.
comment 7y ago · link · parent
It's really just not accurate to say "they weren't writing good C++" or "it's a legacy codebase". Those could both be true things, but it's totally glossing over the hundreds of millions of dollars invested in fixing that codebase.
comment 7y ago · link · parent
I think the parent poster's entire point was that Rust does provide safety beyond memory safety. Perhaps not as a forced concept, ie: you do not have to express all structures as finite state machines, but you can very elegantly express your structures as finite state machines. And you can do so in a way that most other languages can't, because of affine types.
comment 7y ago · link · parent
> The Declarative Net Request API now allows for the registration and removal of dynamic rules - specified at runtime rather than statically in the manifest. We’ve also added the capability to remove common tracking headers, such as Referer, Cookie, and Set-Cookie.
https://blog.chromium.org/2019/06/web-request-and-declarativ...
My opinion though is that if you were going to switch over this, just switch anyway.
comment 7y ago · link · parent
comment 7y ago · link · parent
Attacker has code execution on your system and wants to maintain persistence and exfiltrate sensitive browser data. Sounds reasonable for Mozilla - at least, it's not totally nuts of them to consider this in their threat model.
One avenue, and a popular one, is to then sideload a malicious extension. An attacker who can disable the extension check can do this easily. An attacker who can't has to resort to other means - packaging a separate payload to host the extension.
Does that sound reasonable? I don't want to argue, just to explain my perspective on this issue based on the attacks I have seen.
comment 7y ago · link · parent
I don't think the files get backed up encrypted, they get backed up decrypted, and are encrypted at the filesystem layer only.
It isn't as if you can't put encrypted data into Dropbox, this is just about filesystems.
> What about ext3, xfs, etc?
To my knowledge these are not supported filesystems, but there's probably an official doc stating this somewhere.
> Encrypted files (7zip, GnuPG, VeraCrypt, etc) behave just like normal files, right?
Sure, throw them into a Dropbox folder and they should upload just fine.
comment 7y ago · link · parent
If you use ext4 + luks encryption I believe Dropbox works fine.
Standard disclaimer, I work at Dropbox, but I have absolutely nothing to do with product. Opinions are my own etc etc
comment 7y ago · link · parent
I do, especially in terms of writing. It's quite annoying to 'wrap' things, in my opinion. This is why chaining is desired to begin with - people consistently prefer to append new code than to wrap.
> Similarly with `result.try!()`, that does not look as nice to me as `result?`.
I also prefer ?. 'try' is so common it's worth optimizing down to a single character.
My point is to compare to the prefix try, not the question mark, as a motivator for where postfix macros are a reasonable concept.
> let result = sendRequest().await!()?.getBody().await!()?.Root;
It's an additional 3 character per 'await' vs the other syntax, which I think is fine - a small price to pay for a syntax that makes sense. If await were so common, I would once against think a sigil is the way to go, but I don't believe that await justifies that level of optimization at this point.
comment 7y ago · link · parent
Interesting point, thank you. I hadn't seen this previously mentioned, and it's definitely a reasonable argument.
> there's no denying that `foo.await?.bar` appears nicer than `foo.await!()?.bar`, especially if there is no guarantee that postfix macros will ever become a thing.
Agreed, for sure. I'm honestly just very concerned about these features because I see them as stepping stones to others. The path from postfix macros seems much brigher than the path from postfix keywords.
I think I agree with you about an await block being a good idea.
Thanks for the response, I think this is the first meaningful response to the prefix await + postfix macro that I've read.
comment 7y ago · link · parent
"{} + {}".format!("foo", "bar")
and other niceties. It would have also solved the try macro's issues, like: result.try!()
etc. There are plenty of use cases where postfix macros are awesome.Macros are already a known control flow mechanism, so a postfix macro should be very easy for both new and old rust users to understand.
It isn't a fake field access, so it's already a step ahead of the competition.
And you get prefix await, which every other language uses, and this addresses the singular argument against macros being used (which is that the macro could not be implemented by users), though I never felt that it was a strong argument anyway.
I don't want to go back and forth discussing it. It isn't happening. I was just curious if the prefix await would have addressed that one argument.