diff options
| author | eunhhu <[email protected]> | 2026-10-13 07:40:30 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-13 07:40:30 +0100 |
| commit | 8481b12fb794690cce0d9c54032ffba3de1fe31d (patch) | |
| tree | 55a7f3c74b8521b84262acb4cf444ddda9ef5070 /docs | |
| parent | d83ccb2e3b3d276577c61b30a4a323909a654690 (diff) | |
| download | pure-8481b12fb794690cce0d9c54032ffba3de1fe31d.tar.gz pure-8481b12fb794690cce0d9c54032ffba3de1fe31d.zip | |
Module format and executor: 027's stage 2b, lists in records: a record field of type LIST (its items' record in its default) holds a list the event made, its number an i64 in the cell (0 an empty one), so lists keep their inside, batches and the JIT as they were (the JIT's append fast path leaves such records alone); LIST_VALUE (a copy of an event's list, nothing made for an empty one), LIST_BIND (a register, an event's list flagged PURE_LIST_BOUND, read and walked, never changed by code), APPEND_IN (an item into the list in a field of an event's list's item, copied first when another value shares it or a register is bound to it), sharing counted where cells take them; such records only in event lists (no stored, transient or message list, no key); the event's lists go as each event or view's body begins, registers given back their own; record field names may be paths (at.x: records in records, flattened by aup); NUM_PARSE (a text written as a JSON number, its nearest double, core's pure_parse_number); unit tests (values copied, shared then appended, a bound register seeing what it was bound to, three events alike, 6 refused; under ASan and UBSan too, which found the record kinds' missing LIST)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/design/008-module-format.md | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/docs/design/008-module-format.md b/docs/design/008-module-format.md index 04b75ee..642da9b 100644 --- a/docs/design/008-module-format.md +++ b/docs/design/008-module-format.md @@ -22,8 +22,21 @@ v6은 **bool**을 수와 다른 스택 종류로 더한다([016](016-bool-and-i6 v6에는 뒤에 **i64**가 더해졌다([016](016-bool-and-i64.md)의 2단계): 새 명령, 새 타입 번호, 0이던 자리의 값(CONST와 NUM_TEXT의 인자 2, 집계의 PURE_FOLD_INTEGER)이라 판은 그대로다. 그 뒤 [027](027-computation-core.md)의 1단계로 **비트 연산, 자리의 바이트, i64 리스트의 바이트, 자리로 찾은 항목**이 더해졌다(새 명령 -넷, 90–93). 2a로 **바이트 자르기, 한 바이트, 이름으로 담은 바이트와 text**(94–97), CONCAT의 바이트, NUM_TEXT의 형식이 더해졌다. 판은 -그대로다. +넷, 90–93). 2a로 **바이트 자르기, 한 바이트, 이름으로 담은 바이트와 text**(94–97), CONCAT의 바이트, NUM_TEXT의 형식이 더해졌다. 2b로 +**레코드 안의 리스트**(레코드 필드의 타입 4, 98–100), 레지스터(리스트 상태의 플래그 512), 경로 이름의 레코드 필드, **수 읽기**(101)가 +더해졌다. 판은 그대로다. + +**레코드 안의 리스트**(027의 2b). +- 레코드 필드의 타입 4(LIST)는 항목들의 레코드를 기본값 자리(i64)에 둔다. +- 칸의 값은 이벤트가 만든 리스트의 번호(0은 빈 리스트)다. 정수처럼 옮겨지고 ITEM_GET으로 읽힌다. 스택의 타입은 리스트이고, 그 + 레코드를 가진다. +- 그런 레코드는 이벤트의 리스트(let의 것)에만 둔다. 저장 상태, transient, 메시지의 행은 받지 않고, 리스트 필드는 키가 되지 않는다. +- 값으로서의 리스트는 나눠 가질 수 있다. 다른 칸에 담으면 나눠 가지고, 나눠 가지거나 레지스터에 묶인 리스트는 바뀌기 전에 + 복사된다. +- 이벤트(그리고 보기의 본문)가 시작할 때 그 리스트들은 모두 사라진다. 담은 바이트는 이벤트의 몫에 센다. +- 레지스터는 상태 플래그 512(이벤트의 리스트와 함께, 키 없이)를 가진 리스트 상태다. LIST_BIND만이 그것을 바꾸고, 다른 명령은 + 읽기만 한다. +- 레코드 필드의 이름은 경로일 수 있다(`at.x`). 펼친 레코드 안의 레코드다. ## 바이트 배치 @@ -136,6 +149,10 @@ v6에는 뒤에 **i64**가 더해졌다([016](016-bool-and-i64.md)의 2단계): | 95 | BYTE | i64 → b | 한 바이트. 0–255 밖이면 `limit` | | 96 | BYTES_LOAD | → b 또는 t | 이름으로 담은 값 `인자`(0–15 바이트, 16–31 text). 이벤트와 보기의 본문이 시작할 때 비어 있다 | | 97 | BYTES_STORE | b 또는 t → | 이름으로 담은 값 `인자`의 비트 0–4를 그 값으로(비트 8이면 뒤에 덧붙여). 담은 바이트는 이벤트의 몫에 세고, 넘으면 `memory`. text 칸에는 text만 | +| 98 | LIST_VALUE | → l | 이벤트의 리스트 상태 `인자`의 값(항목의 복사, 빈 리스트는 0). 아래 "레코드 안의 리스트" | +| 99 | LIST_BIND | l → | 묶이는 리스트 상태 `인자`(레지스터)가 그 리스트를 읽게 한다 | +| 100 | APPEND_IN | i f… → | 리스트 상태 `인자`의 비트 0–15(이벤트의 리스트)에서 인덱스의 항목, 그 필드(비트 16–31, 리스트 필드)에 담긴 리스트에 항목을 덧붙인다. 그 리스트를 다른 값이 나눠 가지면 먼저 제 것으로 복사한다 | +| 101 | NUM_PARSE | t → n | JSON의 수로 쓴 text의 가장 가까운 수. 그런 text가 아니거나 유한하지 않으면 `limit` | bool은 실행 중에 수의 칸에 든 0이나 1이고, i64는 같은 8바이트의 정수다. CONST의 인자 2는 i64 상수(값의 8바이트), NUM_TEXT의 인자 2는 i64의 10진 글자다. LOAD·STORE·지역 칸·항목·FIELD·SEND는 i64를 수처럼 옮긴다. FOLD의 종류에 64(PURE_FOLD_INTEGER)를 |
