Hacker News new | past | comments | ask | show | jobs | submit login

You can't "run" C, or Go, or Javascript, etc.



I think the parent comment meant that typescript is a static checker, which means it's not exercised at run time but in a prior step. Therefore "performant typescript" means to shorten the time it takes to perform these static checks, not the time it takes to run your code. In contrast, when people talk about optimizing C code they most often (but not always, of course) mean to write code that runs fast.


I find the mentality around TypeScript to be bizarre.

"It's just a type checker for JavaScript" - not really. It's a language that transpiles to JavaScript and it happens to be a superset of JavaScript (namespaces and enums, anyone?).

But saying that it's just a layer on top of JavaScript sounds like saying C++ is just a layer on top of C.


> C++ is just a layer on top of C

C++ used to be just a layer on top of C, but not anymore. If it still was, it wouldn't be a bad thing to say.

Type checks that run during compilation/transpilation/typechecking do not "run" as the code is executed. This is what happens with Typescript, and that's what the original commenter was saying.


I'm not sure I understand your point. Typescript is a language with a type checker and compiler. It's the same thing with C. Typescript has to be compiled to run. C has to be compiled to run. When I think of language performance I always default to thinking about runtime performance.


> I'm not sure I understand your point.

When people talk about C performance, they mean the performance of the code written in C and (ultimately) compiled to machine language. Very seldom they mean the speed of compilation (though they sometimes do, in which case they almost always explicitly mention "compilation").

When people talk about Typescript performance, they either mean Javascript performance or, more likely, the speed with which Typescript type-checks their code; the latter doesn't happen in run time. That's what the original commenter meant when they said "you cannot run Typescript". It's also what TFA means by "performant".




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

Search: