summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-05-29 08:05:57 -0700
committerGitHub <noreply@github.com>2025-05-29 08:05:57 -0700
commitfaf042ecc3e688a1a3ffbe1ac44d18dd7ddf441a (patch)
treeb54abb2e65b7791d74335ead396cf762f805ab5c /docs
parent45d794f57d453a5564a7360400c5bfc04bf12b31 (diff)
Language version + tuple syntax. (#7230)
* Language version + tuple syntax. * Fix compile error. * regenerate documentation Table of Contents * Fix. * regenerate command line reference * Fix. * Fix. * Fix more test failures. * revert empty line change, * Retrigger CI * #version->#lang * Update source/core/slang-type-text-util.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> * Remove comments. * Fix parsing logic. * Fix parser. * Fix parser. * update test comment * Update options. * regenerate documentation Table of Contents * regenerate command line reference --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/command-line-slangc-reference.md16
-rw-r--r--docs/user-guide/11-language-version.md41
-rw-r--r--docs/user-guide/a3-02-reference-capability-atoms.md3
-rw-r--r--docs/user-guide/toc.html7
4 files changed, 59 insertions, 8 deletions
diff --git a/docs/command-line-slangc-reference.md b/docs/command-line-slangc-reference.md
index b976d3ed3..2d684f961 100644
--- a/docs/command-line-slangc-reference.md
+++ b/docs/command-line-slangc-reference.md
@@ -22,7 +22,7 @@ slangc -help-style markdown -h
* [Deprecated](#Deprecated)
* [compiler](#compiler)
* [language](#language)
-* [std-revision](#std-revision)
+* [language-version](#language-version)
* [archive-type](#archive-type)
* [line-directive-mode](#line-directive-mode)
* [debug-info-format](#debug-info-format)
@@ -227,7 +227,7 @@ It is typically only set from automated builds(such as distros available on gith
<a id="std"></a>
### -std
-**-std &lt;[std-revision](#std-revision)&gt;**
+**-std &lt;[language-version](#language-version)&gt;**
Specifies the language standard that should be used.
@@ -898,14 +898,14 @@ Language
* `hlsl` : HLSL language
* `cu`, `cuda` : CUDA
-<a id="std-revision"></a>
-## std-revision
+<a id="language-version"></a>
+## language-version
-Std Revision
+Language Version
-* `unknown` : Unknown
-* `2025`, `default` : Slang language rules for 2025 and older
-* `2026` : Slang language rules for 2026 and newer
+* `legacy`, `default`, `2018` : Legacy Slang language
+* `2025` : Slang language rules for 2025 and older
+* `2026`, `latest` : Slang language rules for 2026 and newer
<a id="archive-type"></a>
## archive-type
diff --git a/docs/user-guide/11-language-version.md b/docs/user-guide/11-language-version.md
new file mode 100644
index 000000000..52e5ff22d
--- /dev/null
+++ b/docs/user-guide/11-language-version.md
@@ -0,0 +1,41 @@
+# Language Version
+
+Like many programming languages, Slang experiences a tension between the desire for rapid innovation/evolution and stability. One of the benefits that users of Slang have so far enjoyed has been the rapid pace of innovation in the language and its standard library. However, as developers start to have larger bodies of Slang code, they may become concerned that changes to the language could break existing code. There is no magical way to keep innovating while also keeping the language static.
+
+Slang supports using `#language` preprocessor directive, as well as the `-std` compiler option (`CompilerOptionName::LanguageVersion`) to specify the language version that a source file is written against. The source file will then be parsed and checked by the compiler using the rules from the specified language version.
+
+Users are advised to provide a `#language` directive as the first non-white-space line in their source file, such as:
+
+```
+#language slang 2026
+```
+
+The following version strings are allowed:
+- `latest`: use the latest language version supported by the current compiler.
+- `legacy`: use the legacy Slang language.
+- `2018`: equivalent to `legacy`.
+- `2025`: Slang language version 2025.
+- `2026`: Slang language version 2026.
+
+If no `#language` line exists and no version is specified via compiler options, the default setting is `legacy`.
+
+## The Legacy Slang Language
+
+When language version is set to `legacy`, the compiler behavior will be consistent with the Slang language as in 2018-2023. Specifically:
+
+- All declarations have `public` visibility.
+- `module` declaration is not required at the start of each module.
+
+## Slang 2025
+
+Slang language version 2025 brings these changes on top of the legacy language:
+
+- All declarations have `internal` visibility.
+- `module` declaration is required at the start of each module.
+
+## Slang 2026
+
+Slang language 2026 brings these changes on top of Slang 2025:
+
+- Comma expression is removed when it is used inside a parenthesis. The expression `(a, b)` no longer evaluates to have `b`'s type as in C/C++. Instead, `(a,b)` means `makeTuple(a,b)` and returns a tuple consists of `a` and `b`.
+- User must explicitly opt-in to enable dynamic dispatch with `dyn` keyword. More rigorous validation are enabled to make sure dynamic dispatch is not triggerred accidentally. See [SP#024](https://github.com/shader-slang/spec/blob/main/proposals/024-any-dyn-types.md) for details.
diff --git a/docs/user-guide/a3-02-reference-capability-atoms.md b/docs/user-guide/a3-02-reference-capability-atoms.md
index 78affcb7d..56809055b 100644
--- a/docs/user-guide/a3-02-reference-capability-atoms.md
+++ b/docs/user-guide/a3-02-reference-capability-atoms.md
@@ -1270,6 +1270,9 @@ Compound Capabilities
`raytracing_anyhit_closesthit`
> Collection of capabilities for raytracing with the shader stages of anyhit and closesthit.
+`raytracing_lss`
+> Collection of capabilities for linear swept spheres.
+
`raytracing_anyhit_closesthit_intersection`
> Collection of capabilities for raytracing with the shader stages of anyhit, closesthit, and intersection.
diff --git a/docs/user-guide/toc.html b/docs/user-guide/toc.html
index c83f36282..5e8ecc207 100644
--- a/docs/user-guide/toc.html
+++ b/docs/user-guide/toc.html
@@ -151,6 +151,13 @@
<li data-link="link-time-specialization#additional-remarks"><span>Additional Remarks</span></li>
</ul>
</li>
+<li data-link="11-language-version"><span>language slang 2026</span>
+<ul class="toc_list">
+<li data-link="11-language-version#the-legacy-slang-language"><span>The Legacy Slang Language</span></li>
+<li data-link="11-language-version#slang-2025"><span>Slang 2025</span></li>
+<li data-link="11-language-version#slang-2026"><span>Slang 2026</span></li>
+</ul>
+</li>
<li data-link="a1-special-topics"><span>Special Topics</span>
<ul class="toc_list">
<li data-link="a1-01-matrix-layout"><span>Handling Matrix Layout Differences on Different Platforms</span>