4 ms·
I used this once to port some math-heavy Go and both amazed and aghast when I saw how int64 values were handled in the resulting javascript.
by giaour 12y ago
I used this once to port some math-heavy Go and both amazed and aghast when I saw how int64 values were handled in the resulting javascript.
- shurcooL 12y agoIts 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.
- loosescrews 12y agoCan you post an example? The playground doesn't seem to be working right now.