|
1 | | -# openkal Specification, version 0.7 |
| 1 | +# openkal Specification, version 0.8 |
2 | 2 |
|
3 | 3 | ## 1. Scope |
4 | 4 |
|
@@ -43,11 +43,24 @@ provides an interface in whole or not at all. |
43 | 43 | | `openkal.process` | a program image that has been started | standard | |
44 | 44 | | `openkal.task` | an execution context, and a suspension primitive | standard | |
45 | 45 | | `openkal.exec` | a region of the address space a program may execute | optional | |
| 46 | +| `openkal.terminal` | an interactive stream's treatment of what is typed | optional | |
| 47 | +| `openkal.net` | a connection, and a listener for connections | optional | |
| 48 | +| `openkal.datagram` | a message with a boundary, sent without a connection | optional | |
| 49 | +| `openkal.space` | an address space, and a context executing in one | optional | |
| 50 | +| `openkal.timeout` | a bound upon operations that would otherwise wait | optional | |
46 | 51 | | `openkal.event` | readiness of a set of resources | reserved | |
47 | 52 |
|
48 | | -Version 0.7 specifies the core, standard and optional interfaces. The reserved |
| 53 | +Version 0.8 specifies the core, standard and optional interfaces. The reserved |
49 | 54 | row is not specified, and its name shall not be used for other purposes. |
50 | 55 |
|
| 56 | +The five interfaces added in version 0.8 are optional in the sense clause 3 |
| 57 | +defines, and their optionality is not a concession. An environment with no |
| 58 | +network is not deficient for providing neither `openkal.net` nor |
| 59 | +`openkal.datagram`; an environment with no memory management unit cannot |
| 60 | +provide `openkal.space` and is not deficient either. Clause 6.1 expresses each |
| 61 | +absence as the absence of a definition at the link, so a program that requires |
| 62 | +one of them is refused when it is built rather than when it runs. |
| 63 | + |
51 | 64 | *Core* denotes an interface every implementation provides. *Standard* denotes |
52 | 65 | one an implementation hosting a C library provides. *Optional* denotes one it |
53 | 66 | may omit without ceasing to host a C library, at the cost of the facilities |
@@ -339,7 +352,9 @@ This clause adds no declaration and alters none, so clause 8's rule is not |
339 | 352 | engaged and the version does not advance on its account. Every declaration of |
340 | 353 | version 0.6 already satisfies it — one hundred and one of them, examined by the |
341 | 354 | procedure below — and what is new is that the property is now stated and |
342 | | -checked rather than held by the care of whoever wrote each header. |
| 355 | +checked rather than held by the care of whoever wrote each header. The five |
| 356 | +interfaces added in version 0.8 were examined by the same procedure and satisfy |
| 357 | +it also; the count is now one hundred and forty-six. |
343 | 358 |
|
344 | 359 | Clause 9's procedure examines this. |
345 | 360 |
|
@@ -413,6 +428,44 @@ consumer imports, which contradicts clause 4. |
413 | 428 | implementation declares them. Not adopted: a record can disagree with the code |
414 | 429 | it describes, and the file is a second place in which a package is configured. |
415 | 430 |
|
| 431 | +Two further arrangements were weighed while specifying version 0.8 and are |
| 432 | +recorded on the same basis. |
| 433 | + |
| 434 | +**Readiness notification.** An interface reporting that a stream may be read, by |
| 435 | +waking a word as `kal_task_wake` does, was considered as the remedy for a context |
| 436 | +that would otherwise wait without end. It composes better than the bound this |
| 437 | +specification adopted: one operation covers every waitable resource, a single |
| 438 | +context may await many sources, and a library above it needs no read-ahead buffer |
| 439 | +because a notification consumes nothing. |
| 440 | + |
| 441 | +It was not adopted because of what it asks of an implementation. On an |
| 442 | +environment whose readiness is discovered by polling a set of descriptors, an |
| 443 | +implementation would have to maintain that set and a context of its own to watch |
| 444 | +it. That is a mechanism reconstructed rather than a facility conveyed, which |
| 445 | +clause 7.1 excludes. `openkal.timeout` asks the same environment only for what it |
| 446 | +already does at the point of the call. |
| 447 | + |
| 448 | +**A space as a handle.** An earlier form of `openkal.space` separated the copying |
| 449 | +of an address space from the starting of a context in it, so that a caller held a |
| 450 | +space and could start a context in it afterwards. It was withdrawn while the |
| 451 | +first implementation was being written. |
| 452 | + |
| 453 | +No environment this specification targets has that pair as a primitive. The copy |
| 454 | +and the start are one act, and an implementation asked to separate them would |
| 455 | +have to start a context anyway, park it upon a waiting primitive, and build a |
| 456 | +channel by which to tell it what to run. Clause 7.1 identifies that as a fault in |
| 457 | +the shape of the specification rather than in the implementation, and the |
| 458 | +separated form was the shape at fault. The single operation that replaced it is |
| 459 | +what every such environment already performs. |
| 460 | + |
| 461 | +**An instant rather than a duration.** `openkal.timeout` states a duration |
| 462 | +because `kal_task_wait` does. An instant would not accumulate drift when a caller |
| 463 | +retries in a loop, and was considered for that reason. It was not adopted because |
| 464 | +it would give one specification two spellings of one idea. A caller that requires |
| 465 | +an instant computes the remaining duration from `kal_time_monotonic`, so the cost |
| 466 | +falls upon the caller that has the requirement rather than upon every |
| 467 | +implementation. |
| 468 | + |
416 | 469 | The measurements that constrain any future proposal: |
417 | 470 |
|
418 | 471 | 1. A requires-expression naming a qualified entity that does not exist is |
@@ -787,3 +840,33 @@ The following are recorded so that they are not mistaken for oversights. |
787 | 840 | in its symbol names. Clause 8 protects the interface by prohibiting change |
788 | 841 | rather than by permitting coexistence, and an ecosystem that outgrows that |
789 | 842 | prohibition will require a mechanism this version does not define. |
| 843 | +4. **Readiness.** Awaiting one of several sources is not an operation of this |
| 844 | + specification. It is reached above the interface, from `openkal.task` and a |
| 845 | + bound upon each wait; clause 6.3 records the alternative that was weighed and |
| 846 | + the property of implementations that excluded it. |
| 847 | +5. **Name resolution.** `openkal.net` and `openkal.datagram` carry an address and |
| 848 | + a port. Turning a name into one is excluded by clause 3.4 and remains so: an |
| 849 | + implementation shall not be required to parse an unbounded set of name |
| 850 | + schemes. |
| 851 | +6. **Permission and ownership of files.** Not defined, and not a deferral. A |
| 852 | + permission presupposes an identity, and the environments this specification |
| 853 | + targets do not agree that one exists. A C library above openkal reports the |
| 854 | + absence as the error its own surface defines. |
| 855 | +7. **Creation and reading of links.** Not defined, and not a deferral, for the |
| 856 | + reason clause 6.4 gives: whether a filesystem has links is a property of the |
| 857 | + format rather than of the environment. `KAL_FS_PROP_LINKS` reports it, and |
| 858 | + resolution follows one where the property is claimed. |
| 859 | +8. **Duplication of the calling image.** `fork` is refused by clause 7.1 and that |
| 860 | + refusal stands. It is refused as an OPERATION. The atomic capabilities from |
| 861 | + which a library may compose it are specified: `openkal.space` clones an |
| 862 | + address space and starts a context in one, and `KAL_SPACE_PROP_CLONE_HANDLES` |
| 863 | + states whether the handles accompany the memory. What this specification |
| 864 | + declines to do is duplicate execution state, which a library above the |
| 865 | + interface performs with the compiler's own facilities. A sentence reading |
| 866 | + "openkal will not have fork" would have buried that distinction, and this |
| 867 | + entry exists so that it is not written. |
| 868 | +9. **Transfer of a handle between address spaces.** `kal_space_start` conveys no |
| 869 | + handle, and `kal_process_channel` conveys a stream only across a spawn. A |
| 870 | + general mechanism for passing a handle to a context in another space is not |
| 871 | + defined by this version. It is the question `openkal.space` reaches first and |
| 872 | + is not peculiar to it. |
0 commit comments