blob: 99a0e16c2f98fef6ab454afabb347ac49311e2c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# aup
aup는 [Pure](/srv/git/pure.git) 런타임을 위한 **언어와 툴체인**이다. Java와 javac가 JVM에
대해 하는 역할과 같다. aup 소스를 검사해 Pure가 검증한 뒤 실행하는 모듈(`.pmod`)로 만든다.
| 층 | 역할 |
|---|---|
| Pure | 런타임. 모듈 형식과 검증기·실행기, 실행·메모리·영속 상태·통신 |
| **aup** | 언어와 툴체인. 소스 → 진단 → Pure 모듈 |
| [Vega](/srv/git/vega.git) | aup와 Pure 위의 인터페이스 구현자(TUI·CLI·GUI·NUI) |
상태: v0a(scalar 상태·키 입력·원자적 이벤트·보기), v0b(바이트·영속 문서·메시지·응답·text·커서),
v0c의 레코드·리스트·`index of`·조건식·표 보기(`each`) 동작. 다음은 순수 함수와 모듈.
[언어 v0](docs/design/001-language-v0.md).
```sh
make # build/aup
build/aup build examples/counter.aup -o counter.pmod
printf 'down tap\nup tap\nshow\n' | ../pure/prototypes/connections/build/pure-run counter.pmod
build/aup build examples/notes.aup -o notes.pmod
printf 'type typed %s\ndown left\nshow\n' "$(printf '안녕' | xxd -p)" | ../pure/prototypes/connections/build/pure-run notes.pmod
build/aup build examples/tasks.aup -o tasks.pmod
printf 'type typed %s\ndown again\ndown toggle\nshow\n' "$(printf '우유' | xxd -p)" | ../pure/prototypes/connections/build/pure-run tasks.pmod
build/aup build examples/editor.aup -o editor.pmod
../pure/prototypes/connections/build/pure-edit-module --module editor.pmod --store /tmp/docs show note
make check # Pure 검증, 결정성, 진단, 워크벤치·기존 편집기·text·리스트 참조 모델과의 대조
```
`make check`는 옆의 Pure 체크아웃(`PURE=../pure/prototypes/connections`)의 검증기와 시험 호스트를 쓰고,
워크벤치 대조에는 Node가 필요하다.
## 원칙
- **앱은 상태·입력·반응·보기를 선언하고, 저장·트랜잭션·화면 모델은 런타임이 소유한다.**
- 컴파일 결과는 Pure가 로드 전에 검증할 수 있는 형식이어야 한다. 소스나 AST를 런타임에 두지 않는다.
- 툴체인은 C17로 작성하고 외부 의존성을 두지 않는다. 검증 기기는 로컬 Raspberry Pi 5다.
- 기존 Pure `.pure` 두 방언(워크벤치 scalar, 문서 연결)을 aup 하나로 대체한다.
대체의 근거는 기존 실행기와의 비트 단위 일치다.
|