aboutsummaryrefslogtreecommitdiffstats
path: root/docs/design
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-26 17:48:09 +0100
committereunhhu <[email protected]>2026-09-26 17:48:09 +0100
commit2a050e1b9842eda4cf89f4af6fe797560c9caad6 (patch)
tree6b7ca189d6134bdd8e1b8e5f0412bbeadd4b7dbd /docs/design
parent42f6a986f2150738cb9a975bd24a99838d49f068 (diff)
downloadaup-2a050e1b9842eda4cf89f4af6fe797560c9caad6.tar.gz
aup-2a050e1b9842eda4cf89f4af6fe797560c9caad6.zip
Declare number and text message fields; check JSON bodies
input add = message { title: text, points: number } now compiles, with variable fields anywhere and several of them. The served-app checks post 300 random JSON objects (escapes, control bytes, Korean, surrogate pairs, members in any order) and read them back as Python's json module does, with a list of bodies that must be refused and why.
Diffstat (limited to 'docs/design')
-rw-r--r--docs/design/001-language-v0.md5
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/design/001-language-v0.md b/docs/design/001-language-v0.md
index cefb229..660abae 100644
--- a/docs/design/001-language-v0.md
+++ b/docs/design/001-language-v0.md
@@ -95,7 +95,7 @@ state documents: bytes by key # 키마다 바이트 값 하나. 런타�
input show = message by key # 키(와 선택적 기준 버전)를 가진 메시지
input edit = message by key {
- start: u32 # 필드는 u32와 마지막 bytes 하나
+ start: u32 # 필드는 u32, number, bytes, text
remove: u32
insert: bytes
}
@@ -112,6 +112,9 @@ on edit {
```
- `on 메시지 { }`는 메시지가 도착할 때 한 번 실행된다. 필드는 `메시지.필드`, 키는 `key`로만 쓴다.
+- 필드 타입은 `u32`, `number`(유한한 수), `bytes`, `text`(UTF-8)이고 가변 필드(bytes, text)는 몇 개든 어디에나 둘 수 있다.
+ `input add = message { title: text, points: number }`. HTTP 호스트(`pure-serve`)는 JSON 본문의 객체를 이 필드들로
+ 옮긴다. 도착한 메시지의 text가 UTF-8이 아니거나 수가 유한하지 않으면 그 이벤트는 실패한다.
- `이름[key]`는 그 메시지 키의 문서다. 읽으면 bytes, `.bytes`는 크기(없으면 0)다. 없는 문서를 읽으면 `not_found`.
- `replace(a .. b, 값)`는 문서의 `[a, b)`를 바꾼다. 정수가 아니거나 범위 밖이면 이벤트가 `limit`으로 실패한다.
- `require 조건`이 거짓이면 이벤트가 `limit`으로 실패한다. 크기 정책처럼 저장소의 특수 인자였던 것이 문장 하나가 된다.