9 ms·
Up to 4GB of Memory in WebAssembly
- MaxKK 7y agoAmazing that they have a dark mode detection on that website.
- TeMPOraL 7y agoYou can do that in CSS now. I've noticed surprisingly many sites adjusting when I started using a Windows machine and set my system-wide preference to dark mode.
- diffrinse 7y agoProlly cause the devs themselves use it
- aledalgrande 7y agoYup I try to convert every product I develop lol
- _bxg1 7y agoWould really love it if HackerNews got this... It's blinding when I browse it on my desktop monitor in the evenings.
- austincheney 7y agoI am not seeing any difference in Firefox.
- saagarjha 7y agoUnfortunately their dark mode detection is incorrect on my computer :(
- greatgib 7y agoIt's like reinventing what exists and doing the same mistakes that were already done!
- _bxg1 7y agoJust reading the part about the ensuing JavaScript implications gave me a stress-headache. Bless the people who are willing to work through these kinds of issues so the rest of us get to use the result.
- Ericson2314 7y agoWhy do we need to support stating the length ~~"2^32+1"~~ 2^32?
- wahern 7y agoIt would be "2^32", not "2^32+1". 2^32 isn't representable in a 32-bit integer, the same way 256 isn't representable in an 8-bit integer--the maximum is 2^8-1, or 255. But the argument that they need to represent 2^32 and therefore that's why they used 64-bit integers is dubious. No 32-bit WebAssembly program could ever operate on and pass an object as large as 2^32 bytes because the code and data structures for the smallest possible program would already take up more than 1 byte in that 32-bit address space.
- snek 7y agoAs is mentioned in the article, u64 was used to future proof for wasm's upcoming memory64 type: https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md https://github.com/WebAssembly/memory64/blob/master/proposal...
- Ericson2314 7y agoYeah, so what are they going to do when they then claim to need to to represent the length 2^64?
- colejohnson66 7y agoIf you have 2^64 objects, you have a bigger problem.
- Dylan16807 7y agoThat 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.
- 7y ago
- pan69 7y agoAre WebAssembly projects going to display a message somewhere that says "WEB4G" when started? (disclaimer: If you're under 35 you might not get this reference)
- baybal2 7y agoSo, will we need to have 4GB of ram to run Javascripts now? :)
- seangrogg 7y agoTaken seriously: RAM often does get offloaded to disk as needed, so realistically this changes nothing in terms of specs needed to handle what's in memory. Taken less seriously: Do you not already need this just to run JIRA on Chrome? Or apps on Electron, generally?
- eggsnbacon1 7y agoI've found its faster and more reliable to reload JIRA tabs by simply creating a VM, running it on a browser in there, and pausing the VM when you don't need JIRA. When you need it, or after a restart, simply load up your VM and resume the operating system. This usually takes only a second or two, much faster than reloading JIRA the normal way. If anyone from Atlassian is here, please help me create an official JIRA tab VM image! Maintaining my JIRA OS negates probably half the time I save loading JIRA this way!
- shrimp_emoji 7y agoIf we start playing crossplatform, browser-based wasm games[0], we might. And we should. OS independence when. 0: https://wasm.continuation-labs.com/d3demo/ https://wasm.continuation-labs.com/d3demo/
- jfkebwjsbx 7y agoNo, please. Most games are already cross-platform. No need to make them slower, less efficient.
- kllrnohj 7y ago4G memory limits, 64-bit migration issues, Doom 3, brk()-based memory management, no multi-threading, unreliable SIMD support... It's like it's 2004 all over again!
- 7y ago
- xscott 7y agoI wish new platforms would embrace 64 bit as the default. C and C++ for all common platforms use 32 bit literals and prefer 32 bit operations (char * short => int). Rust made a similar mistake. Java arrays use 32 bit subscripts, etc... I don't have a single computer (including my phone) using 32 bit pointers, but integers are stuck in the late 80s. (We already had 64 bit DEC alphas in the early 90s) For a web page, 4 gig seems like a courtesy limitation to users, but that should be enforced by the browser refusing to suck up the entire computer rather than the language being unable to. I routinely write (non-web) applications which use arrays larger than 4 gigasamples.
- metalliqaz 7y agoI'm pretty sure rust uses usize, which is 64 bits on modern architectures.
- nicoburns 7y agoRust literals will infer their type from context if possible. Otherwise I believe the default is i32. There are also literal suffixes. So you can 999u64 of 999.02f64 if you want.
- metalliqaz 7y agoliterals, yes, but he's talking specifically about indexing into arrays by my understanding
- steveklabnik 7y agoYes, so, the situation is: #![feature(type_name_of_val)] fn main() { let v = vec![1, 2, 3]; let x = 1; let y = 1; v[x]; dbg!(std::any::type_name_of_val(&x)); dbg!(std::any::type_name_of_val(&y)); } gives [src/main.rs:11] std::any::type_name_of_val(&x) = "usize" [src/main.rs:12] std::any::type_name_of_val(&y) = "i32" https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=faedcbb75b4b29b4a4def06d31c37f13 https://play.rust-lang.org/?version=nightly&mode=debug&editi...
- rajsite 7y agoDoes the 4GB limit only apply per WebAssembly instance or does it apply to the V8 runtime as a whole? Can a single page run multiple separate 4GB WASM instances?
- sparsely 7y agoImagine how much adware you'll be able to fit in 4GB!
- deleted 7y ago[deleted]
- juntao 7y agoV8 wasm has memory size limitation because it is fundamentally limited by the chrome browser. But other server-side WebAssembly don't have this question, for example, SSVM never had any arbitrary memory limit.