Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

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

@insanitybit
Submissions

comment 6y ago · link · parent

This is the silliest thing I see paroted. Anonymous functions are there for one offs. Sometimes a one-off is two lines. Breaking it out into a separate function is ridiculous.

You end up seeing functions declared within functions so that people can work around this limitation and it is grotesque.

comment 6y ago · link · parent

I think most customers' biggest spend is on EC2, which is compute. Certainly this has been my experience.

comment 6y ago · link · parent

Notably, a lot of these companies are not just "playing around" with rust but it is already being used for critical projects.

It's pretty difficult to use AWS without touching rust code, for example, and impossible in the case of Dropbox.

comment 6y ago · link · parent

Non-paywalled link?

comment 6y ago · link · parent

Thanks.

comment 6y ago · link · parent

Nice. I tried building an actor library in rust, using proc macros. It ended up being super annoying to deal with generic actors.

Maybe I'll just write a proc macro over this lib instead.

* https://github.com/insanitybit/derive_aktor

edit: Is this not on crates-io?

comment 6y ago · link · parent

Users get compromised though and will want to revoke sessions. But this is why you just set a time limit on your JWT, so that they can revoke and within N minutes the old sessions will die. Just keep N low.

comment 6y ago · link · parent

Not dead. https://github.com/pypa/pipenv/issues/4058#issuecomment-5655...

comment 6y ago · link · parent

What's next? Moving away from silicon? I've always heard of Graphene as the next step but I know nothing about this stuff.

comment 6y ago · link · parent

Data centers absolutely care about power usage.

comment 6y ago · link · parent

In the case of the story the project was a total failure, so it's moot - in hindsight it is simply a fact (trusting the narrator of course) that the manager was incompetent.

comment 6y ago · link · parent

Escaping multiple times would be unnecessary with a type based system, by definition.

Sure, no one should need to do that anymore, it's just an example. There are many other cases that are similar, however.

`using` is a language construct, not something that is part of an interface. It also does not prevent close from being called twice.

comment 6y ago · link · parent

How would an interface guarantee that close is not called twice, or that you have escaped a string exactly once?

comment 6y ago · link · parent

Sorry, I'm not sure I understand at all the difference between this and the 'wat' stuff.

comment 6y ago · link · parent

I don't really see your point. Types can prove the absence of those bugs. "Writing good code" is not... anything.

comment 6y ago · link · parent

Yes, Python2 was called out explicitly. Reference equality is definitely 'wat' shit IMO, though it's really mainstream too.

comment 6y ago · link · parent

> When you order two incompatible types where neither is numeric, they are ordered by the alphabetical order of their typenames:

????????

comment 6y ago · link · parent

Rust can express state machines just fine, as well as refinement types (Python can do refinement types too), but yes, I agree that there's room for languages to build more ergonomic but advanced type systems.

comment 6y ago · link · parent

There is no good definition of a type error. It certainly goes beyond TypeError(Exception).

Is a '.close()' method being called twice a type error? It is in a language that can express states in the type system.

Is SQL injection a type error? It is when you use refined types in your sql library interface.

The vast, vast majority of errors I run into are errors that, with effort and the right type system, I could turn into type errors.

The point being that asking "would those be type errors?" is a really big question that is, when answered simply, "yes".

comment 6y ago · link · parent

Wonderful, that's great to hear, and I can move to 3.8 quite easily myself.

It's nice to see strong progress in such important areas. My post is probably overly critical, but I write Python almost every day, and maintaining a highly-typed library can be demoralizing at times.

comment 6y ago · link · parent

The 'py.typed' thing is extremely unintuitive, I package up python libs and I'm still not sure I've done it right.

Thank you for letting me know about those flags, I had not heard of them before!

comment 6y ago · link · parent

Here's my opinion, having written many thousands of lines of mypy code.

* Third party libraries are still not typed, which sucks

* Inference is weak. Sometimes an 'if' statement narrows accurately, sometimes it doesn't.

* Generics are extremely confusing, moreso than any other typed language I have used. Any Generics are even more confusing.

* Fundamentally, Python is structured such that the concept of interfaces are coupled tightly to implementation of classes, which is severely limiting. As an example, a module A can declare a class, a module B can declare an interface (Protocol), but module B can not implement that interface for A (without modifying A's code).

* Errors from mypy are still very very light. There are very few "Try XYZ to fix it", and it's just a single line of read text that amounts to an assertion.

* Still weak support for JSON (use Dict[str, Any])

* Slowly improving but still not amazing support for Self types

I could go on.

Mypy is awesome but it still feels very immature, and as it should since it's pre 1.0. It does not come close to matching the experience of other languages with static types.

comment 6y ago · link · parent

Python has is own 'wat' stuff, especially Python 2.

https://stackoverflow.com/questions/3270680/how-does-python-...

"CPython implementation detail: Objects of different types except numbers are ordered by their type names; objects of the same types that don’t support proper comparison are ordered by their address."

comment 6y ago · link · parent

Research is actually just all over the place (lots of papers come to many, many different conclusions), because it's impossible to control for various things like developer experience.

Instead, common sense is actually the best substitute we have.

comment 6y ago · link · parent

People are gonna dogpile you, but if you'd said this about JS they wouldn't have blinked.

comment 6y ago · link · parent

This isn't very interesting, at least no more interesting than any other disclosure that goes through H1.

If you're not familiar with disclosures and communication via H1 maybe this all feels very odd or bad or something, idk. Looks fairly standard to me.

Ultimately, to me, someone found a vulnerability, reported the vuln, and it was remediated within ~3 hours. There was no "breach", unless you consider every H1 report a breach?

Having a repository of vulns is quite a scary thing though. I often wonder, with all of the "wontfix" and "too low impact to care" bugs chained together, how easy is it to own many of these customers?

comment 6y ago · link · parent

Most bounty reports that I've seen end up as teaching opportunities around how to make more effective reports in the future, and it isn't considered "schooling" them.

comment 6y ago · link · parent

I'm not trying to use a 'gotcha'. This isn't an argument from authority, I'm trying to use my experience as a vehicle for understanding one facet of this topic.

My fundamental point is simply that failure is a matter of goals. For startup founders failure is something you are likely going to think about constantly as you ramp up to deciding to quit your job and put your idea out there, and that's a waste of time, and it's due to conflating different failures.

Once you move past that point, and start taking on more responsibilities, your goals have to shift if you're any kind of ethical person. While early employees may be willing to take on a lot of risk, and are fundamentally responsible for the choice to come on, it would be, as you said sociopathic, not to feel any kind of responsibility.

I think, given this statement, we likely agree? But then you criticized the article for being too "Feel good", which I think is a mistake. Yes it is "feel good", but maybe it's hard to understand why you need to frame things that way when you're putting yourself out there like this.

comment 6y ago · link · parent

It's not meaningful.

a) It's not even true. I pointed to a literal policy for this administration, which has been absolutely central to the controversy.

b) Even if it were the case, your issue is with the media, not the protestors. If I find out tomorrow that there's a problem, it is not really important to me that the problem began under X or Y administration, but that it persists under the current one.

c) You claim simultaneously that the media is biased and only covering the topic now, but then somehow blame people for only learning about the issue and caring about it now. Your issue is with the media, and that's fine, but it's not relevant to this at all. If you want to put the media on blast go nuts, this topic has nothing to do with the media or this administration.

1
127128129
164