Consider expanding ExternResult to allow for non-pointer "result" data #252

Open
opened 2020-08-06 16:57:22 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 16:57:22 +00:00 (Migrated from github.com)

I'd like to explore reifying data (if that's a correct use of this term) which we may want to return over the FFI channel.

As I'm working on #698, a common pattern is:

  • perform action X (which might fail), resulting in a new entity in the store
  • return new entity's entid/guid/etc for relatively short-lived reference from the other side
  • ... or return a sensible error

I want to avoid having to manage memory across FFI, as that complicates matters. The only thing an external consumer may need is data itself, not internal pointers to data.

A trivial generalization may be, "for a given query/operation, give me result value (a string, a number, an array, a map, a ...), or an indication of absence, or fail gracefully". Data itself is a representation of some internal system state at a point in time, but not necessarily a reference to that state.

I'd like to explore reifying data (if that's a correct use of this term) which we may want to return over the FFI channel. As I'm working on #698, a common pattern is: - perform action X (which might fail), resulting in a new entity in the store - return new entity's entid/guid/etc for relatively short-lived reference from the other side - ... or return a sensible error I want to avoid having to manage memory across FFI, as that complicates matters. The only thing an external consumer may need is data itself, not internal pointers to data. A trivial generalization may be, "for a given query/operation, give me result value (a string, a number, an array, a map, a ...), or an indication of absence, or fail gracefully". Data itself is a representation of some internal system state at a point in time, but not necessarily a reference to that state.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#252
No description provided.