규칙 1.4
1장, 소개 테스트
Where ECMAScript has a form that carries the GPU meaning, the surface must borrow TypeScript’s spelling; a WGSL spelling is borrowed only where no ECMAScript spelling carries the meaning, and the borrowing must keep every WGSL capability reachable (Rule 11.14).
A form may be borrowed in part: the members, the positions or the meaning it takes are those the rules give it.
A WGSL capability that only switches off a validation the compiler satisfies by rewriting the program is not borrowed: the compiler’s rewrite gives the program the capability would have admitted. The derivative_uniformity filter is such a capability (Rule 8.5). Its rows in docs/capability-coverage.md are refused with this rule (Rule 11.14, Rule 11.18).
규칙 본문과 그 아래 항목은 설계 문서에 적힌 컴파일러 원문이라 한국어 페이지에서도 영어로 둡니다.
근거
the WGSL vocabulary is there to say what TypeScript cannot say, such as a value’s width or an address space. It is not a second spelling an author has to learn for what TypeScript already says. A filter that switches a validation off is not something the author must state: it asks the author to learn a WGSL rule name and its severities for work the compiler can do, and the program it leaves is indeterminate in WGSL and undefined in GLSL ES 3.00. The language keeps a construct only for what the author must state and the compiler cannot know (docs/owner-decisions.md, OD-3).
출처
changes/0100-typescript-meaning.md (section 1, the first two requirements); the roadmap’s first rule, “ordinary TypeScript first”; changes/0132-remove-diagnostic.md (decision 6) and OD-3 for the third sentence.
검증 방식
테스트로 확인합니다. 테스트나 게이트 스크립트, CI 워크플로가 이 규칙을 가리키고, 아래 파일 가운데 하나라도 규칙을 더는 가리키지 않으면 추적 검사가 실패합니다.
컴파일러가 이 규칙을 적용하는 곳을 규칙이 직접 적은 내용입니다.
review (Rule 13.1); Appendix B, under Rule 1.1, for the spellings the tree still offers twice; the rows’ cells in src/core/coverage/wgsl.ts, checked by capability-coverage.test.ts (Rule 11.18); TS8028 on a written @diagnostic(…) or { diagnostic: [...] }, and the tests of Rule 8.5’s rewrite.
커밋 af54ddad5에서 이 규칙을 확인하는 파일입니다. 파일마다 규칙을 처음 가리키는 줄로 연결했습니다.
-
src/compiler/ts/diagnostic-removed.test.ts:1 -
src/core/coverage/wgsl.ts:9(컴파일러의 자체 테스트가 확인) -
src/core/spec-conformance/capability-coverage.test.ts:45(컴파일러의 자체 테스트가 확인)
설명하는 절
커밋 af54ddad5의 언어 문서에서 이 규칙을 설명하는 절입니다.
적용하는 오류 코드
규칙이 Enforced by 항목에서 가리키는 진단 코드와, 레지스트리 설명에서 이 규칙을 가리키는 진단 코드입니다.
-
TS8028ATTRIBUTE_NAME - 이 표면이 읽지 않는 데코레이터나 진입점 형태입니다. 속성 어휘(
@vertex,@fragment,@compute,@builtin,@location) 밖의 식별자(@vertx같은 오타), 표면이 다른 방식으로 쓰거나 빌려 오지 않는 WGSL 속성(직접 쓴@diagnostic(…)같은 것),vertex(f)처럼 호출로 쓴 스테이지,export default처럼 규칙 8.1이 거부하는 형태로 쓴 진입점, 데코레이터를 받지 않는 선언이나 자리에 붙은 데코레이터가 그렇습니다(규칙 6.7). 이 코드가 없으면 데코레이터를 붙인 함수나 필드가 아무 말 없이 진입점이나 IO 필드가 아니게 됩니다.
함께 보기
소스
커밋 af54ddad5의 규칙 원문:
docs/language-design.md:75(설계 문서)reqs/rules/RULE-0104.md(추적 항목)