3 ms·
Its primary goal is to follow the Go spec correctly, including simulating overflow/underflow on int64 type. Implementing that in JavaScript will have overhead.
by shurcooL 12y ago
Its primary goal is to follow the Go spec correctly, including simulating overflow/underflow on int64 type. Implementing that in JavaScript will have overhead.
So if you don't care about that, you can use int type instead, it will be faster.
But if you do care, I agree, using Go types is much much more pleasant and GopherJS takes care of that for you!
- giaour 12y agoI needed int64s and expected the js not to work in all cases. I was amazed at the ingenuity of the gopherjs team and aghast at the state of integer math in javascript.