Skip to content

Commit 1df910c

Browse files
committed
Update stale resource type explainer wording
1 parent 80987f1 commit 1df910c

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

design/mvp/Explainer.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,11 @@ value so that:
559559
they often aren't).
560560

561561
The `own` and `borrow` value types are both *handle types*. Handles logically
562-
contain the "address" of a resource instance. Handles avoid copying the
563-
underlying resource in cases where copying is impossible or undesirable for
564-
performance reasons. By way of metaphor to operating systems, handles are
565-
analogous to file descriptors, which are indices into a table of resources
566-
maintained by the kernel. In the Component Model, handles are lifted-from and
562+
contain the opaque address of a resource and avoid copying the resource when
563+
passed across component boundaries. By way of metaphor to operating systems,
564+
handles are analogous to file descriptors, which are stored in a table and may
565+
only be used indirectly by untrusted user-mode processes via their integer
566+
index in the table. In the Component Model, handles are lifted-from and
567567
lowered-into `i32` values that index an encapsulated per-component-instance
568568
*handle table* that is maintained by the canonical function definitions
569569
described [below](#canonical-definitions). The uniqueness and dropping
@@ -610,12 +610,12 @@ wrapping it in any containing record/object/struct.
610610
The `resource` type constructor creates a fresh type for each instance of the
611611
containing component (with "freshness" and its interaction with general
612612
type-checking described in more detail [below](#type-checking)). Resource types
613-
can be referred to by handle types (`own` and `borrow`) as well as the
614-
`resource.new` canonical built-in described [below](#canonical-built-ins). The
615-
`rep` immediate of a `resource` type specifies its *core representation type*,
616-
which is currently fixed to `i32`, but will be relaxed in the future (to at
617-
least include `i64`, but also potentially other types). When the owning handle
618-
of a resource is dropped, the resource's `dtor` function will be called (if
613+
can be referred to by handle types (such as `own` and `borrow`) as well as the
614+
canonical built-ins described [below](#canonical-built-ins). The `rep`
615+
immediate of a `resource` type specifies its *core representation type*, which
616+
is currently fixed to `i32`, but will be relaxed in the future (to at least
617+
include `i64`, but also potentially other types). When the last handle to a
618+
resource is dropped, the resource's `dtor` function will be called (if
619619
present), allowing the implementing component to perform clean-up like freeing
620620
linear memory allocations.
621621

@@ -889,14 +889,13 @@ of [existential types] (∃T).
889889

890890
Next, we consider resource type *definitions* which are a *third* source of
891891
abstract types. Unlike the abstract types introduced by type imports and
892-
exports, resource type definitions provide operations for setting and getting a
893-
resource's private representation value: `resource.new` and `resource.rep`
894-
(introduced [below](#canonical-built-ins)). However, these accessor operations
895-
are necessarily scoped to the component instance that generated the resource
896-
type, thereby hiding access to a resource type's representation from the outside
897-
world. Because each component instantiation generates fresh resource types
898-
distinct from all preceding instances of the same component, resource types are
899-
["generative"].
892+
exports, resource type definitions provide canonical built-ins for setting and
893+
getting a resource's private representation value (that are introduced
894+
[below](#canonical-built-ins)). These built-ins are necessarily scoped to the
895+
component instance that generated the resource type, thereby hiding access to a
896+
resource type's representation from the outside world. Because each component
897+
instantiation generates fresh resource types distinct from all preceding
898+
instances of the same component, resource types are ["generative"].
900899

901900
For example, in the following example component:
902901
```wasm

0 commit comments

Comments
 (0)