Page MenuHomePhabricator

Create New Type Z77 to Wrap Function Calls for Envelope Functions
Open, Needs TriagePublic

Description

Description

Functions like Try/Catch, Get Error, etc. accept bare Z7s as arguments. This means that the function orchestrator has to manually suspend resolution of all arguments, changing execution order and making it difficult to model closures properly. If those functions instead accepted a wrapped Z7, the function execution model would be much more consistent and predictable, allowing for further improvements and optimizations.

Desired behavior/Acceptance criteria

  • creation of new type Z77 to wrap Z7 without executing it
  • new ZIDs allocated for functions to replace Z850, Z853, etc.
  • migration from Z850, etc. to new functions

Completion checklist

Event Timeline

Jdforrester-WMF subscribed.

Nit: Might want to accept both Z77 and Z7 transitionally, rather than disrupt? But also having a new set of Functions makes it easier to detect.

This needs a product decision.

Sounds like the way to go.

I’d suggest an explicit [Resolve] builtin too.

Also, I’m not sure we’re quite where we should be with object or default if error (Z37367). With an object that is explicitly a wrapped function call, we can provide a resilient fallback approach that explicitly avoids fatal or propagated errors, and maybe that might also be better as a builtin. I think it’s basically just the [try-catch] function but without being restricted to a single error type (which might be a list of error types, with an empty list being understood as any error type at all, or even dispatch by error type with a fall-through option).

Nit: Might want to accept both Z77 and Z7 transitionally, rather than disrupt? But also having a new set of Functions makes it easier to detect.

This needs a product decision.