Document lightweight runtime boundaries
This commit is contained in:
@@ -1,6 +1,39 @@
|
||||
# Features
|
||||
|
||||
Decodal keeps the embedded core small by making heavy functionality opt-in.
|
||||
Decodal は embedded use と小さい runtime を優先する。
|
||||
言語機能を追加するときは、値の合成・検証・materialization に直接必要なものを core に残し、重い依存や高度な推論は optional feature または外部 tooling に分ける。
|
||||
|
||||
## Core feature boundary
|
||||
|
||||
Core に入れる機能は、基本的に deterministic な value transformation に限る。
|
||||
|
||||
- arithmetic / logical / comparison operators
|
||||
- array concat
|
||||
- object / constraint composition
|
||||
- default materialization
|
||||
- pure function evaluation
|
||||
- host supplied import evaluation
|
||||
|
||||
Core に入れないものは以下である。
|
||||
|
||||
- filesystem / network / environment access
|
||||
- time / random
|
||||
- mutation
|
||||
- reflection or existence probing
|
||||
- arbitrary host function calls
|
||||
- symbolic constraint solving beyond simple normalization
|
||||
|
||||
未解決 identifier や missing field は `unknown` として流れず、diagnostic になる。
|
||||
この方針により、存在チェックや optional chaining のような dynamic object inspection は core language の対象外とする。
|
||||
|
||||
## Constraint reasoning
|
||||
|
||||
Constraint normalization は軽量な範囲に留める。
|
||||
primitive type conflict や明らかな numeric bound conflict は合成時に検出してよい。
|
||||
一方で、symbolic arithmetic、boolean algebra、regex intersection、array length dependent typing のような重い推論は行わない。
|
||||
|
||||
評価済みの concrete value に対する検証は runtime / materialization で行う。
|
||||
静的に完全な型検査フェーズを増やすのではなく、parse、evaluate、compose、materialize の各段階で自然に分かる error を diagnostic として返す。
|
||||
|
||||
## Core defaults
|
||||
|
||||
|
||||
Reference in New Issue
Block a user