Earlier quoted context omitted.
There is an EcmaScript proposal to go in that direction: https://github.com/tc39/proposal-type-annotations I think this should be part of the language spec.
Beyond ugly. They should just make TS official and be done with it. E: I thought it was JSDoc proposal. Ignore the comment.
Node.js adds experimental support for TypeScript
151–160 of 570 posts
Re: Node.js adds experimental support for TypeScript
#152Bun’s DX is pretty unprecedented in this space, and most of my use cases are now covered / not causing Bun to crash (when actually using run-scripts with `bun run`). Meanwhile, I can’t configure node to not require extensions on import, nor have tsc configured to automatically add .js extensions to its compiled output, without adding on a bundler… although native TypeScript support would remedy this nit quite a bit,…
Well except for Deno...
Re: Node.js adds experimental support for TypeScript
#153Earlier quoted context omitted.
There is an EcmaScript proposal to go in that direction: https://github.com/tc39/proposal-type-annotations I think this should be part of the language spec.
Beyond ugly. They should just make TS official and be done with it. E: I thought it was JSDoc proposal. Ignore the comment.
Re: Node.js adds experimental support for TypeScript
#154Earlier quoted context omitted.
> we all just wanted java with JIT, more feature rich type system Java has JIT. How is TypeSript type system feature-richer than the Java one?
I don't use them directly much, but template literal generic and contidiontal types is probably the closest a mainstream language has inched towards dependent types. Some examples of TypeScript power: - SQL database in TypeScript types: https://github.com/codemix/ts-sql - Statically typed raw SQL queries: https://github.com/andywer/squid?tab=readme-ov-file#tag-func... - (Someone fill in your TS hackery for me)
- BF: https://github.com/susisu/typefuck
- Assembly: https://github.com/judehunter/ts-asm
Re: Node.js adds experimental support for TypeScript
#155I'm honestly giddy. This could be the (slow) beginning of a new era, where "JS with types" is finally a native thing. I'm even willing to forgive all the mess that CJS vs. ESM is if they manage to pull this off. I hope this sees widespread adoption/usage, which might finally cause some movement to integrate TS into ecmascript after all. Some dynamically-typed language fanatics (which are, in my opinion, completely de…
> the reality that static types are what the vast majority of devs want [citation needed]
Re: Node.js adds experimental support for TypeScript
#156One thing to note is that it is impossible to strip types from TypeScript without a grammar of TypeScript. Stripping types is not a token-level operation, and the TypeScript grammar is changing all the time. Consider for example: `foo ( x )`. In TypeScript 1.5 this parsed as (foo (x)) because bar&baz wasn’t a valid type expression yet. When the type intersection operator was added, the parse changed to foo (x) which…
Re: Node.js adds experimental support for TypeScript
#157Re: Node.js adds experimental support for TypeScript
#158One thing to note is that it is impossible to strip types from TypeScript without a grammar of TypeScript. Stripping types is not a token-level operation, and the TypeScript grammar is changing all the time. Consider for example: `foo ( x )`. In TypeScript 1.5 this parsed as (foo (x)) because bar&baz wasn’t a valid type expression yet. When the type intersection operator was added, the parse changed to foo (x) which…
Re: Node.js adds experimental support for TypeScript
#159Earlier quoted context omitted.
Typescript is way better than Java, in my experience. It's a lot less verbose. A lot more flexible.
They are not comparable. If anything, Kotlin is the equivalent in the JVM universe.
Re: Node.js adds experimental support for TypeScript
#160I really enjoy typescript and have been yearning for a typescript runtime but I can't help but laugh that I left java all those years ago to finally seek something a lot closer to java. I guess we all just wanted java with JIT, more feature rich type system and gradual typing. Also for all the shortcomings of npm ecosystem, it is a lot less daunting and more fun to be using libraries in this ecosystem. And surprising…
> we all just wanted java with JIT, more feature rich type system Java has JIT. How is TypeSript type system feature-richer than the Java one?
Utility types, like Partial, are basically impossible to represent in Java except with almost-duplicated classes.