Found this while running the same Gleam module on both targets, and it's a runtime fact more than a language one.
import gleam/int
import gleam/io
pub fn main() {
let id = 9_007_199_254_740_993
io.println(int.to_string(id))
}
gleam run prints 9007199254740993. gleam run --target javascript prints 9007199254740992. On the Erlang target an Int is a BEAM integer and grows as far as memory lets it. On JavaScript the compiler maps Int to a plain JS number, a double, so anything past 2^53 gets rounded to a neighbour. Same type in the source, same code, and the two runtimes quietly disagree. No error on either side.
The real value came from a JSON payload, the literal is just the smallest repro. How are people handling ints that have to mean the same thing on both targets?