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

Is there a doc about that? Can they also not use external crates? Very curious.

comment 6y ago · link · parent

I don't get how that's ever possible, regardless of soundness issues. Can you not simply use unsafe in a capsule, and violate this constraint? The only way isolates in V8 manage to provide any isolation is because the runtime/ language forbid such things entirely.

I suspect it is not so simple as "Rust's safety ensures malicious rust code can't access data".

comment 6y ago · link · parent

I've been writing rust since just before 1.0 and I've never written a type signature like that. I understand it just fine (even though it is invalid, I get what they're saying), but yeah, never needed it.

It's both a good and bad thing that rust has these sort of deep areas where 95% of users won't ever have to go - Pin being another example. I think it's much more good than bad though.

comment 6y ago · link · parent

Unsoundness in Pin aside, I think the conversation between Boats and Ralph is more interesting - are soundness issues going to be so strange and edgecasey that they can be addressed as one-offs, or does rust need a more formal model to ensure edge cases are covered?

I have no answer, it's just the only interesting part of that discussion imo. Everything else is just details of an issue that's too weird to really fully understand for me, and not novel or interesting enough to invest into understanding, anyway.

comment 6y ago · link · parent

I write async code and I have never, ever used Pin.

comment 7y ago · link · parent

The article addresses the singular valid use case at the bottom.

comment 7y ago · link · parent

What should I use instead? JWT is so damn easy to set up.

comment 7y ago · link · parent

The top level error handler is

    inner_main().expect("it should work")

comment 7y ago · link · parent

Box<dyn Error> for life

comment 7y ago · link · parent

That doesn't absolve ES of providing basic security defaults.

comment 7y ago · link · parent

Other databases learned that not requiring a user/password upon install is completely irresponsible. ES and other dbs need to catch up ASAP, it's ridiculous.

Documentation is not security. If you need to "RTFM" to not be in an ownable state it's ES's fault.

comment 7y ago · link · parent

Yeah, I feel this way about French.

I want to like the language, but every time I try to read it I can't seem to understand what the words are trying to tell me.

comment 7y ago · link · parent

I don't get that sentiment from the article at all. The article is talking about the difficulty of targeting a problem space 'too early' vs 'too late'. Too early and you solve the wrong problem, too late and, well, the obvious.

comment 7y ago · link · parent

I think the key quote is this:

> "Shor's algorithm is the attack that was developed in the absence of a quantum computer,” Frincke said. “It's hard to predict what people will actually do with one."

Once QC actually manifests we may find new properties and new approaches to attacking existing algorithms, and being 'quantum hard' before that point is impractical.

I'm not a cryptographer by any means, so I have no idea if this is actually the case. Perhaps we understand the fundamentals so well that we can truly say an algorithm today can hold up in a QC world - I have no idea, that certainly sounds bold, but we do already have purported 'quantum hard' algorithms.

comment 7y ago · link · parent

> Now you've got to monitor your queue size (and ideally autoscale when the queue backlog grows), and have a dead letter queue for messages that failed processing and monitor that.

These are both trivial things to do though. I don't see how it's any more complex than monitoring a circuit breaker, or setting up CI/CD.

> Tracing requests is harder b/c now your logs are scattered around the worker fleet, so debugging becomes harder.

Correlation IDs work just as well in a queue based system as a sync system.

> You need more APIs for the client to poll the async state, and you need some data store to track the async state (and now you've got to worry about maintaining and monitoring that data store).

Not sure what you mean. Again, in the Amazon Cart example, your state is just the cart - regardless of sync or async. You don't add any new state management at all.

comment 7y ago · link · parent

> The level of complexity this introduces seems to be way higher than anything in the original article.

I don't find it very complex at all. You send a message to a service. You want to get some state after, you query for it.

> but anything that deals with the cart - things like checkout, removing from cart, updating quantities, etc. Adding to cart has to be mindful of queued checkout attempts.

How so? Those pages just query to get the cart's state. You'd do this even in a sync system. The only difference is that on the backend this might be implemented via a poll. On subsequent pages you'd only poll the one time, since the 'add-to-cart' call was synchronous.

> But by using asynchronous comms you're actually introducing more state into your application than synchronous comms.

I don't see how. Again, with the cart example, there is always the same state - the 'cart'. You mutate the cart, and then you query for its state. If you have an expectation of its state, due to that mutation, you just poll it. You can trivially abstract that into a sync comm at your edge.

    def make_sync(mutation, query):
        mutation()
    
        while not expected_state(query()):
            # handle retry logic/ timeouts

comment 7y ago · link · parent

> It's less obvious to me how your proposal lines up with things that are less so.

Usually you have a sync wrapper around async work, maybe poll based.

As an example, I believe that Amazon's "place in cart" is completely async with queues in the background. But, of course, you may want to synchronously wait on the client side for that event to propagate around.

You get all of the benefits in your backend services - retry logic is encapsulated, failures won't cascade, scaling is trivial, etc. The client is tied to service state, but so be it.

You'll want to ensure idempotency, certainly. Actually, yeah, that belongs in the article too. Idempotent services are so much easier to reason about.

So, assuming an idempotent API, the client would "send", then poll "check", and call "send" again upon a timeout. Or, more likely, a simple backend service handles that for you, providing a sync API.

Going from Sync to Async usually means splitting up your states explicitly.

For example: Given two communication types: Sync (<->) Async (->)

We might have a sync diagram like this:

A <-> B

A calls B, and B 'calls back' into A (via a response).

The async diagram would look like one of these two diagrams:

A -> B -> A

or:

A -> B -> C

Whatever code in A happens after what the sync call would have been gets split out into its own handler.

If your system is extremely simple this may not be worth it. But you could say that about anything in the article, really.

comment 7y ago · link · parent

One thing missing here is to avoid synchronous communication. Sync comms tie client state to server state; if the server fails, the client will be responsible for handling it.

If you use queue-based services your clients can 'fire and forget', and then your error handling logic can be encapsulated by the queue/ consumers.

This means that if you deploy broken code rather than a cascading failure across all of your systems you just have a queue backup. Queue backups are also really easy to monitor, and make a great smoke-signal alert.

The other way to go, for sync comms, would be circuit breakers.

My current project uses queue-based communications exclusively and it's great. I have retry-queues, which use over-provisioned compute, and a dead-letter for manually investigating messages that caused persistent failures.

Isolation of state is probably the #1 suggestion I have for building scalable, resilient, self-healing services.

100% agree with and would echo the content in the article, otherwise.

edit: Also, idempotency. It's worth taking the time to write idempotent services.

comment 7y ago · link · parent

I've stopped using my real name. My last name has an apostraphe, and at this point I'm just sick of websites rejecting it and then forcing me to refill in all of my information.

So, now I drop the apostraphe.

In high school my school ID was completely broken. It printed <first half of last name> <first letter of last name> <middle name> <first name>.

They ended up putting a quotation mark instead of the apostraphe - somehow the machine handled that fine. That was the workaround.

Hotel wifi systems tend to break if they ask for a last name to connect. Again, training me to reserve the hotel under a 'fake' last name.

I actually notice it every time I write my last name. I'm like "is this a system that will break" and now I'm inclined to just never use the "real" spelling because then I'll get a mismatch later on.

This is something I've really noticed over the last decade. The older I get, and the more systems become a part of my life, the more systems I have to give a fake name. Paper records will show my true name, but I wonder if at this point, given digital records, what it would appear to be.

comment 7y ago · link · parent

Chrome was the first browser to sandbox Flash. That was huge for security.

comment 7y ago · link · parent

I told everyone I could to use Chrome because the risk of being infected by malware was radically lower. Flash 0days used to be so common, I know plenty of people who'd get hit. Java plugin was the other big one and Chrome had it click to play early on IIRC.

Chrome had a massive advantage over Firefox, security wise, for quite a long time.

comment 7y ago · link · parent

Oh shit, yeah, Windows software used to not ever autoupdate I forgot about that.

comment 7y ago · link · parent

It's a little silly to ignore the impact that Chrome had on the browser market. A from-scratch multiprocess architecture, considerable performance improvements, a fairly significant departure with UI, etc.

Sandboxed flash was huge at the time. People forget so quickly that only a decade ago the internet was a lot more malicious. Exploits hosted on compromised ads were not uncommon at all. These days all of the big exploit kits rely on social engineering.

Those were very appealing things for many people, rightfully so.

comment 7y ago · link · parent

Compilers can "avoid" the halting problem if the underlying language is not turing complete/ can express function totality.

You can even express algorithmic complexity in a language.

But it's a bit more complex than that, really. You will have a harder time saying "this loop will block the event system for longer than I'd like".

comment 7y ago · link · parent

Hot loops are often "expensive", or where your program is spending a lot of its time.

If you're doing a hot loop, which may be synchronous, you will block the event loop attached to that OS thread, because a hot loop is presumably not yielding control until it is done.

comment 7y ago · link · parent

What are good alternatives?

comment 7y ago · link · parent

They're just saying most people don't care about AMP, a relatively dumb and opaque issue when compared with environmental issue.

comment 7y ago · link · parent

As someone who has recently quit their job to start their own business, healthcare has been a huge barrier. I'm so, so lucky that I'm healthy enough to go on cheaper insurance and that I have people who can help me navigate the absurdly complex system of plans out there to pick a sensible one.

I know lots of other people who are petrified of losing their job because they aren't as healthy as I am.

comment 7y ago · link · parent

Your entire post feels like a boomer meme. You're just telling people to be happy with their job, ignore feeling miserable, and how much worse they could have had it.

comment 7y ago · link · parent

There was likely a sandbox escape.
1
129130131
164