-
Notifications
You must be signed in to change notification settings - Fork 453
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
int array -> Int32Array, bytes -> UInt8Array, float array -> Float64Array #258
Comments
same for floatArray. there is a caveat for FloatArray.map -- in the standard api, you can not change its type |
since typedarray is an essential feature, maybe we should have a flag |
@bobzhang is this anywhere on the current roadmap? It has been idle for quite a few years now. I'm considering using ocaml-protoc (which has BuckleScript support) but the representation of |
it’s slow but it should work?
Andrew Herron <notifications@github.com>于2020年6月9日 周二下午12:29写道:
@bobzhang <https://github.com/bobzhang> is this anywhere on the current
roadmap? It has been idle for quite a few years now.
I'm considering using ocaml-protoc
<https://github.com/mransan/ocaml-protoc> (which has BuckleScript
support) but the representation of bytes as a number array instead of
UInt8Array is not going to work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#258 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFWMK5NE7S7DLUS6BAZWLLRVW3CFANCNFSM4CBEAOEQ>
.
--
Regards
-- Hongbo Zhang
|
I guess "works" isn't the word I meant. I'm sure it meets the requirements, or it wouldn't be in the codebase, but slow isn't an option for me. |
Need more of such spirit around =D |
@chenglou I am aiming to blow some socks off when I finally release what I've been working on 😂 To be more specific about why slow isn't an option, protobuf uses byte arrays for the messages. It needs to serialize, deserialize, encode and decode to and from them constantly. I'm using |
Note bytes does not need special treatment from the compiler.
For your use case, you can use your own module for UInt8Array.
We are open minded to replace bytes module's implementation with a new one
on top of UInt8Array, notably changing `stdlib-406/bytes.ml`, are you
interested in sending a PR?
…On Fri, Jun 26, 2020 at 1:55 PM Andrew Herron ***@***.***> wrote:
@chenglou <https://github.com/chenglou> I am aiming to blow some socks
off when I finally release what I've been working on 😂
To be more specific about why slow isn't an option, protobuf uses byte
arrays for the messages. It needs to serialize, deserialize, encode and
decode to and from them *constantly*.
I'm using protobuf-js and some custom bindings to UInt8Array at the
moment, but it would be nice to have auto-generated bindings with
ocaml-protoc. That may also save some of the bundle size protobuf-js
brings along for the ride.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#258 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFWMKYIPFFX6NTI5UX2QE3RYQZ3PANCNFSM4CBEAOEQ>
.
--
Regards
-- Hongbo Zhang
|
I'm not sure what you mean by I admit I haven't actually tried to use I assume there's more to this than changing the |
I meant you can avoid using bytes module as a work around.
The compiler basically treat bytes as an abstract type, changing the `
bytes.ml` implementation should be almost there
…On Mon, Jun 29, 2020 at 11:38 AM Andrew Herron ***@***.***> wrote:
I'm not sure what you mean by For your use case, you can use your own
module for UInt8Array. 🤔
I admit I haven't actually *tried* to use ocaml-protoc yet, this was just
a flag that came up in our task to investigate it. I might start compiling
it with BuckleScript and hit some other blocker. I'm scheduled to look at
that in more detail in a month or so, if it looks like the way we want to
go then yes I can try to make a PR.
I assume there's more to this than changing the bytes.ml implementation?
Wouldn't the underlying bytes type and the %bytes_ externals need to
change too?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#258 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFWMK7LWDS6CKJTLQSJAODRZAEE7ANCNFSM4CBEAOEQ>
.
--
Regards
-- Hongbo Zhang
|
Oh interesting. Good to know, I'll keep that in mind! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
reminder.
int array, float array -- should be easy (with a command line flag?)
bytes -- need to checking lexing runtime support
The text was updated successfully, but these errors were encountered: