4 ms·
For me the remaining pieces for Python are much more attainable than the missing pieces for typescript. I think basically all the helper TS things (eg KeyOf, et
by cdrini 4y ago
For me the remaining pieces for Python are much more attainable than the missing pieces for typescript. I think basically all the helper TS things (eg KeyOf, etc) are addable to Python. Runtime types are not addable to TS. It goes against some of the core principles of TS.
But I agree there are loads of missing features in Python :)
- davidatbu 4y agoYou might be (very) interested in this project then: https://deepkit.io/ https://deepkit.io/ The guy behind it made a PR to typescript proposing runtime availability of types[0], got rejected, and got going on it by himself. And he already has PoC libraries with the (early) equivalents of Pydantic/FastAPI/SQLModel (using runtime types for (de)serialization). I really hope this experiment works out and that it gains traction, because it's a massive value add to TS IMO. [0] https://github.com/microsoft/TypeScript/issues/47658 https://github.com/microsoft/TypeScript/issues/47658
- cdrini 4y agoOh wow! You are correct, I am very interested in it! Thanks for sharing! Honestly on most of my personal projects, I only use typescript via the jsdoc interface. I just never felt the need to get to 100% type safety for most projects. And I never liked how the types lend themselves to a style of programming which typescript can't support due to lack of runtime typing (eg multiple dispatch, function overloading, serialisation, etc). This project looks very cool, and shifts those tradeoffs for me! I'm going to need to give it a whirl!