Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TypeScript is also interpreted, and does type checking without running code. Their argument is very weird.


TS is not interpreted. It compiles to JS, which is interpreted, but TS itself is not. There are no TS interpreters, they all compile to JS behind the scenes.

Or does Deno run TS natively? At a glance it looks like even its runtime is written in JS[0].

EDIT: looks like they have bindings for V8[1] so yeah, just a JS interpreter behind the scenes.

[0] https://github.com/denoland/deno/tree/main/runtime/js

[1] https://github.com/denoland/rusty_v8


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.


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.


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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: