6 ms·
This language is quite striking! TypeScript is a superset of JS but here we're going from the other direction. Make a language that is only the TypeScript exten
by ridiculous_fish 7y ago
This language is quite striking! TypeScript is a superset of JS but here we're going from the other direction. Make a language that is only the TypeScript extensions to JS, and drop all the JS parts.
No Object (!!), no Date, TypedArray, RegExp, almost all the mainstays are gone. It's Java 1.0: static offsets and vtables.
This feels like the beginning of TypeScript throwing its weight around. It has the momentum to supplant JS and this is an exploratory compatibility-breaking step.
- mschuetz 7y agoWhat's wrong with TypedArray? It provides kickass performance for things like graphics. Any replacement would have to be at least as fast.
- darzu 7y agoNothing is wrong with TypedArray. This might be added in the future. Currently it hasn't been necessary for the use cases STS is going for (educational programming for MCUs).
- tiborsaas 7y agoIt seems JS is not your favourite language :) There's already a solid technology in place to supplant it which is WebAssembly.
- vijaybritto 7y agoThe only reason typescript has gotten the massive adoption is because its a superset of JS. If you remove the js part then it wont grow anymore!
- pjmlp 7y agoIt worked pretty well for C++.
- vijaybritto 7y agowould it work in 2019 though?
- pjmlp 7y agoAssuming the same support as it got from OS vendors and third party C compiler vendors in the early 90's, surely.
- dangerbird2 7y agoIt seems like the main market for the language is education, specifically a high-level language for ARM-based arduino-compatibles, but with an SDK that can be hosted on a browser for easy distribution on school computers. Microsoft can use the nuts and bolts of their existing typescript compiler, which happens to be able to run in a browser, to implement the language.
- siempreb 7y ago> Make a language that is only the TypeScript extensions to JS, and drop all the JS parts. So? Is there a reason left then to use Typescript instead of C or C++? I cannot think of one. Especially for education you better use a real language that will stay for more than 10 years at least. Microsoft is doing a great job taking over the Javascript community, and now this.., would love to see their hidden agenda. IMAO Typescript is only interesting as a (painful) intermediate solution for large Javascript code bases until there is a serious replacement for Javascript through WebAssembly. I'd never choose Typescript as a language, even stronger, I recently moved away from full-stack web development partly because of it. Back to C++, what a relief..
- tlarkworthy 7y agoTypescript has a unique typesystem that embraces duck typing. This is quite different to how you would type e.g. a scala program. C++ adds a load of additional burden on the programmer (memory) and has a relatively weak typesystem. Clearly Typescript has a niche, has familiarity to subset of programmers, so there are plenty of reasons for this to have its place.
- kjeetgill 7y agoI'm less familiar with Typescript but this sounds quite close to how go does interfaces! Maybe you could speak to that. I've been pretty impressed with static duck-typing and miss it when I'm in Java.
- austincheney 7y agoI am not sure where you are going with that. C++ is largely popular and enduring for the same reasons as Java: institutionalization (taught in school).
- otabdeveloper4 7y agoThat's simply not true. I'm not aware of any place where C++ is taught. (And in fact C++ programmers are very hard to find.) C is very common and anybody with even a bit of format education has been exposed to C. Then you get people who know a bit of C and throw in a couple 'class' and a couple 'cout', and call it 'C++' for some reason. Which is wrong, obviously.
- zachrose 7y agoSubsets of TypeScript are an interesting idea. If you could remove mutation and push imperative APIs into a library that calls you, you might wind up with something like Elm.
- baybal2 7y ago> This feels like the beginning of TypeScript throwing its weight around. It has the momentum to supplant JS and this is an exploratory compatibility-breaking step. If this dream will come true, we will have both broken JS development space, and not much better TS developer ecosystem. The creation of TypeScript is Microsoft's doing its trick called "Extend Embrace Extinguish." They see that their captive developer community of VB and C# devs is trying to migrating to more sane scripting languages, and they want to cauterise the bleeding with TS. The moment TS will gain steam, they will very likely add some extensions that will finally break any form of reverse compatibility, and make TS a standalone language. And few years down the line they will put a lid on it too.
- that_jojo 7y agoWho on earth is moving from the well-typed, statically compiled world of C# to some dynamic scripting language? I mean, not to besmirch the merits of scripting languages, but C# and, ex, JS excel in very different domains.
- baybal2 7y agoIndeed they are, but people sign plumpy "Enterprise" development contracts don't seem to think so. And knowing that MS Devs are not far Java devs in their mentality, they will follow wherever their stomach guides them.
- darzu 7y agoI wouldn't say all the JS mainstays are gone. In fact, most STS programs have little to no type annotations, so it very much looks like javascript still. The dynamic parts like eval() and "new function" are gone, but the others you mentioned could likely be added in the future. Date() for example isn't added because STS mostly targets MCUs which don't typically have persistent time. STS was designed and built to target MCUs for educational purposes. It's actually incompatible with pretty much every NPM package out there TypeScript or not, because 99% of those can't fit or run on an MCU.