News for hackers. Stuff that matters.
Re:Node.js Overload by joking on Friday June 19, 2020 @03:48AM (#23572077)
In the one that it is statically typed on compile time, but what gets executed is not because the javascript vm is not statically typed.
Re:Node.js Overload by filleduchaos on Friday June 19, 2020 @04:12AM (#23572242)
What you might be trying to say is that TypeScript is not _strongly_ or _soundly_ typed. "Only statically typed at compile time" is a meaningless statement because "checks types at compile time" is the whole definition of static typing.
Re:Node.js Overload by valand on Friday June 19, 2020 @04:26AM (#23572333)
^ I see that you're not joking with this comment :D. Jokes aside, I'm adding facts

TypeScript is statically typed because of the type annotations and how the compiler checks the type compatibility between objects.

You may can consider TypeScript weakly-typed, because the TypeScript type information are not being encoded into the compilation result.

This is similar to C (being staticcally and weakly typed). You can print int as string and the compiler won't complain.

On the other hand, JavaScript is a dynamically typed and strongly typed language. It is strong as the types are encoded in the runtime. The proof is the keyword `typeof` and its ability to do Reflection.

Reference: Static vs Dynamic: https://en.wikipedia.org/wiki/Type_system#Type_checking Strong vs Weak: https://en.wikipedia.org/wiki/Strong_and_weak_typing

Re:Node.js Overload by 59nadir on Friday June 19, 2020 @11:22AM (#23575369)
You've misunderstood what "weakly typed" means. If a language implicitly converts values (like your C example) or otherwise lets execution move forward in the presence of what are or should be type errors, it's weakly typed.

JavaScript has plenty of implicit conversions and will generally only halt execution if it literally cannot do something (like make a function out of `undefined` or the like), much like C, and is a weakly typed language.

Re:Node.js Overload by gwillz on Friday June 19, 2020 @04:20AM (#23572297)
The JVM also does erasure of generics. Yes, it's not _all_ types but it too relies heavily on compile time typings.