It's easier than bash ;)
It shouldn't really matter, Node is quite performant nowadays, but compared to a compiled language it might be slower, but easier to write up.
This project is a toy project, so why spend the time on optimizing ;)
It shouldn't really matter, Node is quite performant nowadays, but compared to a compiled language it might be slower, but easier to write up.
This project is a toy project, so why spend the time on optimizing ;)
Modern JavaScript VMs like V8 will often optimise functions treating types as static, then "deoptimise" in the rare case their type assumptions are broken.
[1] https://news.ycombinator.com/item?id=13774326 [2] https://en.wikipedia.org/wiki/SpiderMonkey
And that logic that's needed to test invariants is exactly the overhead we're talking about.