13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions
comment 7y ago · link · parent
`foo.await!()` would just expand to `(await foo())`, and anyone could write their own `my_await!` macro that works similarly.
comment 7y ago · link · parent
The idea that syntax isn't a huge differentiator for languages is insane to me. Yes, small syntactic changes like "fun" vs "fn" may not matter overall, but obviously people choose languages based on what they can easily express by typing sourcecode.
Arguably, the difference between await syntaxes is closer to "fn vs fun" than "lazy vs strict", but I think that there's a lot of context that pushes it closer to the latter (we're talking about how a fundamental control flow primitive is implemented, and this will impact future control flow primitives).
comment 7y ago · link · parent
Alternatively, the syntax in Haskell just lends itself to lazy evaluation, and requires explicit annotation syntax to be strict. Contrasted with Python, which has a syntax that makes strict evaluation an easier default to express.
If all languages can express, with some effort, the same exact semantics as any other language, then the only difference is syntax.
comment 7y ago · link · parent
Syntax very obviously matters.
Besides, futures are very old in Rust at this point (relative to the language's age) and had been discussed years ago. The reason people aren't seeing those discussions is because they happened a long time ago but syntax happened a month ago.
comment 7y ago · link · parent
comment 7y ago · link · parent
An example,
> Convert something to an async operation and your system will always return a success response. But there's no guarantee that the request will actually ever be processed successfully.
Great! I don't want service A to be coupled to service B's ability to work. I want A to send off a message and leave it to B to succeed or fail. This separation of state (service A and B can't even talk to each other directly) is part of what makes queues so powerful - it's also the foundation of the actor model, which is known for its powerful resiliency and scalability properties.
The author's suggestion of using synchronous communication with backpressure and sync failures is my last ditch approach. I have to set up circuit breakers just to make something like this anything less than a total disaster with full system failure due to a single service outage.
Like the author, the "good use cases for queues" is very nearly 100% for me. I believe you should reach for queues first, and it's worth remodeling a system to be queue based if you can help it.
Sometimes modeling as synchronous control is easiest, but I'm happy that I can avoid that in almost every case.
comment 7y ago · link · parent
For example, an AWS Lambda triggered from SQS will lead to thousands of executions, each lambda pulling a new message from SQS.
But another consumer group, maybe a group of load balanced EC2 instances, will have a separate queue.
In general, I don't know of cases where you want a single message duplicated across a variable number of consumer groups - services are not ephemeral things, even if their underlying processes are. You don't build a service, deploy it, and then tear it down the next day and throw away the code.
comment 7y ago · link · parent
Then any new lambdas or other services that want to subscribe to messages will have another queue, and another, etc.
I haven't had a case where I had service groups coming up and down, I'm struggling to think of a use case.
comment 7y ago · link · parent
More importantly, we're almost always only paid to generate IP in a single domain. So if I go home and generate IP for a totally different domain, there's no reason why my employer should have any claim to it.
But many companies will have it in your contract that they own it, regardless of relevance to the company.
comment 7y ago · link · parent
I don't see a downside to this approach. Perhaps some increased latency?
comment 7y ago · link · parent
It's totally fine (and encouraged, in fact) to not pass every OKR, but I don't see any point to them. All of the failures of waterfall that everyone has always been aware of, but with the additional work of stating how you'll measure it, so that finance knows who to pay more.
comment 7y ago · link · parent
Been working under this system for 1.5 years and I think it's nothing but a detriment. I did research into doing OKRs "right", watched videos, really tried to give it a fair shake, too.
comment 7y ago · link · parent
For example, if I pass an argument into a function, it may be 'unexpected' that the argument is mutated - I can not reason about that mutation locally (unless it's very explicit or a known idiom such as push).
However, within a function, avoiding mutation seems pointless as you should have no trouble reasoning about it. At some point you really are just throwing away performance with significantly diminishing benefits.
Shared mutability across threads is definitely a huge pain in the ass though.
In the end I think we're all just trying to reduce the state space we have to manage in our heads when we read and write code, and removing mutability reduces that space.
comment 7y ago · link · parent
It's sometimes controversial to say "We should not prioritize tech debt" but I feel pretty strongly that it's true. We aren't paid to write beautiful code, we're paid to write code that gets the job done. If code is getting the job done, even if it's fragile, our job is done. Only if that code is impeding new work should we prioritize it.
comment 7y ago · link · parent
If you never touch code again, but that code was rushed and is ugly, there's no good reason to pay off the debt.
Similarly, if the code's getting thrown out (and if you design code to get thrown out), there's less reason to prioritize cleanup.
comment 7y ago · link · parent
I can't imagine that isn't the case for many others.
I think Go nails this with the multiple code samples.
edit: In retrospect, I'm sure this is beating a dead horse and you're all well aware of this. I wonder, instead, what the approach is to fixing these problems when they reach a standstill? It sounds like no one could agree, so progress halted.