I fell down a debugging rabbit hole
It all started with a bug: it turned out that 7.5 % 2 gives 1.5 in JavaScript and 1 in PHP. And it got me thinking: how many more differences like this are there? I don't want them to catch me off guard again. Since I couldn't find a list of the divergences I was looking for, I did what any reasonable person would do: put eight AIs to work on it. So far, they found 143 semantic divergences… and that's only among the data types JSON deals with: numbers, strings, arrays, maps, and booleans. For example: Math.round(-2.5): -2 in JS and Python… -3 in PHP Math.round(2.5): 3 in JS and PHP… 2 in Python "😀".length: 2 in JS (UTF-16)… 1 in Python… 4 in PHP (bytes) "10" < "9" → true in JS and Python… false in PHP sort(): [1, 10, 2] in JS (lexicographical by default)… [1, 2, 10] in Python split(""): ["a","b","c"] in JS and PHP… ValueError in Python "a" || "b": "a" in JS and Python… true in PHP And that's without even mentioning our beloved 0.1 + 0.2 = 0.30000000000000004 in every language using 64-bit floats. The full list is linked in the post (it's basically a compilation video of programming accidents). And if you're curious, have a look around the rest of the repo. It's like JSON, but for business logic. It already compiles itself to JS and PHP, with more targets coming. Demo: jsol.bustelo.com.ar Maybe you'll think it's an abomination. Maybe you'll find it useful. Let me know :)