caterinaurban / Typpete

34 stars 6 forks source link

Use typeshed in lieu of custom type stubs? #54

Open ethanhs opened 4 years ago

ethanhs commented 4 years ago

Hi! First off, this seems like a very promising project, I'm curious to see how far it can be taken. I was thinking it could be useful to use typeshed stubs instead of the custom builtin definitions, as typeshed is much more complete.

I expect there are things in typeshed that may cause issues?

caterinaurban commented 4 years ago

Hi, thanks! Indeed, at some point, we started trying to adapt it to use typeshed but we got stuck when we tried to support union types. We could not find an efficient SMT encoding to support them. One idea we had later on was to support them as annotations but never infer them. We never got to try that, though.

ethanhs commented 4 years ago

Ahh, I see, that makes sense. Yeah having some means of using the written out unions would be very handy.

adsharma commented 3 years ago

+1 for typeshed stubs. https://github.com/JelleZijlstra/typeshed_client may be interesting as well.

adsharma commented 2 years ago

https://github.com/adsharma/Typpete/commit/b667510ba95a713bc3ed12e103a19858665d20e9 uses typeshed_client to build ast from module name.

However, it exposes a number of problems in typpete (features not supported yet). I tried to hack around them, but stopped after the hacks started looking ugly and unmaintainable.

Let me know if anyone wants to help out.

adsharma commented 2 years ago

These are the hacks I tried: https://dpaste.com//9KJDYK343

The issue I believe is that the stubs shipped with Typpete use a careful subset of the language supported by Typpete, whereas the one in typeshed uses features not supported by Typpete yet.