News for hackers. Stuff that matters.
Re:Memory usage of a toy C# server and client with 500K conc... by sifoobar on Saturday January 26, 2019 @08:17PM (#19009781)
The thing about Go is that you're always writing preemptively threaded code, with all of its issues.

The holy grail is cooperative multitasking and always-on, opt-out async [0] if you ask me.

[0] https://gitlab.com/sifoo/snigl#tasks

Re:Memory usage of a toy C# server and client with 500K conc... by weberc2 on Saturday January 26, 2019 @09:42PM (#19010083)
I guess I think of that as a feature, but I also write threadsafe code by default. It’s not an issue compared to our async python code. Someone calling a library that makes sync calls under the hood can block the event loop until the load balancer kills it. Same thing with CPU intensive tasks or just a lot of tasks on the event loop. Never mind the problems of async code in a dynamic language.
Re:Memory usage of a toy C# server and client with 500K conc... by int_19h on Sunday January 27, 2019 @05:24AM (#19011187)
> Never mind the problems of async code in a dynamic language.

Such as?

Re:Memory usage of a toy C# server and client with 500K conc... by weberc2 on Sunday January 27, 2019 @10:32AM (#19012021)
Forgetting the “await” keyword and trying to use a variable which now actually holds a future/coroutine as though it were the awaited future. We write tests to cover those cases.
Re:Memory usage of a toy C# server and client with 500K conc... by int_19h on Sunday January 27, 2019 @09:41PM (#19015059)
An interesting point. But this could be mitigated in a fairly obvious way by requiring an equivalent of "await" that is basically an identity transform for future-returning function calls (i.e. if a call is returning a future, you must always either explicitly indicate that you're awaiting it, or else explicitly indicate that you want the raw future - a naked call is an error).
Re:Memory usage of a toy C# server and client with 500K conc... by weberc2 on Wednesday January 30, 2019 @06:38PM (#19040809)
That wouldn't solve the problem at all--at best I'm getting a marginally clearer error message. It doesn't help me (the programmer) remember (before runtime) that my expression is evaluating to an async function and not a sync function. Whether I get the runtime error, "invalid call to async function" or "future has no property 'status_code'" is of little consequence.