native tsc
vs Go-based TS 7 rewrite?
#163
Replies: 3 comments 2 replies
-
Wait, can this actually build the typescript compiler or did you just name your compiler That is... a little confusing 😄 |
Beta Was this translation helpful? Give feedback.
-
lol okay 😄 |
Beta Was this translation helpful? Give feedback.
-
Well, main idea of TypeScriptCompiler "Native" is to compile the code as C++ does but instead of using C++ syntax it is using TypeScript syntax. (BTW you can try early version on Compiler Explorer) .. So, I hope the speed is comparable to C++ code (not sure which is faster Go or C++ :)) When I have time, I will try to do some comparison in speed. I have seen about "TS Go" recently so not sure about the future plan about that "TSC Native". I have done all I wanted in that compiler. So far, I have not seen big interest from others to use it as main compiler. But for me I am going to use it instead of C++ compiler for sure. It is not possible to compiler TSC using my compiler as not all code is fully compliable due to some "dynamic" hacks in JavaScript code. |
Beta Was this translation helpful? Give feedback.
-
First off, kudos for actually attempting this! 🙂✌️
The README talks about building the TSC compiler - does this imply you've actually gotten to the point where you can build a working, native version of the
tsc
compiler? If so, you've already achieved more than any other attempted TS to native compiler.I was wondering if you would care to share some performance metrics?
Since the TS team just announced they're abandoning the current TS compiler in favor of a Go port (and since doing what you seem to be attempting here is what I'd have suggested trying first) I'd be curious to know how it stacks up against that?
The Go port announcement talks about a 10x speedup, and Anders said about half of that is due to raw speed, the other half is due to threading, and even talked about the compiler doing redundant work in order to maximize use of available cores.
So if your LLVM based TS compiler brings a 5x speedup, that would put you on par with their Go port - which frankly would make your idea sound like a much better idea, since compiling TS to native would have (obviously) way more uses than just a native compiler.
I mean, if threading gave them a further 2x speedup, the same should be possible with an implementation of workers in your (eventual?) standard library for this compiler, and of course with similar changes to the TSC compiler as what they're doing in Go, right?
Anyhow, what you're doing here is wild! I hope you don't abandon this if they kill the TS based compiler, which they likely will. 😌
Beta Was this translation helpful? Give feedback.
All reactions