Giter VIP home page Giter VIP logo

Comments (5)

rgrinberg avatar rgrinberg commented on September 27, 2024 4

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.

charlesetc avatar charlesetc commented on September 27, 2024 1

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.

charlesetc avatar charlesetc commented on September 27, 2024 1

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.

struktured avatar struktured commented on September 27, 2024

@rgrinberg- you have any thoughts on the feasibility of this?

from relit.

charlesetc avatar charlesetc commented on September 27, 2024

Woah that's awesome! I'll take a longer look soon

from relit.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.