diff options
| author | eunhhu <[email protected]> | 2026-10-13 06:16:12 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-13 06:16:12 +0100 |
| commit | e0276bfa9fd4bb418d0f82e12f09069629185863 (patch) | |
| tree | ac7e40c8fa5388ae7d3c97a6b27512d62e9fab36 /docs/design | |
| parent | 8568c8732ca36673b073688bdf99cc25d6b8065a (diff) | |
| download | pure-e0276bfa9fd4bb418d0f82e12f09069629185863.tar.gz pure-e0276bfa9fd4bb418d0f82e12f09069629185863.zip | |
Research 140, 027's stage 2a measured: whether bytes are JSON (aup's examples/json.aup, 80 lines against the same design's 90 in Python): JSONTestSuite's 95 y_ cases taken and 188 n_ refused, 21 of the 35 i_ taken, the three paths alike, in make check (module_specs, the 316 small cases in tests/specs/json under their MIT license, the two large ones made and hashed); 116 times C's time and 1.2 times plain Python's (299 ns a byte, 339 instructions); && and || made to decide alone (writing it, i < n && d[i] read past the end) with AND and OR kept where the right side cannot fail, every other module byte for byte the same; SHA-256 again with formats and joined bytes, 42 lines and 159 times C
Diffstat (limited to 'docs/design')
| -rw-r--r-- | docs/design/027-computation-core.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/design/027-computation-core.md b/docs/design/027-computation-core.md index f26f2d5..cd8dd44 100644 --- a/docs/design/027-computation-core.md +++ b/docs/design/027-computation-core.md @@ -129,6 +129,17 @@ ### 2단계: 중첩, 갈래, 재귀, 글자 (JSON) +크기 때문에 셋으로 나눈다(2026-10-13). 각각 재는 일이 있다. +- **2a(만듦):** 형식 지정, 바이트 잇기와 자르기, 바이트와 text를 담는 `let`, `while`, `&&`와 `||`의 단락 평가. JSON을 받거나 + 거절하는 검사기로 잰다. 결과는 [140](../research/140-spec-suite.md)의 2a절이다. + - JSONTestSuite에서 틀린 것이 없다. + - 줄 수는 파이썬 이하다(80 대 90). + - 시간은 C의 116배, 파이썬의 1.2배다. + - 쓰다가 드러난 뜻의 틈 하나를 메웠다. `&&`가 양쪽을 다 계산해서 `i < n && d[i]`가 실패했다. 이제 단락 평가이고, 오른쪽이 + 실패할 수 없을 때는 지금처럼 AND 하나를 낸다. 그래서 TPC-C를 포함한 기존 모듈 35개가 바이트까지 같다. +- **2b:** 중첩(레코드 안의 레코드와 리스트), 갈래와 `match`, 값으로서의 리스트, 메시지 필드의 아무 값. JSON을 트리로 읽고 묻는다. +- **2c:** 재귀(부르기와 돌아가기, 함수마다의 검증), 글자로 읽기. + - 레코드의 필드와 리스트의 원소가 아무 값을 가진다. - 갈래와 `match`를 둔다. - 재귀하는 fn과 `while`을 둔다. Pure에는 부르기와 돌아가기, 함수마다의 검증이 생긴다. |
