News for hackers. Stuff that matters.
Re:Introducing TypeChat from Microsoft by katamaster818 on Thursday July 20, 2023 @04:30PM (#36806317)
Hang on, so this is doing runtime validation of an object against a typescript type definition? Can this be shipped as a standalone library/feature? This would be absolutely game changing for validating api response payloads, etc. in typescript codebases.
Re:Introducing TypeChat from Microsoft by tehsauce on Thursday July 20, 2023 @04:33PM (#36806343)
Re:Introducing TypeChat from Microsoft by katamaster818 on Thursday July 20, 2023 @04:38PM (#36806414)
yup, just found that, super neat, I am 100% interested in using this for other runtime validation...

It's interesting because I've always been under the impression the TS team was against the use of types at runtime (that's why projects like https://github.com/nonara/ts-patch exist), but now they're doing it themselves with this project...

I wonder what the performance overhead of starting up an instance of tsc in memory is? Is this suitable for low latency situations? Lots of testing to do...

Re:Introducing TypeChat from Microsoft by jacamera on Thursday July 20, 2023 @07:51PM (#36808370)
Great point. They're against it unless you're running it in a loop and paying for every API call!