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

Pretty weird for a JSON parser to be platform dependent.


Not really, parsing JSON is probably a recursive algorithm and Windows gives processes way less stack space than Linux (generally 1MB vs 8MB). It could totally be that the code is the same, but the particular JSON string blows up the stack in Windows but not Linux.


Maybe the stack is shallower on Windows, or the calling convention takes more space per function and is enough to push it over the edge.


Recursion based implementation of parsers in languages with limited stack size is a programmer mistake.


All languages have limited stack size.


Eh... not really if you're referring to call stacks. Rust at one point had growable stacks. That was removed for performance reasons. Haskell with GHC kind of has growable stacks (basically IIRC most function calls occur on the heap) and its stack overflows take a different form. SML I think at one point also had an implementation with a growable call stack.


I guess this is a nitpick of limited vs. fixed. Even if you grow the stack, at some point you can't grow anymore.


If by limited you mean limited by the amount of memory your machine has then yes it's limited, but I don't think that's what parent was getting at, since in that sense everything about a computer is limited.


If your C/C++ code calls functions, it's platform dependent in this way. C doesn't provide a lot of guarantees wrt minimum stack size.




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

Search: