News for hackers. Stuff that matters.
Re:TypeScript Roadmap 2019 by finchisko on Tuesday January 08, 2019 @05:36AM (#18854630)
I dream about typescript becoming statically compiled language. Or hybrid language similar to dart and flutter, which in dev mode is interpreted for fast reload times and in production it gets compiled to native code.
Re:TypeScript Roadmap 2019 by austincheney on Tuesday January 08, 2019 @06:23AM (#18854792)
It is only statically compiled. You run the tsc command to compile the TypeScript code to JavaScript output.
Re:TypeScript Roadmap 2019 by frontfor on Tuesday January 08, 2019 @07:20AM (#18854999)
I think the OP meant that it should compile to native code, which is not supported today.
Re:TypeScript Roadmap 2019 by z3t4 on Tuesday January 08, 2019 @04:32AM (#18854419)
Most people do not care about types, they care about smart intellisense and detecting errors such as a misspelled property.
Re:TypeScript Roadmap 2019 by austincheney on Tuesday January 08, 2019 @06:26AM (#18854808)
I disagree. Perhaps I am in the minority on this, I don't know. I care about types and don't care about intellisence. I write lots of atomic algorithms that are super-independent, independent of each other but also compensating for the changes by each other, and make heavy use of scope. It is very important to my code that things execute efficiently and accurately.
Re:TypeScript Roadmap 2019 by z3t4 on Wednesday January 09, 2019 @06:03AM (#18863848)
I do not understand what you mean. But it sounds like you are into functional programming !? Which works fine without type annotations. For example:

const sum = (number, number) => number+number

Where type annotations becomes unnecessary verbose.

Re:TypeScript Roadmap 2019 by austincheney on Friday January 11, 2019 @12:58AM (#18881326)
True. Consider this example:

    props.removes[cc] !== props.last.margin
TypeScript's strict types will see the error if the those are not the same data type. A TypeScript aware editor will yell at me before I compile the code. Perhaps what I really wanted is:

    props.removes[cc][0] !== props.last.margin
In JavaScript I would have to execute the code. If the code doesn't throw an error then I would have to examine the output to see if the resulting data structure matches what I expect. If not I have to run tests and track down the error. Then once the error is found and resolved I have to write unit tests for this scenario.
Re:TypeScript Roadmap 2019 by z3t4 on Saturday January 12, 2019 @10:50AM (#18891655)
You can use an auto-generated intermediate format when running the tests, that check each member object, give test coverage, etc. Eg. a tool that parses the code and inserts a bunch of checks above each member access. So you start with plain JavaScript, and you ship plain JavaScript.
Re:TypeScript Roadmap 2019 by ethelward on Tuesday January 08, 2019 @06:27AM (#18854815)
And a smart intellisense and efficient detection of misspelled properties are themselves strongly dependent on a decent types system.
Re:TypeScript Roadmap 2019 by z3t4 on Wednesday January 09, 2019 @05:39AM (#18863744)
JavaScript will always convert a value to a type. It's dynamic, but very strongly typed. JavaScript engines do not care about type annotations, only TypeScript does. You might have annotated something as a number, but the JavaScript engine might chose to convert it to a string ... I think type annotations is a unnecessary chore, and that types should be inferred.
Re:TypeScript Roadmap 2019 by ethelward on Wednesday January 16, 2019 @10:26AM (#18921594)
Types cannot be inferred in dynamic typing systems. That is the whole point of dynamic type systems: type might change during runtime.
Re:TypeScript Roadmap 2019 by WorldMaker on Tuesday January 08, 2019 @02:22PM (#18858654)
I'm not sure I agree with the quantity "most", but clearly the Typescript team also cares about the people that don't need/want types, but do care about smart intellisense and detecting basic errors. A large part of this roadmap directly deals with that directly, because Typescript is powering more and more JS experiences in editors. The most direct section on this in the roadmap is the one titled: "JavaScript: TypeScript beyond TypeScript". But also a good majority of the "Developer productivity tools and integration" directly or indirectly involves both JS without types and TS with types.

If you use Atom or VSCode or any of the other growing number of editors that use Typescript to power their JavaScript/ECMAScript experiences, this Roadmap should help reassure you that the team still has you in mind and wants you to be happy.

(One of the interesting parts here is the reveal that Typescript is moving to use ESLint everywhere instead of TSLint. It's an interesting investment into the lint experience across the board for both JS and TS.)

Re:TypeScript Roadmap 2019 by sebazzz on Tuesday January 08, 2019 @10:20AM (#18856049)
Types are documentation, very useful in large dynamically- typed code bases.
Re:TypeScript Roadmap 2019 by z3t4 on Wednesday January 09, 2019 @05:51AM (#18863800)
Type annotations does not replace proper documentation. And with properly named parameters the annotations are not needed.

It's also a convention among JavaScript programmers that each function should not only check the parameters, but also convert them, so you can leave out optional arguments, pass a notated object {foo: "bar"}, or pass a string and have the function convert it to an array so you can write foo(bar) instead of foo([bar]) when calling the function. Or convert an object if it's not of the correct instance. This is more fun then annotating types and having a compiler shout out weird errors at you.

Re:TypeScript Roadmap 2019 by abdulkareemsn on Tuesday January 08, 2019 @10:35AM (#18856218)
Actually types enable suggestion (in visual studio parlance intellisense )
Re:TypeScript Roadmap 2019 by z3t4 on Wednesday January 09, 2019 @06:12AM (#18863875)
TypeScript is already good at inferring the types, so you can get suggestions on unannotated code, but I think TypeScript should get even better at inferring by getting closer to what a JS engine do and closer to the JS spec (eg. get rid of the type annotations)
Re:TypeScript Roadmap 2019 by Vanit on Tuesday January 08, 2019 @09:45AM (#18855776)
So types then?