zlacker

[parent] [thread] 29 comments
1. gianca+(OP)[view] [source] 2025-12-04 14:08:02
I am going to sound crazy, but, if Microsoft would free up TypeScript and every browser added native TypeScript features to JavaScript… and then we all just started calling it TypeScript. Maybe? Then you would see native ts files. Oracle will never give up JS. The funny thing is the number of people who confuse Java and JS.
replies(8): >>shevy-+e >>Vinnl+T >>friend+Wc >>michae+Af >>culi+sC >>morshu+mL >>ozim+CQ >>hajile+ze1
2. shevy-+e[view] [source] 2025-12-04 14:08:53
>>gianca+(OP)
From experience, corporations usually don't give the general public any trademarked name. I assume TypeScript is trademarked right now; and I doubt Microsoft would ever liberate this. So in this regard, the corporations act in the same manner - selfish.
replies(3): >>Someon+22 >>onioni+27 >>george+wc
3. Vinnl+T[view] [source] 2025-12-04 14:12:36
>>gianca+(OP)
An important feature of TypeScript is identifying problems in your code before the user runs it, i.e. before a browser even comes into play.
replies(2): >>lelant+h3 >>array_+Bb
◧◩
4. Someon+22[view] [source] [discussion] 2025-12-04 14:19:25
>>shevy-+e
If browser makers offered to put it in the browser if the name is freed, I bet they could be convinced. The main problem right now, is that there isn't a major push to add TS to the browser.
replies(1): >>gianca+F2
◧◩◪
5. gianca+F2[view] [source] [discussion] 2025-12-04 14:23:18
>>Someon+22
The way I'm proposing it, technically it would be to make JS and TS kind of the same thing, but not fully, as someone else mentioned the goal of TS is still to tell the user (developer) about issues before the code runs. However, if done right TS files still get interpreted like normal JS, and technically you would want to compile them and not put them in the browser "raw" but you could still call it TS.
◧◩
6. lelant+h3[view] [source] [discussion] 2025-12-04 14:26:30
>>Vinnl+T
So? If supported natively by the browser the browser could compile it on download.

You'll still get all the strong typing without have to wait for it to run.

For example an error in a little used branch would cause an error before the branch even runs.

replies(1): >>Vinnl+al
◧◩
7. onioni+27[view] [source] [discussion] 2025-12-04 14:46:59
>>shevy-+e
TFA says Microsoft offered the JScript trademark to be used in place of JavaScript, so there’s some indication of willingness to give up a trademark.
◧◩
8. array_+Bb[view] [source] [discussion] 2025-12-04 15:10:38
>>Vinnl+T
No runtime type safety bites people often and in unexpected ways. It should just be standardized.
replies(1): >>Vinnl+Wk
◧◩
9. george+wc[view] [source] [discussion] 2025-12-04 15:16:17
>>shevy-+e
If you can find the clip on you tube where he says it, it's even funnier. But sadly also true.

https://simonwillison.net

10. friend+Wc[view] [source] 2025-12-04 15:18:48
>>gianca+(OP)
For years we said bring something sane to browsers instead of trying to salvage js. At this point, though, why don't they just implement DOM bindings in wasm and make internets a better place overnight?
replies(2): >>chpatr+2r >>gianca+lG
11. michae+Af[view] [source] 2025-12-04 15:33:09
>>gianca+(OP)
> The funny thing is the number of people who confuse Java and JS.

Is it? My experience in the past decade is that there are more memes about people who confuse the 2 than people that confuse the 2.

replies(1): >>jjkacz+J01
◧◩◪
12. Vinnl+Wk[view] [source] [discussion] 2025-12-04 16:04:40
>>array_+Bb
Sure, but that's an orthogonal concern. That sounds more like a call to standardise Zod.
◧◩◪
13. Vinnl+al[view] [source] [discussion] 2025-12-04 16:05:38
>>lelant+h3
So then the user gets a type error in their face instead of the page loading? That doesn't really sound better than the developer getting that error while writing the code, which is what TypeScript currently does.
replies(2): >>zdragn+Rm >>lelant+dR
◧◩◪◨
14. zdragn+Rm[view] [source] [discussion] 2025-12-04 16:13:40
>>Vinnl+al
Not to mention the penalty of the browser having to re-execute the type checking every time the files aren't loaded from cache.
◧◩
15. chpatr+2r[view] [source] [discussion] 2025-12-04 16:31:51
>>friend+Wc
TypeScript is a really decent language though, I wouldn't feel happier or more productive using Fortran or whatever. Its type system is actually really powerful which is what matters when it comes to avoiding bugs, and it's easy to write functional code with correct-by-construction data. If you need some super optimized code then sure that's what WASM is for but that's not the problem with most web apps, the usual problem is bad design, but then choice of language doesn't save you. Sure TS has some annoying legacy stuff from JS but every language has cruft, and with strict linting you can eliminate it.

It's also better if there's one ecosystem instead of one fragmented with different languages where you have to write bindings for everything you want to use.

replies(3): >>9rx+tR >>int_19+WX1 >>friend+YW2
16. culi+sC[view] [source] 2025-12-04 17:25:17
>>gianca+(OP)
Native type annotations in ecmascript is a serious proposal that gained some traction for quite a while but seems to have fallen off

https://github.com/tc39/proposal-type-annotations

◧◩
17. gianca+lG[view] [source] [discussion] 2025-12-04 17:41:06
>>friend+Wc
I love WASM, I do appreciate that it is slowly but reasonably growing into its final destination.
18. morshu+mL[view] [source] 2025-12-04 18:06:00
>>gianca+(OP)
Was going to say the same thing. I'm fine just using Typescript with types disabled (which is not the same as using TS without specifying types)
19. ozim+CQ[view] [source] 2025-12-04 18:30:39
>>gianca+(OP)
I think that’s not crazy at all. You can run TypeScript in Node already and you can run Playwright scripts directly in TypeScript. Next logical step is that browsers start running it directly.
◧◩◪◨
20. lelant+dR[view] [source] [discussion] 2025-12-04 18:33:33
>>Vinnl+al
> So then the user gets a type error in their face instead of the page loading?

The alternative is not "User sees no error", it's "user sees the error at runtime".

In which case, yeah, having the user see the type error is vastly preferable to having the user see a runtime JS error.

replies(1): >>Vinnl+Cz4
◧◩◪
21. 9rx+tR[view] [source] [discussion] 2025-12-04 18:35:10
>>chpatr+2r
> Its type system is actually really powerful which is what matters when it comes to avoiding bugs

It is really powerful as compared to Javascript. It is even really powerful as compared to most other languages people normally use. But not very powerful as compared to languages that have 'proper' type systems. Typescript still relies on you writing tests for everything.

The type system is a huge boon for the developer experience, of course. It enables things like automatic refactoring that make development much more pleasant (although LLMs are getting better at filling that void in dynamically typed languages). But it doesn't save you from bugs in a way that the tests you have to write anyway won't also save you from. And those same tests would also catch the same bugs in Javascript, so you're in the same place either way with respect to that.

◧◩
22. jjkacz+J01[view] [source] [discussion] 2025-12-04 19:26:15
>>michae+Af
Heh - it depends on the "Project Damagers" you have to work with...
23. hajile+ze1[view] [source] 2025-12-04 20:25:38
>>gianca+(OP)
Only if you change TS to have actually sound types and it enables good performance instead of enabling you to craft extraordinarily convoluted types for stuff that you should have never written in the first place.

Put another way, I'm fine with the TS syntax (and use TS because there aren't other choices), but the TS semantics aren't a good long-term solution.

◧◩◪
24. int_19+WX1[view] [source] [discussion] 2025-12-05 00:35:33
>>chpatr+2r
Its type system is also full of holes because it has to be compatible with JavaScript, being a superset.
replies(1): >>chpatr+od3
◧◩◪
25. friend+YW2[view] [source] [discussion] 2025-12-05 09:49:51
>>chpatr+2r
> It's also better if there's one ecosystem instead of one fragmented with different languages where you have to write bindings for everything you want to use.

This argument is slightly backwards. This is essentially the argument used for "javascript in the backend" and "let's package the whole browser as application runtime so we can use javascript". The core of the argument is that javascript is ipso facto the best language/runtime to write any code in, including refactoring existing codebases. Bringing javascript out of the browser also means you have to write bindings for javascript and recreate the existing ecosystems anyway.

Even if you approach this from "single codebase across runtimes" angle, the conclusion to bridge the gap between browsers and languages with existing codebase, expertise and ecosystems is much more reasonable than rewrite everything in javascript.

replies(1): >>chpatr+ad3
◧◩◪◨
26. chpatr+ad3[view] [source] [discussion] 2025-12-05 12:02:48
>>friend+YW2
Everything is already written in JavaScript. If we had WASM from the start and dozens of languages with different APIs we wouldn't be better off.
◧◩◪◨
27. chpatr+od3[view] [source] [discussion] 2025-12-05 12:04:15
>>int_19+WX1
Sure, the type system isn't perfect but it still beats 90% of mainstream languages in use today.
◧◩◪◨⬒
28. Vinnl+Cz4[view] [source] [discussion] 2025-12-05 18:39:57
>>lelant+dR
In my mind, the alternative is running TypeScript while writing and at build time. Type checking at runtime is at best redundant, and at worst an excuse to skip type checking and have it blow up in the users' face.
replies(1): >>lelant+9k8
◧◩◪◨⬒⬓
29. lelant+9k8[view] [source] [discussion] 2025-12-07 07:04:27
>>Vinnl+Cz4
> In my mind, the alternative is running TypeScript while writing and at build time.

Right now, sure.

But if TS is supported natively in the browser, wouldn't your editor highlight the errors as you type? In which case the chance of deploying a broken TS file to the browser is minimal - you'll have to go out of your way to do so, like writing the TS file in plain notepad.

To go even further, having TS supported in the browser does not mean that you are forced to abandon your build step(s). You are still free to run a build step that either:

1. Does the full compilation to JS, and that's what gets deployed.

or

2. Just lints the file, and has the original TS file deployed.

Nothing in "Native TS in the browser" enforces a no-build-step dev process; it just makes it optional.

There's also the fact that, if JS is no longer the target (either browser-byte-code or native-code will be the target), then type-checking can be improved even further because there will be no requirement to allow things purely due to JS compatibility.

Finally, there's an awfully large number of optimisations that can be done if JS is not the target and native-code is.

I'm not seeing any downside here.

replies(1): >>Vinnl+HI8
◧◩◪◨⬒⬓⬔
30. Vinnl+HI8[view] [source] [discussion] 2025-12-07 12:46:19
>>lelant+9k8
Yeah that's kinda the point; you get all that, unless you don't run the build-step/in-editor dev process. And the only reason to make that step optional, is to not run it, which is a worse experience.

So I'm not necessarily saying it's a bad thing, it's just that I don't see the point. And given that there's the major downside of having to go through the standards process, both now and in the future, which will likely involve breaking changes and making it harder to update, I don't see it happening. (Edit: I should add that I do think the "types as comments" proposal makes sense. I do see the advantage of being able to run TS code without a build step. It's just the part where we'd throw an error in the user's face that I don't see providing value to anyone.)

I do think TC39 is progressive enough to be OK with changes to JS if those would allow TS to have more effective type checking (as long as they're backwards compatible, of course, which would also be the case if TS got incorporated into JS), so I don't think it's necessary for that.

Performance improvements enabled by optimisations would be nice, but I believe I heard that no major gains would be expected there, especially compared to something like WASM.

[go to top]