-
Notifications
You must be signed in to change notification settings - Fork 17.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: syscall/js: allow []float32
or other typed arrays to pass to js.ValueOf
#25532
Comments
@bradfitz and the Go team: How do you generally approach the question of whether to add some new API or not? What are the characteristics of idiomatic Go APIs? |
Well, if syscall/js has no API compatibility promises, it's less of an issue. I can't possibly list all the characteristics of idiomatic Go APIs briefly here in a comment. Basically it needs to look & feel like everything else in the standard library. But I see no reason we shouldn't be able to pass a |
/cc @cherrymui |
What's going on this? |
It seems fine to add other types as long as they are unambiguous and useful. Should we extend the set of supported types to include slices of all supported types? Will passing a slice always imply copying all the elements? |
I think supporting TypedArray (e.g.
What about |
There is no copying from I agree that we should add the other typed arrays (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays). |
Change https://golang.org/cl/121215 mentions this issue: |
This would be useful for WebGL functions: for example,
uniformMatrix4fv
acceptsFloat32Array
at the third argument.(This issue is copied from https://github.com/neelance/go/issues/19)
The text was updated successfully, but these errors were encountered: