Earlier quoted context omitted.
Better for what? Quickly churning out short-lived code to get the next round of funding, definitely. Writing (and _supporting_) "serious" projects over the long term, which also require high performance and/or high scalability, and can rip through terabytes of data if needed, definitely not. (All IMHO from lots of personal experience.)
Depends on your architecture. For scaling out rather than up, node and python are both far more performant because the footprint of minimum viable environment is much smaller. When you need to serve anywhere from 10-200,000 requests a minute on the same system quickly, and efficiently, lambda/azure functions/google app engine backed by node or python is pretty ideal. As an example, when my org needs to contact folks…
Node.js adds experimental support for TypeScript
311–320 of 570 posts
Re: Node.js adds experimental support for TypeScript
#312Earlier quoted context omitted.
most of that? name one
Java has type inference. Also if a type alias is just a new name for a existing type, then you can always do something like class MyNewClass extends OldClass {}; (of course it's not just a new name, it's also a new class, but it's also still a OldClass, and you are out of luck if OldClass is final or sealed) Java also has interfaces, of course. And optional properties (using Optional) and strict null checks, when you…
Re: Node.js adds experimental support for TypeScript
#313Earlier quoted context omitted.
most of that? name one
Java has type inference. Also if a type alias is just a new name for a existing type, then you can always do something like class MyNewClass extends OldClass {}; (of course it's not just a new name, it's also a new class, but it's also still a OldClass, and you are out of luck if OldClass is final or sealed) Java also has interfaces, of course. And optional properties (using Optional) and strict null checks, when you…
very limited, for instance you must declare the type of a public method
> alias
as you point out it's not
> Java also has interfaces, of course
but you have to implement them explicitly
> strict null checks, when you want that, you can use it
if we start accepting static analysis tools then C has null checks as well I guess
Re: Node.js adds experimental support for TypeScript
#314Hi I'm the author of the PR, AMA
Out of curiosity, what do you see as next steps, and what possible futures do you see for typescript in the node- and overall JS-ecosystem?
Re: Node.js adds experimental support for TypeScript
#315One 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…
Using inequality signs as angled brackets really is a mistake isn't it...
There was no perfect solution available, so a tradeoff was necessary. You can disagree with this particular tradeoff, but had they gone another way some people would disagree with that as well. To be a mistake there would have had to have been an option available that was clearly better at the time.
Anyway, the idea that TS 5 should be backwards compatible with TS 1 is probably a bad one. Personally, I think packages with wide usage break backwards compatibility far too easily -- it puts everyone who uses it on an upgrade treadmill, so it should be done very judiciously. But even I wouldn't argue that TS 1 should have been its final form.
Re: Node.js adds experimental support for TypeScript
#316Earlier quoted context omitted.
Using inequality signs as angled brackets really is a mistake isn't it...
I’ll flip this around… reusing comparison as angle brackets is the mistake. C++ ran into some issues too. I think Rust made the really smart move of putting :: before any type parameters for functions. Go made the good move of using square brackets for type parameters.
Re: Node.js adds experimental support for TypeScript
#317If 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
#318Earlier quoted context omitted.
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.
Flow tries to be sound and that makes it infinitely better than TS where the creators openly threw the idea of soundness out the window from the very beginning.
Re: Node.js adds experimental support for TypeScript
#319Earlier quoted context omitted.
tsx has very slow startup performance, I prefer https://github.com/swc-project/swc-node which is around twice as fast.
Does swc-node work with code coverage calculation libraries? For a long time tsx didn’t (and it’s still pretty finicky) so that kept me from using it.