Earlier quoted context omitted.
Kotlin is much closer to Java than to TypeScript even in terms of flexibility.
To me "Flexibility" sounds a lot like "The programmer always knows what he does".
Node.js adds experimental support for TypeScript
351–360 of 570 posts
Re: Node.js adds experimental support for TypeScript
#352In which case wouldn't V8 support TS directly without needing to transpile?
Re: Node.js adds experimental support for TypeScript
#353I might be ignorant but wasn't there a plan to add Typescript support to the browser itself? In which case wouldn't V8 support TS directly without needing to transpile?
> There is a TC39 proposal for type annotations
Which links to https://github.com/tc39/proposal-type-annotations
It is a long ways off though.
Re: Node.js adds experimental support for TypeScript
#354Earlier quoted context omitted.
> the reality that static types are what the vast majority of devs want [citation needed]
https://github.com/tc39/proposal-type-annotations?tab=readme... You’re welcome.
I bet the percentage of web developers who want this are a tiny minority. There are just too many issues with this.
Static typing without the benefits of better runtime performance, soundness, strong typing etc. is basically just documentation/comments with extra steps.
Also TS is a complex, moving target. Most devs don't want to learn new fancy features every couple of months, but prefer stability guarantees. Several notable projects have moved away from TS. Even Ryan Dahl admitted that integrating Deno with TS was probably a mistake.
Meanwhile you have WASM slowly and steadily getting crucial features on a sound foundation.
I'm extremely cautious about TS and wary of the hype surrounding it.
Re: Node.js adds experimental support for TypeScript
#355I beg of thee, do not do this. I get that people love typescript but I am already running into a problem where javascript resources are written in typescript by default with nothing for regular javascript. This is the same problem that happened when JQuery hit its peak popularity and an overwhelming amount of resources and guides amounted to "Oh just do this in JQuery"
jQuery was so popular because writing anymore than a few lines of vanilla JavaScript was an *awful* experience due to all differences in browsers.
When things eventually standardized-ish and jQuery became unnecessary, other libraries/ecosystems popped up (e.g. React/JSX) to make writing webapps easier because writing anymore than a few lines of vanilla JavaScript was still an *awful* experience.
When webapps grew in size and scope, other "transpiled" languages popped up (e.g. TypeScript) because writing anymore than a few lines of vanilla JavaScript is *still an awful* experience.
We're stuck with JavaScript due to past decisions, but let's not pretend it's actually a good tool. If it were we wouldn't need 50,000 tools/frameworks/transpiled languages to hide how terrible it is.
Re: Node.js adds experimental support for TypeScript
#356It's been a really eventful month for Node. First they added node:sqlite in v22.5.0, and now TypeScript support is landing. I love the direction Node is heading in.
The recently-added test runner is very cool too!
Re: Node.js adds experimental support for TypeScript
#357If Node.js can run TypeScript files directly, then the TypeScript compiler won't need to strip types and convert to JavaScript - it could be used solely as a type checker. This would be similar to the situation in Python, where type checkers check types and leave them intact, and the Python interpreter just ignores them. It's interesting, though, that this approach in Python has led to several (4?) different popular…
Flow (by Facebook) used to be fairly significant in the JavaScript several years ago, but right now it's somewhat clear that TypeScript has won rather handily.
Re: Node.js adds experimental support for TypeScript
#358Earlier quoted context omitted.
> it's just what a default POJO (with nullable properties) already is I think you missed the point. Partial is an example of a "mapped type", see the handbook for more explanation: https://www.typescriptlang.org/docs/handbook/2/mapped-types....
I understand that much, just thinking aloud what problem would that solve in Java.
Re: Node.js adds experimental support for TypeScript
#359Earlier quoted context omitted.
Before that there was the closure compiler (Google) which had type annotations in comments. The annotation syntax in comments was a little clunky but overall that project was ahead of it's time. Now I believe even inside google that has been transpiled to typescript (or typescript is being transpiled to closure, I can't remember which - the point is that the typescript interface is what people are using for new code)…
Closure is almost a forgotten child of Google now. Does not even fully support ES2022 as of today. We are working hard to get rid of it completely. Surprise, lots of important projects still rely on it today.
Re: Node.js adds experimental support for TypeScript
#360I might be ignorant but wasn't there a plan to add Typescript support to the browser itself? In which case wouldn't V8 support TS directly without needing to transpile?
that would be a lot of work
I would rather see new WASM features instead