Live data from Hacker News

Up to 4GB of Memory in WebAssembly

v8.dev

81–86 of 86 posts

Re: Up to 4GB of Memory in WebAssembly

#81

Earlier quoted context omitted.

Yeah, so what are they going to do when they then claim to need to to represent the length 2^64?

That won't happen on a 64 bit machine. By the time we need that, the code will be so vastly different that trying to prepare for it now would be counterproductive.

I agree it's stupid. I think worrying about representing the length of 1 object filling the entire address space is stupid, wether the address space is 2^32 or 2^64

Re: Up to 4GB of Memory in WebAssembly

#82
post #75

Earlier quoted context omitted.

I think the i32 default for integer literals stands in contrast to the otherwise solid choices for numerics on builtin types in Rust.

What would you prefer?

Personally I would prefer i64, but the following are defensible:

- Treat it as a special arbitrary precision type, similar to Go

- Choose isize because it's the native size for the platform

- Make it a compile error when the type can't be inferred

The rationale for i32 in RFC 0212 is basically, "well C compilers usually do this", and some hand waving about cache (why not i16 or i8 then?!?). Then they chose f64 instead of f32 for floating literals, which undermines the cache argument. So really, Rust did it because C compilers do it, and C compilers do it to simplify porting old software, which doesn't apply to Rust.

Re: Up to 4GB of Memory in WebAssembly

#83

Earlier quoted context omitted.

That won't happen on a 64 bit machine. By the time we need that, the code will be so vastly different that trying to prepare for it now would be counterproductive.

I agree it's stupid. I think worrying about representing the length of 1 object filling the entire address space is stupid, wether the address space is 2^32 or 2^64

> representing the length of 1 object filling the entire address space

Isn't this about encoding the WASM address space itself, inside the outer computer's 64 bit address space?

It's only a slight annoyance if it doesn't get to be quite the normal limit, but since they're changing some of this code anyway, and they're going to need even bigger numbers in the future, it makes sense to do a proper adaptation.

Re: Up to 4GB of Memory in WebAssembly

#84
post #82

Earlier quoted context omitted.

What would you prefer?

Personally I would prefer i64, but the following are defensible: - Treat it as a special arbitrary precision type, similar to Go - Choose isize because it's the native size for the platform - Make it a compile error when the type can't be inferred The rationale for i32 in RFC 0212 is basically, "well C compilers usually do this", and some hand waving about cache (why not i16 or i8 then?!?). Then they chose f64 instea…

We did option 3, and it made examples and docs very difficult.

Option 1 is not acceptable given Rust's attitude towards allocation.

We could do option 2, it's true.

> The rationale for i32 in RFC 0212 is basically, "well C compilers usually do this"

I don't agree with this; but it doesn't really matter at the end of the day, it's been years and this can't really change.

Regardless, I appreciate the elaboration :) It helps me understand the way others think about Rust.

Re: Up to 4GB of Memory in WebAssembly

#85
post #82

Earlier quoted context omitted.

Personally I would prefer i64, but the following are defensible: - Treat it as a special arbitrary precision type, similar to Go - Choose isize because it's the native size for the platform - Make it a compile error when the type can't be inferred The rationale for i32 in RFC 0212 is basically, "well C compilers usually do this", and some hand waving about cache (why not i16 or i8 then?!?). Then they chose f64 instea…

We did option 3, and it made examples and docs very difficult. Option 1 is not acceptable given Rust's attitude towards allocation. We could do option 2, it's true. > The rationale for i32 in RFC 0212 is basically, "well C compilers usually do this" I don't agree with this; but it doesn't really matter at the end of the day, it's been years and this can't really change. Regardless, I appreciate the elaboration :) It…

Yeah, I realize none of this can change. However, if there is ever a breaking version 2.0 on the roadmap, I'll tell you the features which keep me from actually using Rust. The i32 is pretty insignificant. :-)

Re: Up to 4GB of Memory in WebAssembly

#86
post #85

Earlier quoted context omitted.

We did option 3, and it made examples and docs very difficult. Option 1 is not acceptable given Rust's attitude towards allocation. We could do option 2, it's true. > The rationale for i32 in RFC 0212 is basically, "well C compilers usually do this" I don't agree with this; but it doesn't really matter at the end of the day, it's been years and this can't really change. Regardless, I appreciate the elaboration :) It…

Yeah, I realize none of this can change. However, if there is ever a breaking version 2.0 on the roadmap, I'll tell you the features which keep me from actually using Rust. The i32 is pretty insignificant. :-)

There is no plans at this time, but I'm always interested in hearing what folks have to say...
Post reply on HN