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

I don't know what the usual speed difference of TypeScript programs vs JavaScript programs.

But the argument that TypeScript generates a JavaScript, so it must have similar speed doesn't hold in general.

If the compiler in question is a whole-program compiler, it can make optimizations that a normal person couldn't do.

As an anecdote in [1] a raytracing program were implemented in both Scheme and C. The Stalin compiler (a whole-program Scheme compiler) produced an executable 45% faster than the one produced by g++. The Stalin compiler produced the excecuable by compiling Scheme to C, and then used a C compiler to produce the final executable.

The price of a whole-program compiler? Well, the compile time are huge.

[1] Scroll to Siskind's comment. https://groups.google.com/g/comp.lang.scheme/c/NJxRsdMNKz4

For those curious about the actual programs and results: https://web.archive.org/web/20071011073406/http://www.ffcons...





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

Search: