Re:Show HN: Imba – I have spent 7 years creating a programmi...
by valyagolev on Tuesday August 17, 2021 @06:55AM
(#28208467)
is there any particular reason why there doesn’t seem to be built-in type-checking system? i know it still seems to be a “personal preference” whether to check one’s types, but i wonder if any thought was given to including it?
[ Parent
| on HN ]
Re:Show HN: Imba – I have spent 7 years creating a programmi...
by somebee on Tuesday August 17, 2021 @07:18AM
(#28208629)
There is built-in type-checking, but currently only via the tooling. It integrates with TS as a language service plugin (https://github.com/Microsoft/TypeScript/wiki/Writing-a-Langu...) so you get great warnings/errors, type inference and much more. To define standalone types or interfaces you still need to use `.d.ts` files, but that may change in the future :)
Re:Show HN: Imba – I have spent 7 years creating a programmi...
by valyagolev on Tuesday August 17, 2021 @08:15AM
(#28209027)
that is to say, the types are not part of the syntax in any way?
Re:Show HN: Imba – I have spent 7 years creating a programmi...
by somebee on Tuesday August 17, 2021 @08:19AM
(#28209060)
You can typeset variables, parameters etc (ie. see the code in https://dev.to/somebee/global-type-augmentations-with-automa...). But declaring standalone types is still done in `.d.ts` files. Imho, the type inference in ts/js is getting so good that I very rarely need to declare any explicit types in my own projects.