Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow consuming TypeScript types and trees from MLscript #58

Open
LPTK opened this issue Jan 3, 2022 · 0 comments
Open

Allow consuming TypeScript types and trees from MLscript #58

LPTK opened this issue Jan 3, 2022 · 0 comments

Comments

@LPTK
Copy link
Contributor

LPTK commented Jan 3, 2022

The main idea is to interface with the TypeScript compiler and leverage its parser and type checker.

The benefits would be twofold:

  • We can reuse TS types from TS libraries or JS libraries with existing TS bindings, such as those in the popular DefinitelyTyped project. This would be a huge boon and would make MLscript actually usable for practical, real-world coding.

  • We can reuse the TS parser to retrieve functions that are missing some type annotations (for example, missing the return type, or plain JS functions missing all types), and still perform type inference for them.

The second point is actually really interesting on its own. Together with #57, it would mean we could use MLscript as a standalone TypeScript type-inferencer for JavaScript (and also for partially-annotated TypeScript files).

@LPTK LPTK added the ts-interop label Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant