News for hackers. Stuff that matters.
Re:Announcing TypeScript 3.0 by sbjs on Monday July 30, 2018 @02:41PM (#17646866)
If everything is typed in TypeScript, I see a lot of serious potential for optimization, like using only the memory needed per object exactly like a struct in C or C++.
Re:Announcing TypeScript 3.0 by pcwalton on Monday July 30, 2018 @02:49PM (#17646932)
TypeScript isn't sound, so you can't rely on the types for optimization. The shape/hidden class optimization that JS engines already have is probably about as good as you can do.
Re:Announcing TypeScript 3.0 by hath995 on Monday July 30, 2018 @09:43PM (#17649892)
The last soundness issue I'm aware of is the bivariant function issue which they resolved in 2.6
Re:Announcing TypeScript 3.0 by jannes on Tuesday July 31, 2018 @08:05AM (#17652471)
You can still do something like this:

    let x: number = "some string" as any;
Re:Announcing TypeScript 3.0 by hath995 on Wednesday August 01, 2018 @02:48AM (#17660214)
That's sort of tautological. "Any" and type assertions are designed as the escape hatch of the type system. If you're trying to develop type safe typescript you obviously won't use those. The followup question is for typed code (excluding usage of any or type assertions) does typescript have an unsound type system? Afaik the answer is no.
Re:Announcing TypeScript 3.0 by jannes on Friday August 03, 2018 @04:32AM (#17678168)
In the real world you are forced to use "any" when the type definitions for a third-party library are not perfect.

This actually happens a lot with types from DefinitelyTyped that are not maintained by the original author of the library.

Re:Announcing TypeScript 3.0 by Too on Thursday August 02, 2018 @10:31AM (#17671669)
That would be the equivalent of static_cast in c++, or casting via (object) in C#. Both of those are considered type safe but can still be abused also.
Re:Announcing TypeScript 3.0 by mschuetz on Tuesday July 31, 2018 @04:30PM (#17656804)
I don't get it, I though the whole purpose of typescript is to prevent things like that?
Re:Announcing TypeScript 3.0 by nwienert on Monday July 30, 2018 @03:22PM (#17647191)
You could still infer sound areas such as certain structs and patterns for using them. They could introduce sound mode or patterns for areas as well.
Re:Announcing TypeScript 3.0 by sedatk on Monday July 30, 2018 @02:49PM (#17646934)
There is WebAssembly for that now.
Re:Announcing TypeScript 3.0 by mschuetz on Monday July 30, 2018 @02:52PM (#17646951)
I'm not a fan of WebAssembly. I like js because you can instantly reload and test changes to your code without lengthy build or compile times and I'm hoping for typescript to become standard so that the same applies for typescript. I doubt the same will ever be possible with WebAssembly.
Re:Announcing TypeScript 3.0 by sbjs on Monday July 30, 2018 @03:10PM (#17647093)
Anything more complicated than a little jQuery stuff is going to need build tooling anyway, at least Webpack and probably JSLint and Mocha. Since those are already there, adding either Babel or TyepScript isn't all that difficult.
Re:Announcing TypeScript 3.0 by rounce on Tuesday July 31, 2018 @02:56AM (#17651090)
Just took .284s to re-compile a Rust (stdweb) app targeting WASM.

And well over 2 seconds for Webpack to deal with (just) bundling 6 JS files and the .wasm file.

Re:Announcing TypeScript 3.0 by gameswithgo on Monday July 30, 2018 @04:15PM (#17647602)
what is lengthy to you? some languages can compile ~30k lines in 0.5 seconds
Re:Announcing TypeScript 3.0 by mschuetz on Tuesday July 31, 2018 @04:09AM (#17651406)
Anything > 1s

Curious, which languages compile that fast to WebAssembly?