You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our usage of Fay at FP Complete, we've significantly reduced the occurrences of serialization bugs by using Text in place of String. It also reduces the number of conversions the generated Javascript performs.
I wonder if we could do the same thing with lists and Vectors. A Vector could be represented in server-side code using Data.Vector.Vector, and as an array in generated Javascript. There could be toVector and fromVector helper functions, and serialization would essentially not touch Vector.
However, it also seems like this could be significantly more complicated than the work on Text, since the contained value in Text was always a character, whereas we have full polymorphism with Vectors.
Does this sound like something worth looking into?
The text was updated successfully, but these errors were encountered:
Hmm I think this would be fine to implement. Could just take the existing list implementation in the FFI and replace the representation (chains of Conses) with a native JS array, add the serialization in Convert (might have to change showToFay to use Data).
I presume any conversion bugs you have had are due to using Automatic and a polymorphically typed String? What is your implementation of Text?
One example of a bug we've run into a number of times is #250. We always have to make sure to wrap up our lists in some datatype. We have similar issues with Strings until we switched to Text.
In our usage of Fay at FP Complete, we've significantly reduced the occurrences of serialization bugs by using
Text
in place ofString
. It also reduces the number of conversions the generated Javascript performs.I wonder if we could do the same thing with lists and
Vector
s. AVector
could be represented in server-side code usingData.Vector.Vector
, and as an array in generated Javascript. There could betoVector
andfromVector
helper functions, and serialization would essentially not touchVector
.However, it also seems like this could be significantly more complicated than the work on
Text
, since the contained value inText
was always a character, whereas we have full polymorphism withVector
s.Does this sound like something worth looking into?
The text was updated successfully, but these errors were encountered: