6 ms·
How JavaScript works: an overview of the engine, the runtime, and the call stack
- threatofrain 5y agoThe blog is basically an advertisement for a product. "There’s a free plan, no credit card is required. Get started now."
- judge2020 5y agoAfter reading, I don't think it's purely an advertisement, but it doesn't feel like a super genuine post with things like the error message being 'SessionStack will help you resolve crashes', and due to the fact that the post was submitted by the Founder of this service and he only posts articles from this blog (all linking back to the service).
- Zachsa999 5y agoI learned a lot nonetheless.
- OskarS 5y agoIt’s also, like, trivial: as far as I can tell, this is just a very basic description of how a call stack works mixed in with advertising calls to action.
- IggleSniggle 5y agoOne of my favorite things is this interactive demo of the js event loop: https://news.ycombinator.com/item?id=27942699 https://news.ycombinator.com/item?id=27942699
- tarkin2 5y agoThe linked video is the best. I had no idea how to use the linked website before I watched the video. And then when I watched the video and realised I didn't need to use the website to understand. I gleemed: "Javascript passes callbacks to asynchronous third-party APIs (fetch etc). Once those APIs are finished, they pass those callbacks on the "callback stack". The event loop, when the call stack is empty, then moves those callbacks onto the call stack for processing." The posted article is a bunch of fluff and then an advert.
- titzer 5y agoIs this the same people? Because the website has an almost exact copy of the diagram at 3:54 in the video.
- z3t4 5y agoOne annoying thing in JS is that you have to turn recursive functions into for-loops (you could argue this is a good thing as for loops might be easier to understand then recursive functions). I thought the JavaScript callstack limit/error would go away in ES6 tail call optimization... But no JS engine seem to have implemented it!?
- iaml 5y agoSafari has tail call optimization I think.
- RobertKerans 5y agoPart of the spec, as sibling says implemented in Safari, was also implemented in a few specific other engine versions for testing then ripped out. Benefits didn't seem to outweigh the extra complexity: iirc the issue was to do with the semantics -- several engines wanted opt-in for proper tail call elimination (so, a syntax addition), rather than opt-out as per the spec (which seemed to involve a lot more work for what I'm guessing they saw as minimal benefit), so [again iirc] just sorta hit a stalemate.
- chmod775 5y agoThe title creates an expectation of some insightful technical explanation, instead we get something so shallow as to be useless to anyone who has been programming for more than a week. It's not even specific to JavaScript. An appropriate title would be "Introduction to JavaScript (Part 1): What is V8, a call stack, and a runtime?". At the end of this short but blatant spam they then try to sell their whatever. Somehow that's enough to accumulate 50 points and end up on the frontpage.
- wonnage 5y agoNot only that but it's from 2017, couldn't even be bothered to write a new article for the grift