Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 7y ago · link · parent

Interesting, but I wonder how this works in purely namespaced systems - if non standard names are more popular in, say, maven.

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

> Empirically, libraries with unique names are more popular than ones that aren’t.

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

> B) It encourages creative names

Who wants this?

comment 7y ago · link · parent

> What other kinds of safety does it provide?

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

Your original comment:

> 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

> One point is that the rewrite itself costs developer time that could be spent on something else.

But they're already advocating for a rewrite, just within the same language.

comment 7y ago · link · parent

I didn't attempt to qualify "importance" of the method, only give one example where Rust provides a safety mechanism that other languages do not; the ability to encode finite state machines into the type system with no risk of reusing invalid states.

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

> If browsers had remained sane

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

A type system that encodes FSTs makes it impossible to express invalid state transitions, hence the safety.

Anyway, I'm only clarifying that the parent poster was explicitly talking about safety outside of memory safety.

comment 7y ago · link · parent

Meh. There are probably very few C++ codebases that have received more security attention than those of browsers like Firefox. Bug bounties, fuzzing, tons of hardening work.

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

> Memory safety is certainly not the only kind of safety, but it is alas the only kind of safety supported by Rust (and every other language except C and C++).

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

There are entities out there sitting on hundreds of 0days. Governments buy hundreds every year.

Things aren't really getting much better either, so yeah, could totally crumble.`

comment 7y ago · link · parent

Oh, ok. I really wasn't sure.

comment 7y ago · link · parent

But the article addresses this by saying that the vast majority of rules never get used?

comment 7y ago · link · parent

AFAIK the new proposal allows dynamic filtering, which addresses the primary concern with adblocking tools like uBlock, I believe.

> 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

Unused imports are something I have all over my codebase before I get it to production. It's not worth dealing with in my development loop, and it would just be an annoying distraction

comment 7y ago · link · parent

I assume it's taking stack traces/ core dumps from stripped binaries and adding back the symbols.

comment 7y ago · link · parent

Oh neat, I wasn't aware. Thank you.

comment 7y ago · link · parent

I don't think Iron is even supported anymore, but for one thing, last I checked, Iron was based on OS threads primarily whereas Actix has a (I believe) pluggable runtime, which supports async.

comment 7y ago · link · parent

Why would this undermine their efforts? It seems totally reasonable to say "You can't just sell a hosted version of this yourself". Anyone who was planning to use Cockroach still can, it even seems that you could be a CockroachDB shop that provides consulting services, so long as you don't manage and host it.

comment 7y ago · link · parent

I think you're missing my point, so let's specify a bit more of a threat model.

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

No it isn't, there isn't any specified threat model anyway.

What we're talking about is whether malicious extensions are something attackers want to use. Having to package an entire browser is a win - it's super noisy and means there's a huge binary to lug around.

comment 7y ago · link · parent

Hi I work on a security team that hunts for malware. Malicious extensions are a huge threat - totally happens for Chrome in particular, and I've even seen malware package old versions of browsers to get around the modern defenses.

comment 7y ago · link · parent

> The key issue, then, is for people running other filesystems in Linux. And especially for *BSD users.

Correct.

> Then storing that 500GB (or whatever) file in Dropbox.

Sure, Dropbox can handle that.

comment 7y ago · link · parent

> With LUKS, you'd want to backup the locked partition, perhaps as an image. And that's just a binary file.

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

That seems very misleading. Ubuntu 18.04 doesn't even support ecryptfs (as far as I know, certainly it isn't the default), and it was not recommended for years prior because it's not a very solid protection (for many reasons).

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

> to be better than

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

> `foo.bar.qux.qaz.await!()` would need to expand to `await { foo.bar.qux.qaz }`

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

Postfix macros are a great feature in general, if accepted later. This would open the door for them, and you'd get things like:

    "{} + {}".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.

1
135136137
164