Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What matklad said as a footnote deserves a little more attention!

A huge benefit is having to think and be explicit about the limits up front. To take your example of arbitrary sized JSON and flip it around: how would you do it normally?

Maybe, you'd allocate a buffer to hold your entire object when it comes in - but now you'll end up crashing when you get a large document that exceeds your available memory.

Maybe you can do things in a fixed amount of memory, using streaming or chunking - which would be pretty simple to turn to static allocation!

Static allocation forces understanding of those limits upfront.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: