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

Long term aim: Remove binary writer from TPSDK #299

Open
dsyme opened this issue Apr 9, 2019 · 1 comment
Open

Long term aim: Remove binary writer from TPSDK #299

dsyme opened this issue Apr 9, 2019 · 1 comment

Comments

@dsyme
Copy link
Contributor

dsyme commented Apr 9, 2019

The TPSDK includes a 2000 line internalized optional binary writer incorporated into each generative type provider. This is because generative type providers communicate their generated code to the F# compiler by giving an actual .NET binary which is then statically linked into the target output. The type definitions for the generated binary is specified by ProvidedTypeDefinition etc. and the code by quotations.

While there are no known bugs in the binary writer, we would like to eventually remove the writer from the TPSDK. This could be done in two ways

  1. We could use an existing binary writer. The main problem here is that it causes TPDTC components to have dependencies and TPDTC are not loaded in isolation.

  2. We could modify the TP-compiler API so that no binary writer is needed.

On (2), the use of generated assemblies itself is a clumsy way to communicate code to the F# compiler. The F# compiler could be modified so that this is deprecated and that it directly takes quotations and translates them using its own binary writer, rather than using any static linking. This would make it harder or impossible for generative type providers to host C#-code generators, and we would deprecate that

@NinoFloris
Copy link

NinoFloris commented Apr 9, 2019

Upside to that approach of using quotations instead is that it opens up new avenues like using TPs for JS where that 'just works'

@dsyme dsyme changed the title Long term aim: remove binary writer from TPSDK Long term aim: Remove binary writer from TPSDK Aug 23, 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

2 participants