News for hackers. Stuff that matters.
Re:Why if TYPE_CHECKING? by SlimTim10 on Wednesday December 20, 2023 @07:23AM (#38707837)
That's an odd thing to say. The distinction between compiled and interpreted languages is very fuzzy, but TypeScript is clearly on the compiled side.
Re:Why if TYPE_CHECKING? by gpderetta on Wednesday December 20, 2023 @09:33AM (#38709085)
It is not so much that it is fuzzy, it is that the two definitions are not exclusive.

A compilation translates a language to another, whether it is native code, internal bytecode, portable bytecode, or another source language. Compilation might also type check and optimize depending on the language. Interpretation executes a language; normally bytecode is executed, but pure source level interpreters exist. Native code is "interpreted" by the cpu itself of course.

For example JAVA is certainly a compiled language, but it is typically compiled to bytecode and then interpreted or JITed (which is a combined interpreter/compiler).

Re:Why if TYPE_CHECKING? by remram on Wednesday December 20, 2023 @12:56PM (#38711509)
Likewise, the Python typing annotation language could very well be on the compiled side...

Someone took the interpreted JavaScript language, added typing syntax on top, and typing can be checked statically.

The Python team took the interpreted Python language, added typing syntax on top, and here we are reading a claim that it can't be checked statically because it's interpreted. You understand my puzzlement.