Comments (5)
Dune doesn't support classical ppx. Instead, I believe it does all the preprocessing ahead of time, and then calls ocamlc on the already preprocessed files. I've heard this is a big performance win because it can do the preprocessing in one go, instead of calling each ppx as a separate process.
The staged_pps
option should help you get around the problem of being forced to do the preprocessing before any compilation. See the docs here: https://dune.readthedocs.io/en/latest/dune-files.html?highlight=staged_pps#preprocessing-specification
from relit.
Dune working with Relit would be awesome! Relit works by typechecking within a PPX, which requires being passed a list of ocaml object files (.cmo, .cma) from the build system. This works fine when run as a classical PPX; ocamlc is passed a -ppx
option and it passes on the right object files to Relit.
Dune doesn't support classical ppx. Instead, I believe it does all the preprocessing ahead of time, and then calls ocamlc
on the already preprocessed files. I've heard this is a big performance win because it can do the preprocessing in one go, instead of calling each ppx as a separate process.
Since Relit does need those object files to run, I don't think it'll ever work in this environment. (The workaround ppxfind also didn't help when I tried: I think it wraps a PPX executable to be used within a driver, which still doesn't have the object files.)
There is some hope: Relit could be slightly refactored to be a compiler plugin instead of a PPX. I haven't seen much documentation about these beside that page, so I'm not sure how supported they are. There's also the possibility that dune supports/will support passing arbitrary compiler flags or straight up supports classical ppx in the future. I don't know how likely that is. Overall, the chances of Relit working with Dune seems pretty low in the near future, but it's also been a couple months since I've done any research so I'll try looking into it again soon!
from relit.
This works! I've changed the test suite and the examples to use dune. 🎉 It took a small bug fix in dune, so we require installing the very latest version of dune until the fix gets onto opam.
from relit.
@rgrinberg- you have any thoughts on the feasibility of this?
from relit.
Woah that's awesome! I'll take a longer look soon
from relit.
Related Issues (15)
- Very simple toy example to demonstrate basic concepts (not in paper) HOT 2
- Avoid Failure at all costs HOT 3
- support `let notation $r = $regex` and add tests
- See if we can put lexer and parser in the same package as the notation definition HOT 2
- Debug mode!
- Support for ppxlib.0.3.1+ HOT 1
- Support for OCaml 4.06 HOT 7
- Update installation instructions to use opam
- Small context independence bugs HOT 7
- Specify notations in signatures HOT 2
- Make it so that read_to doesn't balk on extra spaces
- Make it so read_to returns the current splice if it reaches the end of the literal
- Do-notation HOT 2
- Add TLMs to OCaml HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from relit.