-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] string.ord or string.lt + string.gt #37
Comments
Related to #5. I think the question is really, "enough for what". I'm sympathetic to the use case, but I think that we may be able to get by with something more limited until we have more data indicating that more instructions would be enough (that word again!) of a win that we should standardize them. Three points: Firstly, note that Secondly, I think there may be OK MVP solutions. Just trying to put myself in your shoes here -- If I were implementing a compiler for a language that required lexicographic ordering and I knew that I were targetting the web, I would implement an MVP Finally, as you might start requiring more and more elaborate string algorithms (collation, line breaking, normalization, etc), I'd definitely want to be leaning on some system library, be it another WASI component or JS/Intl. I can see how having |
I don't think |
I believe string ordering on Unicode strings is locale-dependent and generally a pretty complex operation. |
|
I don't think
string.eq
alone will be enough. For string sorting we also needstring.lt
(a < b) andstring.gt
(a > b) operations.Or ideally replacing
string.eq
(or at least addition) with the more generalizedstring.ord
which perform lexicographical comparison and return-1
if (a < b),+1
if (a > b) and0
if (a == b).WDYT?
The text was updated successfully, but these errors were encountered: