#The same code producing different outcome in different projects.
1 messages · Page 1 of 1 (latest)
target
You're running it on two different targets
Still sounds like a bug in the JS implementation
why many word when few word do
Ah I didn't even think I had erlang installed.
So what's the correct behaviour, are { not allowed in paths?
No idea! 😁
I'm saying the Erlang one is correct because it's the OTP implementation and I'm sure they're in the right
chatGPT agrees.
oh well thats that settled then
uri.parse used to behave differently on both target for as long as I remember: on the Erlang target we use the OTP implementation (fast and well tested), while on the JS target we hand rolled our own implementation
In the long run our JS implementation should behave the same as the Erlang one but it's going to be a big chunk of work
why cant we use URL global?
I don't know, but I remember there was a reason we didn't use that
it doesn't follow the standard either the same way erlang does
of course it doesnt
for {} the standard seems to have forgotten about those characters?? so erlang rejects it and javascript silently percent-encodes them
They're explicitly listed as unsafe
doesn't even appear though
Thanks for the help with the "not so" standards.
that's wild
So what does the latest spec say you’re supposed to do with them?
they should be percent-encoded
A percent-encoding mechanism is used to represent a data octet in a component when that octet's corresponding character is outside the allowed set
the allowed set being:
ALPHA / DIGIT / "-" / "." / "_" / "~"
Boo Erlang
I'm watching a video about parser differentials (when two parsers with same input yield different results) and the guy actually compares JSON parsing in JavaScript and Erlang, similar to the URI case: https://youtu.be/Dq_KVLXzxH8?si=vQQxjlYz2lv_UthH&t=312
Boo, using Jiffy as the Erlang example
Devs attempting to write a spec that's only implemented in one way challenge (impossible)