News for hackers. Stuff that matters.
Re:Announcing Flutter beta 1: Build beautiful native apps by kllrnohj on Tuesday February 27, 2018 @06:34PM (#16479199)
> Lists with more than 2^32 elements are not unheard of.

In the use cases Dart targets yes, yes they are. They are extremely unheard of.

BUT even if they aren't, you can't use those from dart2js anyway. JS arrays are limited to uint32 lengths:

"Every Array object has a length property whose value is always a nonnegative integer less than 2^32"

https://www.ecma-international.org/ecma-262/5.1/#sec-15.4

Now sure you could make your own list type that lets you index to 2^53 in Dart, but you're into custom list territory now and math operations on a 64-bit long being a bit slower than native is unlikely to be relevant. You're probably not using flat indexing at that point anyway.

File offsets actually highlights the perfect problem with dart's approach. 2^53 isn't enough to interop with file systems using uint64s, as node.js discovered when trying to use JS Number for inodes ( https://github.com/nodejs/node/issues/12115 ) So things that actually need large numbers don't work anyway.

Re:Announcing Flutter beta 1: Build beautiful native apps by dragonwriter on Tuesday February 27, 2018 @07:10PM (#16479436)
> In the use cases Dart targets yes, yes they are. They are extremely unheard of.

Dart is a general purpose language it wasn't intended to be web front-end only.

> File offsets actually highlights the perfect problem with dart's approach. 2^53 isn't enough to interop with file systems using uint64

Dart ints aren't limited to 2^53 except when using dart2js. It's an arbitrary size type, otherwise. Anyplace it would need to deal with inodes, the dart2js limit wouldn't be a problem.