It looks like the ultimate hack, but why not ? It's very creative and the intention is good as well: TypeScript/JavaScript is a very popular language. Though C#.NET is great as well.
It could make sense in the very long-term that Microsoft themselves explore this possibility.
Ultimately "TypeScript.NET or JavaScript.NET"
I’ll double down on the urge to drop TypeScript. That pile of nonsense came from the classic OOP folks - “But where are my TYPEs!? How do I know what type that variable is!?” (first the Java/C++ folks then the .NET folks “solved” the brain fuzz around functional programming and dynamic types by giving you TypeScript)
Having been out of the m$ ecosystem for some time, I’m kinda surprised HTAs are still around, I’m guessing to avoid breaking things. Once .NET started taking off - I always assumed that would replace the VBScript side of things and let you build proper, elegant system interfaces for your JavaScript app. I really imagined the goal was to drop Windows forms/object controls - but I always imagined BATTLES at m$ over being able to create Windows “apps” that didn’t conform to native UI controls, couldn’t be controlled through Windows theming engines, etc. kinduva brand control battle. I always imagined some team going “NOOO, just build a web app, you’re breaking all the UI rules!!!”
Someone clearly hasn’t worked in any sort of sizable code base. Come back when you are writing something spanning hundreds of JS files and where it takes you three times the time to verify that any small change isn’t a typo or wrong type off from a runtime error. TS heavily speeds up the development cycle by bringing an entire class of errors from runtime to compile time and that has nothing to do with OO and inheritance.
Simply put, TS is an infinitely better and safer language to develop in and it took the web world by storm for a reason. People didn’t decide to switch en masse for shits and giggles and you should realize that just because you have a different view does not mean that everyone else around you is wrong.
> m$
Seriously? It’s 2024, and we’re all adults. This does nothing but water down your point.
I would expect this to have very limited compatibility, and even with the transpiling, very limited performance. Or is it possible for this to somehow use Chakra, or Edge's V8 engine?
Nifty project, but IMHO the world is better off using native JavaScript without all the BS that comes with TypeScript, etc. JavaScript is so powerful and amazing, it’s a bummer to hamstring your app by using TypeScript and classic OO inheritance models that preclude the beauty and dynamics of JavaScript as a functional, prototypal language.
Yes, ES6 brings the OOPiness
The idea that Microsoft was attempting to turn JS into an object oriented C# clone was a very common objection in the early days of TS (especially since one of the lead developers on the project is also the primary architect of C#). That objection ended up being completely false. TS aims to type check the full gamut of existing JS, and embraces all of the language's quirks and idioms. There are people doing serious functional programming in TS with libraries like fp-ts and effect (which is basically the TS version of Scala's Zio). If this is your primary objection I would give TS a second look.
Ita clearly great for large orgs and interchangeable devs.
I think you have outdated view of TypeScript. Using generics and conditional types you can model the "beauty and dynamics" pretty well, without any OO pattern (if you wish so).
Ugh. Well if you will start spouting nonsense about JavaScript being better without Typescript then you can hardly be surprised when people correct you can you?
Would you complain about "airbag warriors" or "gps warriors" if you were making comments about how driving a car without them was so much better and GPS and airbags are BS?
Typescript is no more OO than JS is. Typescript is simply a way to document, and optionally compile time enforce, what fields objects have and what objects methods/functions take in and return.
That is all TS does. It documents what is already there so you don't make typos on field names.
Lately I'm writing a project w/o typescript and I spent an hour finding a bug the boiled down to "tilewidth" vs "tileWidth". (The code didn't explode until much later when a computed value didn't exist)
That is the type of bug TS prevents from ever happening.
A linter would do the same, way better and faster.
do you think javascript was just too easy and people had to invent some bs to make it more interesting for no reason? You don't even know what you're talking about when you make the connection from ts to oop.
My experience comming into javascript is that it's a garbage language and the web stack was a joke, everything was hard for the wrong reason (css centering things kinda stuff)
All these modern tooling, though complicated, is not new in NORMAL programming and makes sense, so you cow boys learn to deal with it.
JS was certainly never a “garbage” language but the elegance is unappealing/unappreciated by entire classes of developers. I totally get the perspective, but it’s all based on a worldview that just doesn’t get functional programming
I'll accept that there are some intelligent developers out there that are more productive without static type checking, but I personally don't understand it. If you don't have a tool analyzing your program's types, then your brain becomes the type checker. I personally would much rather focus on higher level problems. I don't even see type checking and code formatting as human level concerns anymore, and would rather have my computer do it for me, but I guess it's just a preference. Do whatever works for you.
it's a comment about the thinking behind the design of the web stack including js
Just because you think that doesn’t mean it’s true. The sheer fact that TS has overtaken JS for the majority of web development says enough.
Has it? Or is that "just like your opinion, man"? Any citation? There's some sources that say it's more popular based on things like social mentions, etc, but that's a vanity metric. Perhaps the statement is true if you mean "web development" to be a very limited scope (like SPA using a build step), but I'm not even sure that's true then.
Obviously this doesn't apply to existing projects; you're grandfathered into the language barring a pretty big undertaking to move over, but if you go to any competent company doing modern web development on relatively new codebases, they will use TS over JS.
And if they don't, as an engineer, you should ask hard questions as to why not. Because if the answer is someone stuck in the early 2000s complaining about OO and strong typing not being needed, then that's completely missing what TS does (and especially what it did when it was released, which was pre-ES5) and how big of an impact it has to speeding up development.
(In face, the Java/C++/OO-types I know strongly dislike TS because it's structurally typed. TS doesn't care a jot who extends what - as long as they have the same properties it's happy. Hard to get more un-java than that.)
The real reason that TS won is simply that large teams (e.g. hundreds) cannot effectively work together on untyped JS. If you're doing a solo project, fill your boots - use JSDoc comments, sprinkle asserts around, whatever. But the webdev world at large doesn't care about Java or OO concepts, it settled on TS because huge teams can work effectively with it.
What I am saying is, across several comments you seem to be arguing that you think TS's massive popularity is partly due to its proponents liking Java or classical inheritance, or not understanding FP or closures, or something. And that's just wildly not true. And it's also not even true that the TS world particularly favors OO. If you weren't saying those things and I misunderstood, my bad!
An elegant typed one would be Structurae [0].
I imagine/would love to see a bunch of elegant non-typed ones as well.
I’d strongly encourage doing a deeper dive here. Functions in JS are objects and can have their own methods/props + scope. They’re a first class citizen.
How about reasonable scoping rules?
Pre-es6 JavaScript was a nightmare of ugly hacks needed to make the language usable. that = this and {...}() All over the place.
Nevertheless, it is of course very well known that efficient code in JavaScript will never run as fast as in a language such as C, but choice of language is a trade off, and in whatever language you choose you may also choose to be as “high performance” as possible within it even if it’s still not as performant than if you’d chosen a different language.
I guess I’m tainted/jaded by the early proponents and initial rationale that was absolutely tied to - “ewwww dynamic types!?! Gross, where are my strong/static types!?”. I’ve just fought that too many times - and that was a very strong argument at the inception of TS. There certainly are value props that go beyond and more to be discovered I’m sure.
I feel like MANY if not most of the devs I work with today simply use TS cause “that’s what you do these days” - but they have no clue what the “why” is and are baffled by native JS typing - and still consider JS “garbage” as a result. Bummer. In the Scala community I hear so much hate for NodeJS because it enables JS for server-side, “where it doesn’t belong” for many of these same old reasonings about typing (even with TS!?).
So yah, there’s value there, but you don’t NEED it to write large, good software. I’m clearly just jaded by the religious debates that have gone on and on - so despite their utility, I can come across very anti to the “solutions” to IMHO shitty arguments.
I try to avoid OO now days, and TS is my go-to language for modeling problems in the functional domain!
I mean - it's literally just JS with types! It still has closures, and still has everything about JS one can call functional. It's not some dramatically different language - it's JS, with a large category of runtime errors changed into linter errors. (And that's why people use it - not because they think "eww gross!" about something, which is a frankly silly thing to claim.)