Giter Club home page Giter Club logo

Comments (7)

mariakleiner avatar mariakleiner commented on July 24, 2024

If the view is only used as "in" connection, there is no need to copy (sorry, that was my bad in the recipe we discussed earlier today), you can just map, as in:
recipe
map as view0
map as view1
Greet
greeting <- view1
PersonalGreet
person <- view0

https://glitch.com/edit/#!/mmandlis-arcs-hello-world?path=arc.manifest:24:0

Can you try, if "map" works in this example too?

from arcs.

shans avatar shans commented on July 24, 2024

We have this requirement for low-level resolution that the resolver can't make decisions. When you've got a view reference there are 4 things you can do to it:
(1) create a new view in the arc
(2) use an existing view that's already in the arc
(3) map (readonly) to an existing view that's in a different arc
(4) copy a view from a different arc into the current arc

If you specify a constraint (HelloWorld.hello -> Greet.greeting) then there's a clear signal that you explicitly want a newly created view coordinating communications between the two particles.

Otherwise, if you have a view that isn't specified in a constraint then we default to 'use', because generally you want to "graft" a recipe onto what's already in the arc.

This leaves 'map' and 'copy' as exceptional things that you explicitly need to call out in a recipe. This is the trade-off we had to make to reduce the resolved recipe count down to something reasonable. Note that this only applies to resolution - in the future we'll hopefully be able to add some magic that can make these kinds of decision at a higher level, we just don't know how to do that yet.

Does this help?

from arcs.

dstoc avatar dstoc commented on July 24, 2024

Not sure it makes sense in the manifest documentation, probably a new .md specifically around how recipes are resolved.

from arcs.

noelutz avatar noelutz commented on July 24, 2024

That's super helpful. Thanks for the background!

Just double-checking I'm getting this right: so "use" doesn't work here because it assumes the view in the Arc to be writable which it isn't because in this case we're talking about a static view specified in the manifest?

Suggestion: could we default (or fallback) to "map" instead of "use" when views are only used as inputs in particles? That might be useful specially if "use" fails because it's a ro view.

from arcs.

shans avatar shans commented on July 24, 2024

No, "use" means the view is already mapped into the arc that you're applying the recipe to. "use" view references will have the same access rights as the view being referenced.

I don't think it makes sense to default to map for input-only particles because that would stop a lot of the demo from working (e.g. applying the Arrivinator wants to "use" a view inside the arc rather than "map" a new view in. Also, wouldn't ro views be fine for input-only particles? I think I must be missing something.

from arcs.

seefeldb avatar seefeldb commented on July 24, 2024

For the Arrivinator example 'use' makes sense, but I could imagine in other cases the recipe just implies "data comes from the outside" and probably wouldn't care much. E.g. the wishlist doesn't have to be 'map'ped, it could also be generated by some other particle and then 'use'd.

I.e. isn't 'use' and 'map' the same (put data in the arc before applying this recipe)? Except of course a map that also comes with a specific source to be mapped in.

from arcs.

mariakleiner avatar mariakleiner commented on July 24, 2024

I think this issue is obsolete.

from arcs.

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.