Skip to content
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

WIP: GHCJS support #11

Closed
wants to merge 2 commits into from
Closed

WIP: GHCJS support #11

wants to merge 2 commits into from

Conversation

bgamari
Copy link
Contributor

@bgamari bgamari commented Jun 10, 2019

This is a first attempt at adding support for GHCJS, addressing #5. Of the two approaches I opted to reimplement text-short's interface on top of Data.JSString.

There currently seem to be some inconsistencies between Javascript's treatment of surrogates and that expected by text-short.

@hvr
Copy link
Collaborator

hvr commented Jun 12, 2019

There currently seem to be some inconsistencies between Javascript's treatment of surrogates

Can you elaborate?

The other obvious difference is probably that there won't be a O(0) conversion from ShortText to ShortByteString :-)

And btw, isn't JSString UTF16-backed internally?

@bgamari
Copy link
Contributor Author

bgamari commented Jun 13, 2019

There currently seem to be some inconsistencies between Javascript's treatment of surrogates

Can you elaborate?

Admittedly I can't add much more detail. I implemented this in a hurry since we needed to quickly port a project using text-short to GHCJS. I ran the testsuite and saw a number of failures, all apparently involving high codepoints, but didn't investigate any further since the patch is working fine for our needs.

I thought it would be best that I open an MR here so that others might benefit from it.

The other obvious difference is probably that there won't be a O(0) conversion from ShortText to ShortByteString :-)

And btw, isn't JSString UTF16-backed internally?

JSString is backed by a JavaScript string and AFAIK the ECMAScript specification doesn't specify an encoding. I did a quick search which suggests that at very least V8 uses UTF-8. On the other hand, it looks like SpiderMonkey uses UTF-16.

@phadej phadej force-pushed the master branch 2 times, most recently from 3d839b1 to 81a2ae6 Compare October 10, 2021 12:47
@phadej
Copy link
Collaborator

phadej commented Oct 10, 2021

@bgamari what is left here? Will continue to work on this?

@phadej phadej closed this Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants