Hacker News new | past | comments | ask | show | jobs | submit login

To a finite amount, as part of the program itself. If I write a JS program that loops infinitely, pushing a number to an array, that will consume infinite memory by the standards of the JS spec. There’s no hard, upfront bound on memory.

If we can hardcode memory limitations in our programs, then every ‘uncomputable’ problem just becomes a lookup table.




Isn’t it somewhat arbitrary to draw lines between “the JS spec” (which might not directly specify any bounds on memory usage) and the actual specifications of any given machine running JS? I’m pretty sure JS tends to run on a 64-bit architecture, for example.

In fact, I’m pretty sure it’s not even true that “the JS spec” has no such limits. I’m reading that an array can’t be longer than 2^32. And apparently string length cannot exceed 2^53 - 1.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: