aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-26 18:10:52 +0100
committereunhhu <[email protected]>2026-09-26 18:10:52 +0100
commit4874acb6b2c7bc4efa82aad0209f3022e1d3fa02 (patch)
treed8753980444c7c09445340e77fdb944042d93ee8 /docs
parent9a201c8229e4f45524b7bc9f2f1f127683091740 (diff)
downloadpure-4874acb6b2c7bc4efa82aad0209f3022e1d3fa02.tar.gz
pure-4874acb6b2c7bc4efa82aad0209f3022e1d3fa02.zip
Size a module's code and constants to the module; raise their limits
A real app (a board, a stopwatch) already used a quarter of the 512 instructions, since a fn is inlined where it is called, and every text it shows is one of 64 constants. The code and the constants now live in one block sized to the module, which load takes and pure_module_release gives back; the limits rise to 65,535 instructions and 4,096 constants of up to 1 MiB, while PureModule shrinks from 28,664 to 11,936 bytes. The verifier's branch marks are sized to the block instead of 64 KiB on the stack. pure_module_read reads a module file whole, and every host uses it instead of a 128 KiB buffer.
Diffstat (limited to 'docs')
-rw-r--r--docs/design/008-module-format.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/design/008-module-format.md b/docs/design/008-module-format.md
index 1039358..db597e7 100644
--- a/docs/design/008-module-format.md
+++ b/docs/design/008-module-format.md
@@ -111,8 +111,10 @@ v5에는 뒤에 집계(FOLD), 걸러진 표, 마크, 그리고 **키 있는 리�
## 로드할 때 검증하는 것
-- 머리말, 예약 바이트, 명령 패딩이 0인지. 한도(상태 32, 입력 32, 보기 64(열 포함), 핸들러 64, 명령 512,
- 필드 32, 컬렉션 1, 문자열 32 KiB)와 정확한 파일 크기.
+- 머리말, 예약 바이트, 명령 패딩이 0인지. 한도(상태 32, 입력 32, 보기 64(열 포함), 핸들러 64, 명령 65,535,
+ text 상수 4,096개·1 MiB, 필드 32, 컬렉션 1, 이름 문자열 32 KiB)와 정확한 파일 크기. 명령과 상수는 모듈 크기에 맞춘
+ 블록 하나에 담긴다(`PureModule`의 다른 표는 고정 크기로 12 KiB). 그래서 한도를 올려도 작은 앱의 메모리는 그대로다.
+ 호스트는 모듈 파일을 크기대로 읽는다(`pure_module_read`).
- 이름은 ASCII 식별자 1–31바이트이고, 상태·레코드·컬렉션·입력·보기가 한 이름공간을 쓴다. 필드 이름은 메시지나
레코드 안에서 유일하다. 레코드(최대 8)의 필드 범위는 차례로 이어지고 모두 합쳐 64개 이하다.
키 입력의 키는 정해진 목록(`Space Enter` 화살표 `Backspace Delete Home End Tab Escape PageUp PageDown KeyA–Z Digit0–9`)