Hello everyone! Today, before our eyes, a truly significant event for web development in general is taking place. Just a couple of days ago, a project from Microsoft for the TypeScript language was put into the public space. And this is really important!
π What's new?
First of all, the original TypeScript compiler under the hood is moving in the new version 7 from JavaScript to Go. That is, there will be conditionally TypeScript 6 (JS) and TypeScript 7 (Go). This was done mainly because of the scaling problem when used in very large projects, but also, of course, because of the speed.
Today, the new project shows a 10x increase in some tests, which makes it super promising. The main thing is, of course, the code editor. If we are talking about speed, then if you do not have some Intel Core i9-13900K processor, where in principle everything is irrelevant, but a slower one, or a laptop, then you have all encountered the fact that your project in VS Code starts up, well, literally for a very long time. That is, if it is one file - okay, but if we are talking about a modern Next.js application with 100 pages and 1000 files, then the laptop just glitches like an old washing machine until it starts up.
So version 7 just minimizes all this horror and with new versions of VS Code will allow you to launch your projects faster.
β About Go
Of course, it's unusual to talk about Go in the context of web development, because it's usually related to the backend, but it's still worth it now. Why did you choose Go and not another language, like Rust or something else?
Here is a short list of why Go was chosen:
"By far the most important aspect is that we need to keep the new codebase as compatible as possible, both in terms of semantics and in terms of code structure...Idiomatic Go strongly resembles the existing coding patterns of the TypeScript codebase, which makes this porting effort much more tractable."
"We also have an unusually large amount of graph processing, specifically traversing trees in both upward and downward walks involving polymorphic nodes. Go does an excellent job of making this ergonomic, especially in the context of needing to resemble the JavaScript version of the code."
These are direct quotes from here, if you want to know why Go, you can read the full text.
π Problems with the new version
A new version is always good, but there are also pitfalls that you should know about so as not to make mistakes in your projects:
Modest code base - This project has literally just been presented to the public, so in terms of code base parity with older versions 5.8, 5..., it is clear that it is not comparable. That is, if you want to learn something new about version 7, if you have some kind of bug, or something similar, then ChatGPT will not answer you, and you will not find information on StackOverflow. You will be considered a discoverer and your duty is to record on the Internet what you have found. This is, of course, cool, but when it comes to projects with large budgets, it is worth understanding that these are still risks, because developers can literally sit for several hours just to infer the type. But, it is also clear that this is a reserve for the future, like Next.js in 2021.
Go - Yes, this can be considered both an advantage and a disadvantage. Just imagine how much code, modules and other stuff was made specifically for JavaScript, and now the language under the hood of the compiler is changing. Accordingly, the problems that were with Go are transferred to web development. Many web developers are not even aware (I hope not) what kind of programming language it is, but its implementation inevitably entails inconsistencies and crutches.
ποΈ Conclusion
From my point of view, this is really something new and cool, because the speed of the program has always been of primary importance to me. I like the fact that web development does not focus entirely on JavaScript, which is everywhere now, but also on other languages ββthat can bring something new. It is clear that everything is around JS, HTML, because it is a standard, but still, when we talk about variability, everyone will remember the backend, that is where everything is, but now there is something to discuss on the client. Therefore, even with all the shortcomings of the new version of TypeScript, I think that it should be downloaded and it should be tried, developed. Imagine, before our eyes history is being made, where millions of developers will develop this, a bunch of new bugs with Go and features, typical inconsistencies and other similar things. But, it is cool!
π¬ What do you think about this? It will be interesting to read!
Thank you very much for reading the article!
Top comments (8)
I have two questions about Microsoft's announcement.
Was anyone else surprised when they said "10x faster"? Usually when you say a programming language is fast, you mean its code executes quickly. But Microsoft's announcement says its build times will be 10x faster. Was it just me, or is that an odd way to express the speed of the language?
That's my other question. The announcement says TypeScript's native implementation "will drastically improve editor startup..." The first line in the announcement describes them as "next steps we're taking" and the conclusion promises "in the coming months weβll be sharing more about this exciting effort." (At one point it even talks about what we'll see in TypeScript 7 "upon release.") So.... This isn't here yet, right? This is something they're still working on?
Most likely, as for the editors, this is not yet the case. They only announced a more or less working version, but it still needs to be finished.
As for the speed, most likely, the maximum of JavaScript implementation was approximately reached here, it was necessary to switch to something faster. It is clear that in regular C as one of the fastest, if not the fastest, you can't do this, because literally everything has to be rewritten from scratch, they took something in this style and similar to js, ββas it seems to me.
They want to release it properly by the end of 2025, maybe.
Good explanation
Thanks!
Ah, so that's why TypeScript is written everywhere
Exactly
By the way, you can download typescript like this: