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
I'd never given much thought to regex compat across backends before, it's a pretty tricky issue! Even without considering options the meaning of a regex could differ between backends.
I was almost going to suggest regex should be split into its own js-regex library or something, but then this whole String library is generally very JS centric, given ucs-2, codepoint vs char, etc. 🤔
I wasn't aware those packages were also used when targetting other languages. TIL :)
If we want to transparently expose the native regex implementation of each language there's bound to be differences indeed.
Making a separate string library for each backend makes sense, but that also makes purescript generally less portable.
If we want to abstract over string implementations and string manipulation libraries to create an opaque PureScript string library, then that may be harder to implement for each backend. I'm also not sure if that would have too much impact on string performance.
Activity
JordanMartinez commentedon Dec 1, 2021
Just a question. Is the
dotallflag a JS-specific feature? If so, I'm guessing it can't be supported in other backends.chtenb commentedon Dec 1, 2021
I'm only familiar with the JS backend. Which other backends do I need to check?
JordanMartinez commentedon Dec 1, 2021
See Actively Maintained
garyb commentedon Dec 1, 2021
I'd never given much thought to regex compat across backends before, it's a pretty tricky issue! Even without considering options the meaning of a regex could differ between backends.
I was almost going to suggest regex should be split into its own
js-regexlibrary or something, but then this whole String library is generally very JS centric, given ucs-2, codepoint vs char, etc. 🤔chtenb commentedon Dec 1, 2021
I wasn't aware those packages were also used when targetting other languages. TIL :)
If we want to transparently expose the native regex implementation of each language there's bound to be differences indeed.
Making a separate string library for each backend makes sense, but that also makes purescript generally less portable.
If we want to abstract over string implementations and string manipulation libraries to create an opaque PureScript string library, then that may be harder to implement for each backend. I'm also not sure if that would have too much impact on string performance.