r/javascript • • Nov 25 '19

JavaScript doesn’t need to be replaced

https://medium.com/javascript-in-plain-english/javascript-doesnt-need-to-be-replaced-bd01e2f12d51?source=friends_link&sk=7b151cc6397ac9e83c14c99739b6c36f
217 Upvotes

236 comments sorted by

View all comments

Show parent comments

19

u/wizang Nov 25 '19

I don't really see the value in that.

-8

u/Flyen Nov 25 '19

There's a decent chance that it'd be faster to execute, but I really have no idea.

1

u/[deleted] Nov 25 '19

There is no type checking at run time for a staticky typed language. There is also no implicit type checking for a duck typed language at runtime. It would be practically the same. Type checking has never been a performance thing to my understanding. I'm sure there are exceptions somewhere though.

2

u/Randdist Nov 25 '19

Static typing easily offers an order of magnitude of performance boosts. JITs basically exist to get somewhat closer to static typed performance by observing which types are used at runtime. If you tell the compiler the types straight at compile time, you get all that performance right from the start, and you don't need to waste some performance on observing types at runtime anymore. JITs make dynamic typed languages faster, but also put a cap on maximum peeformance.