-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 using PPXes as libraries #171
Conversation
- move ppx_config to Bsb_global_ninja_vars.global_config - move root `dune.bsb` file generation from `bsb_main.ml` to `bsb_ninja_gen.ml` - build the PPX with `Ppxlib.Driver.standalone` and pass the `--as-ppx` flag - Generate the `ppx.ml` file in the `.melange.eobjs` directory instead of at the toplevel of a project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small nits
How do I make use of this? It's not really clear from looking at the changes. |
@TheSpyder this will definitely need documented, and we've added it to the list in #105. A few informal notes:
|
That's the part I'm not clear on, the findlib name. I'm trying to make a branch of my old favourite decco that can integrate with this feature, to measure the speed difference on my fairly large project. |
you can run |
You need to depend on decco from source, btw, in your case via esy. I don't know how easy this is, but we could make a PR. |
yes, I tried that and it still tried to execute it as a binary instead of loading it as a library. I just need to fiddle a bit more (I'm currently trying to lift the |
I can't get it working, here's the branch I tried, but I also realised that this "PPX as library" feature really only helps if there are multiple PPX. It still builds the ppx as a separate executable, so for single ppx use it won't be any faster than the precompiled binary (just easier to install since precompiled executables are not required). This feature will likely help me in the future, but it's no longer important for me to try and get it working today :) |
@TheSpyder yeah that's true for us, but there is always multiple ppx pass, because we do a ppx pass ourselves. Ideally we should move Melange PPX to ppxlib |
fixes #121
TODO: