Dan Korostelev

Results 234 comments of Dan Korostelev

> bind itself requires an additional allocation. as shown in the example right above - not always, because of immediately invoked function optimization.

What I like about my approach is that it's really generic and straightforward to both implement (in the compiler) and use (by simply writing suspending functions) and not tied to...

Oh and to answer your question, I see several approaches to await a CPS function and I'm really not sure which I would prefer. For a promise-like API I see...

Oops, I forgot about this discussion :) > ```haxe > suspend function doStuff() { > var a = awaitThxPromise(thxFunc(a1, a2)); > var b = awaitTinkPromise(tinkWebFunc(b1, b2)); > var c =...

It would be nice to look at what this generates in the end. For example, I think current Kotlin implementation would generate something like this: ```haxe // state-machine context var...

Error handling is a tricky subject indeed. Most often (e.g. js,c#,kotlin) it's implemented in coroutines by using try/catch syntax, which is a "natural" way to handle errors in the imperative...

That's an important thing to consider. However, having this always enabled will have a negative effect on performance, so maybe this should only be enabled with `-debug` or some other...

I agree the type should be non-null if possible. It's a bit tricky to handle for various scenarios, including nullable right-hand and abstract casts, but we should look into it.

FYI I still get this when working on macros sometimes, but it's much rarer after the fix! I'll try to provide an example next time I get it.