Considering that it seems to be a "best practice" to use async functions whenever remotely required, it would be bad developer experience (and lead to unwanted results) to make people do extra work to use it.
And what major issues and downsides this has. One I can identify it would be non obvious on how to do `map` on a Future/Promise, because there is none. So there is no easy way to execute on the green thread code with the result of the remote call, e.g.
let f = asyncFuture()
f.map(|v|: v + 1) // executes also async
let s = await m
println(s)
If f is transparently handled as a future, this is no longer possible, we would have: let s = asyncFuture()
s = s + 1 // not async
println(s)
One would also, to be safe, always use immutable data structure and copy semantics on other classes (e.g. functional lenses and prisms everywhere transparently) - with the performance impact of immutable data structures.It's not an issue with explicit async/await model, because that one desugars into callbacks, which can be described entirely in terms of the already-existing C ABI that is the baseline for FFI in any modern language.
How will developers cope with that?
The javascript threading model is that there is a single thread executing so within a given bit of code you can be reasonably sure things are safe. The hyperscript runtime only allows one instance of a given event handler to execute at a time (unless otherwise specified) so the primary source of concurrency issues (the same code executing concurrently) is typically not an issue. By structuring your code such that it is on the same element (perhaps triggered by events elsewhere) you can effectively synchronize code in an intuitive manner.
I certainly wouldn't recommend the language for the back end though!
Admittedly, this was back-end, so it's possible that the situation is simpler in the front-end.
Good luck with your project!
As a side-note, some forms of data races (for perhaps a slightly looser definition of the term) can even happen without explicit asynchronicity, just with callbacks/synchronous events.
I am working on a front end scripting language that does try to make this stuff invisible:
https://hyperscript.org/docs/#async
It's slow as all get out, but it does, for the most part, hide all the async stuff from the script writer so they can write stuff like:
And all the async stuff in there (the fetch, the wait, the transition) all happen w/o callbacks, async annotations, etc.