Git Product home page Git Product logo

Comments (7)

NathanReb avatar NathanReb commented on June 27, 2024

I'd like to give this a try in order to make my life easier with #61.

I'm trying to understand what the scope of this actually is.

My understanding so far is that we want to get rid of the attr_* smart constructor and replace them with something more in the line of Context_free.Rule.extension that would only allow you to declare a rule for the deriving attribute.
Removing these smart constructors is gonna break the API but I assume we don't consider this as a problem since they're probably only used in Deriving.

These smart constructors appear to be called a single time, on all the registered generators at once. I'm not sure exactly what the new API should look like.

I'm also guessing this is the occasion to leak a bit less about the internal types in Context_free.Rule.

from ppxlib.

 avatar commented on June 27, 2024

My understanding so far is that we want to get rid of the attr_* smart constructor and replace them with something more in the line of Context_free.Rule.extension that would only allow you to declare a rule for the deriving attribute.

I was thinking to completely remove them and make Context_free depend on Deriving. i.e. context_free.ml would directly call functions from Deriving.

Removing these smart constructors is gonna break the API but I assume we don't consider this as a problem since they're probably only used in Deriving.

Agreed.

BTW, I remember that I tried this last year. My attempt is in the branch simplify-context-free. I don't remember exactly what's the status of this branch is, but it might be worth having a look. I couldn't easily get rid of the circular dependency between Context_free, Deriving and Driver, which was annoying and required forward references, but I don't know if we can do better though.

from ppxlib.

kwshi avatar kwshi commented on June 27, 2024

Hmm-- I'm working on a project that requires [@@deriving]-like features, except on module declarations. As far as I can tell, [@@deriving] only currently supports types. If there is no plan to develop the attr-libraries and use only [@@deriving], what shall I do?

from ppxlib.

 avatar commented on June 27, 2024

I know ppx_deriving allows this. It seems fine to add the same support in ppxlib.

from ppxlib.

kwshi avatar kwshi commented on June 27, 2024

Does it, really? The API docs seem to indicate only support for type_ext and type_decl transformers (no mention of modules whatsoever), and every single one of the examples in the README only shows @@deriving being used on types, not modules.

from ppxlib.

gasche avatar gasche commented on June 27, 2024

This message helped me realize that the API docs for ppx_deriving were way out of date, I just updated them. The new docs, and it does mention the hooks to operate on module types (not modules), which were implemented in ocaml-ppx/ppx_deriving#94.

from ppxlib.

kwshi avatar kwshi commented on June 27, 2024

Thanks for updating the docs! My project, however, requires operating on a module expression, which so it seems is not provided by deriving.

from ppxlib.

Related Issues (20)

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.