A little off-topic: I'm currently trying to find a way to write (type safe) business logic once, then reuse it pretty much everywhere (mobile / web / desktop),and it seems to me that typescript has become the only option. Javascript runtime is present everywhere, and can interface with anything. Does someone knows of another alternative (viable right now, or in the coming months) ? I know llvm can theoretically targe…
Clojure has a specification language that can express more and less things than a type system can and runs on mobile web desktop with flexible choices for run times
Google Feedback on TypeScript 3.5
41–50 of 149 posts
Re: Google Feedback on TypeScript 3.5
#42Re: Google Feedback on TypeScript 3.5
#43> (I might suggest the underlying problem in this code is relying on inference too much, but the threshold for "too much" is difficult to communicate to users.) This is a very outstandingly interesting line out the whole writeup. I like the writeup in its entirety for being very balanced and thoughtful, but this line in particular really stands out to me as worth more thought for anyone interested in language and typ…
Personally, I experience this quite often, e.g. in Java whenever arrow functions are heavily used, such as with streams.
It would be nice to have compilers report the whole inference chain somehow, just to be clear about all possible spots where things might be wrong. But I suppose that's difficult to visualize in a well human-readable way.
Re: Google Feedback on TypeScript 3.5
#44> (I might suggest the underlying problem in this code is relying on inference too much, but the threshold for "too much" is difficult to communicate to users.) This is a very outstandingly interesting line out the whole writeup. I like the writeup in its entirety for being very balanced and thoughtful, but this line in particular really stands out to me as worth more thought for anyone interested in language and typ…
Re: Google Feedback on TypeScript 3.5
#45Re: Google Feedback on TypeScript 3.5
#46I'm really curious how many lines of TypeScript are in use at Google. I bet most JS is still Closure.
Re: Google Feedback on TypeScript 3.5
#47Not a TypeScript user, but what really stood out to me is that Google are using a monorepo.
that stood out to me too... not the monorepo really, but the fact its a monorepo of a billion lines of code. seems almost impossible to maintain when you have a dependency change at the lowest levels that affects numerous projects.If i am understanding google was in a situation where they had to update every project that used typescript inside the entire company at the same time, that seems untenable.
Re: Google Feedback on TypeScript 3.5
#48Is there a way to migrate jsdoc-annotated JavaScript code over to TS, and is TS's minifier as good as Google's closure-compiler yet?
Re: Google Feedback on TypeScript 3.5
#49> (I might suggest the underlying problem in this code is relying on inference too much, but the threshold for "too much" is difficult to communicate to users.) This is a very outstandingly interesting line out the whole writeup. I like the writeup in its entirety for being very balanced and thoughtful, but this line in particular really stands out to me as worth more thought for anyone interested in language and typ…
1) Make types explicit (or generic) at any interface boundary
2) Periodically query the inferred types of things from my editor just to make sure they come out to what I expect
3) If an error message feels like it's in the wrong place or an inferred type isn't what it should be, progressively make things more explicit until the problem is resolved
But you're right, that's all very subjective and dependent on learned norms.
Re: Google Feedback on TypeScript 3.5
#50> (I might suggest the underlying problem in this code is relying on inference too much, but the threshold for "too much" is difficult to communicate to users.) This is a very outstandingly interesting line out the whole writeup. I like the writeup in its entirety for being very balanced and thoughtful, but this line in particular really stands out to me as worth more thought for anyone interested in language and typ…
IIRC there are a couple of Rust write ups about this. In Rust, inference is limited within functions. The language doesn't allow inferring the argument or return types of functions to avoid this kind of action at a distance. The function API is just one of the many arbitrary places where one can limit inference and require users to provide types. In other languages the module boundary might also be an appropriate pla…