-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
I was working with this library in order to implement bidirectional communication over grpc-web using a new elm protocol buffer library that makes use of this.
In order to get the bytes that the elm-protocol-buffers library created to the javascript library I used a port. But I found that taking this type from Elm to the outside world was sort of difficult.
In the end I used loop and unsignedUint8 to change it from Bytes.Bytes to List Int so I could throw it through the port at which point I had some thoughts:
- Given the state of Elm 0.19 with respect to kernel code in order to support more complicated protocols (grpc) the bytes type will almost certainly need to be given to a port so maybe it should become one of the natively supported pass-through types listed here: https://guide.elm-lang.org/interop/flags.html
- Even if the above is done it's probably still required to be able to serialize this to JSON easily. Though I understand that JSON has no native bytes representation so we'd have to pick our poison to solve that.
- In lieu of the above two options maybe just a built-in way to marshal between List Int and the Bytes type?
Appreciate any thoughts on this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels