logoalt Hacker News

tipiirailast Tuesday at 9:01 AM3 repliesview on HN

Author here. You’re spot on. I took away the React association and added a direct link to the JS code [1] that hit the ‘Maximum call stack size exceeded’ wall. TypedArrays can do wild stuff, no doubt, but yeah, it’s not exactly vanilla JS—and still lags a tight WASM setup. Appreciating the nuance here!

[1]: https://github.com/nuejs/nue/blob/master/packages/examples/s...


Replies

vanderZwanlast Tuesday at 11:33 AM

The new wording is much more nuanced, appreciated! Also the fact that you link to the actual code that broke down, making it possible to verify the claim. Less ammunition for the people who actually are skeptical of the project instead of just nitpicky like me ;)

Speaking of the code in question, it looks pretty sensible - there's a bit of low-hanging fruit where one could avoid creating redundant arrays by turning chained calls to map and filter into one for-loop and such, but that's about it.

What confuses me is that there's no point in the code where I see any recursion, here or in the other JS files that seem relevant, so how does one end up with a call stack overflow?

(not questioning that it crashed for you, it's just that I don't see any obvious flaws in the implementation, so I'm curious to lean what the "gotcha" is in case I ever bump into something like it myself)

show 1 reply
mexicocitinluezlast Tuesday at 12:04 PM

What does event sourcing have to do with searching or "instant keypresses"? It's a storage pattern for recording events, not a way to search.

Like, you're searching a single table for text messages, not a stream of events.