> The hardest parts were numbers (TS has no ints or shorts)
The easy way to handle that would be to just treat "number" as 64-bit float, since that is semantically how Javascript defines them. But that can hurt performance.
Another option is to define your own integer types