Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
noncoml
on Oct 27, 2019
|
parent
|
context
|
favorite
| on:
Why async fn in traits are hard
Not in dynamic languages, ie JavaScript
littlestymaar
on Oct 27, 2019
[–]
It is. It's not visible if you the types aren't written, but under the hood, that's the type of things like this.
noncoml
on Oct 27, 2019
|
parent
[–]
Ehm. No. JavaScript will return a Promise. It’s “type” is Object as pretty much anything else in JavaScript.
endless1234
on Oct 27, 2019
|
root
|
parent
|
next
[–]
But isn't a Promise for all intents and purposes the same as a Future here?
marcoms
on Oct 27, 2019
|
root
|
parent
|
next
[–]
Yes, but I think they are emphasising that only a promise will be returned. Any further type information is not given
wwright
on Oct 27, 2019
|
root
|
parent
|
prev
[–]
Check out structural typing. I would say it’s the type system JavaScript uses for non-primitive values. The “dynamic” appearance is just that JavaScript doesn’t center the type system in its UX.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: