Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/frontend/src
diff options
context:
space:
mode:
authorLeitwolf112026-10-15 18:00:48 +0300
committerLeitwolf112026-10-15 18:00:48 +0300
commitef68517d39fc329cf3286ad70056e00acf8b4855 (patch)
tree913311567f43ec05ded9c7292b38da84c36f177b /frontend/src
parent9d1b19bc01d5d3d08e3528d69924a86e7e2bfc2a (diff)
downloadwebsite-ef68517d39fc329cf3286ad70056e00acf8b4855.tar.gz
Serve tala.run and the documentation of talac and Tazel
The language now lives at tala.run. One frontend build serves three sites and picks its content from the host name: - tala.run: the home page, /docs/overview, /docs/getting-started and a new /docs/syntax, a first look at programs, comments, declarations, operators and evaluation by need, with every sample taken from the public specification. - talac.tala.run: /docs/command-line and /docs/outputs, the compiler's options, the entry rule, warnings, --build and --emit, and the record of a check. - tazel.tala.run: /docs/commands and /docs/project-file, the commands of the build system, target selection, workspaces and the project DSL. The new pages are written in all four locales from one content model; a test keeps code samples and option names identical across them. The header links the three sites and forum.tala.run. On a development host ?site=talac or ?site=tazel selects a site. Corrections to the existing pages: - Getting started used `go run scripts/develop.go`, `talac check -File`, `talac build -File` and `-Help`; it now uses `go run ./helpers/cmd/...`, `--emit=metadata`, `--entry=` and `--help`. - The overview no longer names the retired .vxse extension, and the project DSL is evaluated by Tazel. - Canonical URLs, Open Graph data, robots.txt and the sitemap name tala.run; talac and tazel have their own robots and sitemap files, served per host by Nginx. The notice about the move is gone: the former domain redirects instead. - The leopard mark files are called tala-mark.svg and tala.svg. Nginx: ops/nginx/tala.conf serves the three hosts, redirects www.tala.run to tala.run and every path of xsharp-lang.xyz to the same path of tala.run, and keeps viget.xsharp-lang.xyz pointing at viget.progmasoft.com; tala.run has no ViGet host of its own. ops/nginx/forum.conf serves the informational page at forum.tala.run and redirects the former forum address to it.
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/App.vue48
-rw-r--r--frontend/src/content/routes.ts34
-rw-r--r--frontend/src/content/syntax.ts234
-rw-r--r--frontend/src/content/talac.ts441
-rw-r--r--frontend/src/content/tazel.ts466
-rw-r--r--frontend/src/content/types.ts32
-rw-r--r--frontend/src/main.ts31
-rw-r--r--frontend/src/pages/DocPage.vue60
-rw-r--r--frontend/src/pages/GettingStartedPage.vue38
-rw-r--r--frontend/src/pages/OverviewPage.vue16
-rw-r--r--frontend/src/seo.ts35
-rw-r--r--frontend/src/site.ts83
-rw-r--r--frontend/src/styles/site.css9
13 files changed, 1456 insertions, 71 deletions
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 6fb769b..91877d2 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -6,9 +6,11 @@ import { computed } from "vue";
import { RouterLink, RouterView } from "vue-router";
import { localeLabels } from "./locales";
import { locale, supportedLocales, theme } from "./preferences";
+import { forumUrl, site, siteHome, siteUrl, type Site } from "./site";
const labels = {
"en-US": {
+ syntax: "Syntax",
home: "Home",
overview: "Overview",
start: "Getting started",
@@ -18,10 +20,9 @@ const labels = {
language: "Language",
status: "In active development",
footer: "A Progmasoft project. Tala is an independent language identity.",
- domainNotice:
- "This site is moving to a new domain within a month. xsharp-lang.xyz will keep working and will redirect to the new address.",
},
"de-DE": {
+ syntax: "Syntax",
home: "Startseite",
overview: "Überblick",
start: "Erste Schritte",
@@ -31,10 +32,9 @@ const labels = {
language: "Sprache",
status: "In aktiver Entwicklung",
footer: "Ein Progmasoft-Projekt. Tala hat eine eigenständige Sprachidentität.",
- domainNotice:
- "Diese Website zieht innerhalb eines Monats auf eine neue Domain um. xsharp-lang.xyz bleibt erreichbar und leitet dann auf die neue Adresse weiter.",
},
"ru-RU": {
+ syntax: "Синтаксис",
home: "Главная",
overview: "Обзор",
start: "Начало работы",
@@ -44,10 +44,9 @@ const labels = {
language: "Язык",
status: "В активной разработке",
footer: "Проект Progmasoft. Tala — самостоятельный язык со своей идентичностью.",
- domainNotice:
- "В течение месяца сайт переедет на новый домен. xsharp-lang.xyz продолжит работать и будет перенаправлять на новый адрес.",
},
"he-IL": {
+ syntax: "תחביר",
home: "בית",
overview: "סקירה",
start: "צעדים ראשונים",
@@ -57,15 +56,19 @@ const labels = {
language: "שפה",
status: "בפיתוח פעיל",
footer: "פרויקט של Progmasoft. ל-Tala זהות שפה עצמאית.",
- domainNotice:
- "האתר יעבור לדומיין חדש בתוך חודש. xsharp-lang.xyz ימשיך לפעול ויפנה לכתובת החדשה.",
},
} as const;
const copy = computed(() => labels[locale.value]);
-// The notice belongs to the domain that is being left: a visitor of the new
-// domain, or of a preview, has nothing to be told.
-const onDepartingDomain = /(^|\.)xsharp-lang\.xyz$/.test(window.location.hostname);
+const hostname = window.location.hostname;
+const brand = { language: "Tala", talac: "talac", tazel: "Tazel" }[site];
+// The other two sites are linked by their names, which read the same in every language.
+const siblings = (["language", "talac", "tazel"] as const)
+ .filter((other): other is Site => other !== site)
+ .map((other) => ({
+ label: { language: "Tala", talac: "talac", tazel: "Tazel" }[other],
+ href: siteUrl(other, siteHome[other], hostname),
+ }));
function toggleTheme() {
theme.value = theme.value === "dark" ? "light" : "dark";
@@ -75,17 +78,22 @@ function toggleTheme() {
<template>
<a class="skip-link" href="#main">Skip to content</a>
<div class="site-shell">
- <p v-if="onDepartingDomain" class="domain-notice" role="status">{{ copy.domainNotice }}</p>
<header class="site-header">
- <RouterLink class="brand" to="/" :aria-label="`Tala ${copy.home}`">
- <img src="/visual-xsharp-mark.svg" width="31" height="31" alt="" />
- <span>Tala</span>
+ <RouterLink class="brand" :to="siteHome[site]" :aria-label="`${brand} ${copy.home}`">
+ <img src="/tala-mark.svg" width="31" height="31" alt="" />
+ <span>{{ brand }}</span>
</RouterLink>
<nav class="primary-nav" aria-label="Primary navigation">
- <RouterLink to="/">{{ copy.home }}</RouterLink>
- <RouterLink to="/docs/overview">{{ copy.overview }}</RouterLink>
- <RouterLink to="/docs/getting-started">{{ copy.start }}</RouterLink>
- <a href="https://forum.xsharp-lang.xyz/">{{ copy.forum }}</a>
+ <template v-if="site === 'language'">
+ <RouterLink to="/">{{ copy.home }}</RouterLink>
+ <RouterLink to="/docs/overview">{{ copy.overview }}</RouterLink>
+ <RouterLink to="/docs/getting-started">{{ copy.start }}</RouterLink>
+ <RouterLink to="/docs/syntax">{{ copy.syntax }}</RouterLink>
+ </template>
+ <a v-for="sibling in siblings" :key="sibling.href" :href="sibling.href">{{
+ sibling.label
+ }}</a>
+ <a :href="forumUrl">{{ copy.forum }}</a>
</nav>
<div class="header-tools">
<label class="language-control">
@@ -115,7 +123,7 @@ function toggleTheme() {
<p>{{ copy.footer }}</p>
</div>
<div class="footer-links">
- <RouterLink to="/docs/overview">{{ copy.overview }}</RouterLink
+ <a :href="siteUrl('language', '/docs/overview', hostname)">{{ copy.overview }}</a
><a href="https://github.com/Progmasoft/tala/tree/main/Spec">Specification</a
><a href="https://github.com/Progmasoft/website">Website source</a>
</div>
diff --git a/frontend/src/content/routes.ts b/frontend/src/content/routes.ts
new file mode 100644
index 0000000..515d310
--- /dev/null
+++ b/frontend/src/content/routes.ts
@@ -0,0 +1,34 @@
+// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+// SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1
+
+import type { Locale } from "../locales";
+import { siteTopics, type Site } from "../site.ts";
+import { syntaxRoutes } from "./syntax.ts";
+import { talacRoutes } from "./talac.ts";
+import { tazelRoutes } from "./tazel.ts";
+import type { DocRoute } from "./types";
+
+/** The documentation pages each site renders from content; the language site also has hand-built pages. */
+export const contentRoutes: Record<Site, readonly DocRoute[]> = {
+ language: syntaxRoutes,
+ talac: talacRoutes,
+ tazel: tazelRoutes,
+};
+
+// The two hand-built pages of the language site name themselves in their own components; the sidebar of a content
+// page needs their names too.
+const languagePageNames: Record<Locale, Record<string, string>> = {
+ "en-US": { "/docs/overview": "Overview", "/docs/getting-started": "Getting started" },
+ "de-DE": { "/docs/overview": "Überblick", "/docs/getting-started": "Erste Schritte" },
+ "ru-RU": { "/docs/overview": "Обзор", "/docs/getting-started": "Начало работы" },
+ "he-IL": { "/docs/overview": "סקירה", "/docs/getting-started": "צעדים ראשונים" },
+};
+
+/** The sidebar of a documentation page: every topic of the site, in order. */
+export function sidebarFor(site: Site, locale: Locale): { path: string; label: string }[] {
+ return siteTopics[site].map((path) => {
+ const content = contentRoutes[site].find((route) => route.path === path);
+ const label = content ? content.topic[locale].nav : (languagePageNames[locale][path] ?? path);
+ return { path, label };
+ });
+}
diff --git a/frontend/src/content/syntax.ts b/frontend/src/content/syntax.ts
new file mode 100644
index 0000000..66ef5ba
--- /dev/null
+++ b/frontend/src/content/syntax.ts
@@ -0,0 +1,234 @@
+// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+// SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1
+
+import type { DocRoute, DocTopic } from "./types";
+
+// Every sample below is taken from the public specification under Spec/Language.
+const program = `namespace Examples.HelloWorld;
+
+public class HelloWorld {
+ public static void Main() {
+ String language = "Tala";
+ Console.Println("Hello from " + language + "!");
+ }
+}`;
+const comments = `-- A comment runs to the end of the line.
+
+--[[
+normal
+long comment
+]]
+
+++value; -- there is ++, and no decrement:
+value -= 1; -- -- always starts a comment`;
+const declarations = `class User { -- internal
+ String name; -- internal
+ void Print() {} -- internal
+}
+
+data Point { -- a copy-on-write value type
+ int x;
+ int y;
+}
+
+object Application { -- one named singleton
+}`;
+const operators = `2 ** 3 ** 2 -- power, right-associative: 2 ** (3 ** 2)
+first \\= second -- inequality
+not true -- logical NOT; ! is bitwise
+a < b && b < c -- relations do not chain`;
+const evaluation = `int total = Sum(values); -- nothing is computed here
+
+if (verbose) {
+ Print(total); -- Sum(values) is computed here, if this is reached
+}`;
+
+const specification = "https://github.com/Progmasoft/tala/tree/main/Spec/Language";
+
+const syntax: DocTopic = {
+ "en-US": {
+ nav: "Syntax",
+ title: "Syntax · Tala",
+ description:
+ "A first look at the syntax of Tala: programs, comments, declarations, operators and evaluation by need.",
+ section: "DOCUMENTATION / SYNTAX",
+ heading: "A first look at the syntax",
+ lead: "The examples on this page come from the public specification. It is the normative description of the language and lists valid and invalid forms side by side.",
+ blocks: [
+ { kind: "heading", text: "A program" },
+ {
+ kind: "text",
+ text: "A program starts in the parameterless public static void Main() of a class. There is no top-level function. A file declares its namespace; the namespace does not have to match the path of the file.",
+ },
+ { kind: "code", code: program },
+ { kind: "heading", text: "Comments" },
+ {
+ kind: "text",
+ text: "-- starts a comment wherever it stands outside a string. That is why the language has ++ and no decrement operator: write value -= 1.",
+ },
+ { kind: "code", code: comments },
+ { kind: "heading", text: "Declarations" },
+ {
+ kind: "text",
+ text: "Names are case-sensitive. A declaration without an access modifier is internal; no context defaults to private. There are no forward and no partial declarations, and declaration order does not affect visibility.",
+ },
+ { kind: "code", code: declarations },
+ { kind: "heading", text: "Operators" },
+ {
+ kind: "text",
+ text: "Precedence is fixed; there are no user-defined precedence groups. Inequality is \\=, logical NOT is not, and && and || join Boolean values. // is integer division that rounds, and + joins Strings.",
+ },
+ { kind: "code", code: operators },
+ { kind: "heading", text: "Evaluation by need" },
+ {
+ kind: "text",
+ text: "Tala evaluates by need: binding a name computes nothing, a value is computed when it is first needed, and at most once. A value that is never needed is never computed.",
+ },
+ { kind: "code", code: evaluation },
+ {
+ kind: "note",
+ title: "The specification",
+ text: `The full rules, with every valid and invalid example, are in ${specification}. A specification example is not proof that the current compiler accepts it.`,
+ },
+ ],
+ },
+ "de-DE": {
+ nav: "Syntax",
+ title: "Syntax · Tala",
+ description:
+ "Ein erster Blick auf die Syntax von Tala: Programme, Kommentare, Deklarationen, Operatoren und Auswertung nach Bedarf.",
+ section: "DOKUMENTATION / SYNTAX",
+ heading: "Ein erster Blick auf die Syntax",
+ lead: "Die Beispiele dieser Seite stammen aus der öffentlichen Spezifikation. Sie ist die maßgebliche Beschreibung der Sprache und stellt gültige und ungültige Formen nebeneinander.",
+ blocks: [
+ { kind: "heading", text: "Ein Programm" },
+ {
+ kind: "text",
+ text: "Ein Programm beginnt im parameterlosen public static void Main() einer Klasse. Es gibt keine Funktion auf oberster Ebene. Eine Datei deklariert ihren Namespace; er muss nicht zum Pfad der Datei passen.",
+ },
+ { kind: "code", code: program },
+ { kind: "heading", text: "Kommentare" },
+ {
+ kind: "text",
+ text: "-- beginnt außerhalb eines Strings überall einen Kommentar. Deshalb hat die Sprache ++ und keinen Dekrement-Operator: Man schreibt value -= 1.",
+ },
+ { kind: "code", code: comments },
+ { kind: "heading", text: "Deklarationen" },
+ {
+ kind: "text",
+ text: "Namen unterscheiden Groß- und Kleinschreibung. Eine Deklaration ohne Zugriffsmodifizierer ist internal; kein Kontext ist standardmäßig private. Es gibt keine Vorwärts- und keine partiellen Deklarationen, und die Reihenfolge der Deklarationen beeinflusst die Sichtbarkeit nicht.",
+ },
+ { kind: "code", code: declarations },
+ { kind: "heading", text: "Operatoren" },
+ {
+ kind: "text",
+ text: "Die Rangfolge ist fest; benutzerdefinierte Rangfolgegruppen gibt es nicht. Ungleichheit ist \\=, logisches NICHT ist not, && und || verbinden Wahrheitswerte. // ist ganzzahlige Division mit Rundung, und + verbindet Strings.",
+ },
+ { kind: "code", code: operators },
+ { kind: "heading", text: "Auswertung nach Bedarf" },
+ {
+ kind: "text",
+ text: "Tala wertet nach Bedarf aus: Einen Namen zu binden berechnet nichts, ein Wert wird berechnet, wenn er zum ersten Mal gebraucht wird, und höchstens einmal. Ein Wert, der nie gebraucht wird, wird nie berechnet.",
+ },
+ { kind: "code", code: evaluation },
+ {
+ kind: "note",
+ title: "Die Spezifikation",
+ text: `Die vollständigen Regeln mit allen gültigen und ungültigen Beispielen stehen unter ${specification}. Ein Beispiel der Spezifikation beweist nicht, dass der aktuelle Compiler es annimmt.`,
+ },
+ ],
+ },
+ "ru-RU": {
+ nav: "Синтаксис",
+ title: "Синтаксис · Tala",
+ description:
+ "Первое знакомство с синтаксисом Tala: программы, комментарии, объявления, операторы и вычисление по необходимости.",
+ section: "ДОКУМЕНТАЦИЯ / СИНТАКСИС",
+ heading: "Первое знакомство с синтаксисом",
+ lead: "Примеры на этой странице взяты из публичной спецификации. Она — нормативное описание языка и показывает допустимые и недопустимые формы рядом.",
+ blocks: [
+ { kind: "heading", text: "Программа" },
+ {
+ kind: "text",
+ text: "Программа начинается в методе public static void Main() без параметров какого-либо класса. Функций верхнего уровня нет. Файл объявляет своё пространство имён; оно не обязано совпадать с путём к файлу.",
+ },
+ { kind: "code", code: program },
+ { kind: "heading", text: "Комментарии" },
+ {
+ kind: "text",
+ text: "-- начинает комментарий в любом месте вне строки. Поэтому в языке есть ++ и нет оператора декремента: пишите value -= 1.",
+ },
+ { kind: "code", code: comments },
+ { kind: "heading", text: "Объявления" },
+ {
+ kind: "text",
+ text: "Имена чувствительны к регистру. Объявление без модификатора доступа — internal; ни в одном контексте по умолчанию нет private. Предварительных и частичных объявлений нет, а порядок объявлений не влияет на видимость.",
+ },
+ { kind: "code", code: declarations },
+ { kind: "heading", text: "Операторы" },
+ {
+ kind: "text",
+ text: "Приоритеты фиксированы; пользовательских групп приоритетов нет. Неравенство записывается как \\=, логическое НЕ — not, а && и || соединяют логические значения. // — целочисленное деление с округлением, + соединяет строки.",
+ },
+ { kind: "code", code: operators },
+ { kind: "heading", text: "Вычисление по необходимости" },
+ {
+ kind: "text",
+ text: "Tala вычисляет по необходимости: связывание имени ничего не вычисляет, значение вычисляется, когда оно впервые нужно, и не более одного раза. Значение, которое никогда не понадобится, никогда не вычисляется.",
+ },
+ { kind: "code", code: evaluation },
+ {
+ kind: "note",
+ title: "Спецификация",
+ text: `Полные правила со всеми допустимыми и недопустимыми примерами находятся по адресу ${specification}. Пример из спецификации не доказывает, что текущий компилятор его принимает.`,
+ },
+ ],
+ },
+ "he-IL": {
+ nav: "תחביר",
+ title: "תחביר · Tala",
+ description: "מבט ראשון על התחביר של Tala: תוכניות, הערות, הצהרות, אופרטורים והערכה לפי צורך.",
+ section: "תיעוד / תחביר",
+ heading: "מבט ראשון על התחביר",
+ lead: "הדוגמאות בעמוד הזה לקוחות מהמפרט הציבורי. הוא התיאור המחייב של השפה, ומציג צורות תקינות ולא תקינות זו לצד זו.",
+ blocks: [
+ { kind: "heading", text: "תוכנית" },
+ {
+ kind: "text",
+ text: "תוכנית מתחילה ב-public static void Main() ללא פרמטרים של מחלקה. אין פונקציה ברמה העליונה. קובץ מצהיר על מרחב השמות שלו; מרחב השמות אינו חייב להתאים לנתיב הקובץ.",
+ },
+ { kind: "code", code: program },
+ { kind: "heading", text: "הערות" },
+ {
+ kind: "text",
+ text: "‎-- מתחיל הערה בכל מקום מחוץ למחרוזת. לכן יש בשפה ++ ואין אופרטור הפחתה: כותבים value -= 1.",
+ },
+ { kind: "code", code: comments },
+ { kind: "heading", text: "הצהרות" },
+ {
+ kind: "text",
+ text: "שמות רגישים לאותיות גדולות וקטנות. הצהרה בלי משנה גישה היא internal; אין הקשר שבו ברירת המחדל היא private. אין הצהרות מקדימות ואין הצהרות חלקיות, וסדר ההצהרות אינו משפיע על הנראות.",
+ },
+ { kind: "code", code: declarations },
+ { kind: "heading", text: "אופרטורים" },
+ {
+ kind: "text",
+ text: "סדר הקדימויות קבוע; אין קבוצות קדימות שהמשתמש מגדיר. אי-שוויון נכתב \\=, ‏NOT לוגי הוא not, ו-&& ו-|| מחברים ערכים בוליאניים. // הוא חילוק שלמים עם עיגול, ו-+ מחבר מחרוזות.",
+ },
+ { kind: "code", code: operators },
+ { kind: "heading", text: "הערכה לפי צורך" },
+ {
+ kind: "text",
+ text: "Tala מעריכה לפי צורך: קשירת שם אינה מחשבת דבר, ערך מחושב כשהוא נדרש בפעם הראשונה, ולכל היותר פעם אחת. ערך שלעולם אינו נדרש לעולם אינו מחושב.",
+ },
+ { kind: "code", code: evaluation },
+ {
+ kind: "note",
+ title: "המפרט",
+ text: `הכללים המלאים, עם כל הדוגמאות התקינות והלא תקינות, נמצאים ב-${specification}. דוגמה מהמפרט אינה הוכחה שהמהדר הנוכחי מקבל אותה.`,
+ },
+ ],
+ },
+};
+
+export const syntaxRoutes: readonly DocRoute[] = [{ path: "/docs/syntax", topic: syntax }];
diff --git a/frontend/src/content/talac.ts b/frontend/src/content/talac.ts
new file mode 100644
index 0000000..bbd234b
--- /dev/null
+++ b/frontend/src/content/talac.ts
@@ -0,0 +1,441 @@
+// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
+// SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1
+
+import type { DocRoute, DocTopic } from "./types";
+
+// Commands and values are the same in every language; only the prose is translated.
+const compile = `talac Program.tala --entry=Namespace.Program
+.\\Program.exe`;
+const program = `talac Main.tala Helper.tala --entry=Demo.Program`;
+const check = `talac Helper.tala --emit=metadata`;
+const warnings = `talac Program.tala --entry=Demo.Program --warnings=all,shadow
+talac Program.tala --entry=Demo.Program --warnings=all --warnings=shadow`;
+const stages = `talac Main.tala --entry=Demo.Program --emit=xpp
+talac Main.xpp --build=xpp --emit=xmm
+talac Main.xmm --build=xmm --emit=llvm-ir`;
+const record = `talameta 1
+compiler 0.6.0
+entry Demo.Program
+input Sources/Main.tala
+input Sources/Helper.tala`;
+
+const optionTerms = (d: {
+ version: string;
+ help: string;
+ entry: string;
+ standard: string;
+ target: string;
+ werror: string;
+ warnings: string;
+ backend: string;
+ opt: string;
+ llvm: string;
+ passes: string;
+ emit: string;
+ build: string;
+ type: string;
+}) => [
+ { term: "--version, -v", detail: d.version },
+ { term: "--help, -h", detail: d.help },
+ { term: "--entry=Namespace.Class", detail: d.entry },
+ { term: "--standard=26", detail: d.standard },
+ { term: "--target=<triple>, -t<triple>", detail: d.target },
+ { term: "--warnings-as-errors=true|false", detail: d.werror },
+ { term: "--warnings=none|low|medium|all[,shadow]", detail: d.warnings },
+ { term: "--codegen-backend=llvm", detail: d.backend },
+ { term: "--opt-level=0|1|2|3|g, -O2", detail: d.opt },
+ { term: "--llvm-compiler, --llvm-lto, --llvm-args", detail: d.llvm },
+ { term: "--xpp-optimization-passes, --xmm-optimization-passes", detail: d.passes },
+ { term: "--emit=…", detail: d.emit },
+ { term: "--build=…", detail: d.build },
+ { term: "--vipkg-type=executable|staticlib|cdylib|talalib", detail: d.type },
+];
+
+const commandLine: DocTopic = {
+ "en-US": {
+ nav: "Command line",
+ title: "Command line · talac",
+ description:
+ "The command line of talac, the Tala compiler: inputs, options, the entry class and warnings.",
+ section: "TALAC / COMMAND LINE",
+ heading: "The compiler and its command line",
+ lead: "talac is the compiler and nothing else: sources or artifacts go in, one artifact comes out. Projects, dependencies, formatting and linting belong to Tazel, which starts talac as a separate program.",
+ blocks: [
+ { kind: "code", code: compile },
+ {
+ kind: "text",
+ text: "The output is written beside the first input, under that input's name. An executable takes the usual extension of the host: .exe on Windows, none elsewhere. Several inputs are one program.",
+ },
+ { kind: "code", code: program },
+ { kind: "heading", text: "How options are written" },
+ {
+ kind: "text",
+ text: "A long option takes its value after =, as in --emit=core. A short option takes it joined or after =: -O2 or -O=2. Not every long option has a short one. -- ends the options; everything after it is an input. Names and values are case-sensitive.",
+ },
+ {
+ kind: "terms",
+ items: optionTerms({
+ version: "Prints the version of the compiler.",
+ help: "Prints the help.",
+ entry: "The class whose parameterless public static void Main() starts the program.",
+ standard: "The language standard. 26 is the only one and the default.",
+ target: "An LLVM target triple. The default is the target of the host.",
+ werror: "Turns warnings into errors. Default false.",
+ warnings: "The warning level, default medium, and the shadow warning.",
+ backend: "The code generator. LLVM is the only one.",
+ opt: "The optimization level, default 2.",
+ llvm: "The LLVM compilation mode, link-time optimization and arguments handed to LLVM.",
+ passes: "Turn the optimization passes of the Xpp and Xmm stages on or off. Default true.",
+ emit: "What to write; see Outputs.",
+ build: "What the inputs are; see Outputs.",
+ type: "The kind of package to write. Default executable.",
+ }),
+ },
+ { kind: "heading", text: "The entry" },
+ {
+ kind: "text",
+ text: "--entry is required when anything is built from Tala sources, and it cannot be written for a library. An artifact input already carries its entry. A check builds nothing, so one source can be checked without an entry; several sources are one program and still need it.",
+ },
+ { kind: "code", code: check },
+ { kind: "heading", text: "Warnings" },
+ {
+ kind: "text",
+ text: "--warnings sets a level and, separately, the shadow warning, which reports a local that hides a name of an outer scope. No level turns shadow on, all included; it is asked for by name. A command line holds at most one level and one shadow, and none cannot be combined with shadow.",
+ },
+ { kind: "code", code: warnings },
+ {
+ kind: "note",
+ title: "Not implemented yet",
+ text: "An option the compiler reads but cannot carry out is refused by name with exit code 2: the library package types and --header, --llvm-compiler=orc, link-time optimization, --llvm-args, LLVM IR or bitcode as input, and --warnings=shadow, whose warning is not in the frontend yet.",
+ },
+ ],
+ },
+ "de-DE": {
+ nav: "Befehlszeile",
+ title: "Befehlszeile · talac",
+ description:
+ "Die Befehlszeile von talac, dem Tala-Compiler: Eingaben, Optionen, die Einstiegsklasse und Warnungen.",
+ section: "TALAC / BEFEHLSZEILE",
+ heading: "Der Compiler und seine Befehlszeile",
+ lead: "talac ist der Compiler und nichts sonst: Quellen oder Artefakte gehen hinein, ein Artefakt kommt heraus. Projekte, Abhängigkeiten, Formatierung und Linting gehören zu Tazel, das talac als eigenes Programm startet.",
+ blocks: [
+ { kind: "code", code: compile },
+ {
+ kind: "text",
+ text: "Die Ausgabe landet neben der ersten Eingabe und trägt deren Namen. Eine ausführbare Datei bekommt die übliche Endung des Hosts: .exe unter Windows, sonst keine. Mehrere Eingaben sind ein Programm.",
+ },
+ { kind: "code", code: program },
+ { kind: "heading", text: "Wie Optionen geschrieben werden" },
+ {
+ kind: "text",
+ text: "Eine lange Option nimmt ihren Wert nach =, etwa --emit=core. Eine kurze Option nimmt ihn direkt angehängt oder nach =: -O2 oder -O=2. Nicht jede lange Option hat eine kurze. -- beendet die Optionen; alles danach ist eine Eingabe. Namen und Werte unterscheiden Groß- und Kleinschreibung.",
+ },
+ {
+ kind: "terms",
+ items: optionTerms({
+ version: "Gibt die Version des Compilers aus.",
+ help: "Gibt die Hilfe aus.",
+ entry: "Die Klasse, deren parameterloses public static void Main() das Programm startet.",
+ standard: "Der Sprachstandard. 26 ist der einzige und die Vorgabe.",
+ target: "Ein LLVM-Target-Triple. Vorgabe ist das Ziel des Hosts.",
+ werror: "Macht Warnungen zu Fehlern. Vorgabe false.",
+ warnings: "Die Warnstufe, Vorgabe medium, und die Shadow-Warnung.",
+ backend: "Der Codegenerator. LLVM ist der einzige.",
+ opt: "Die Optimierungsstufe, Vorgabe 2.",
+ llvm: "Der LLVM-Kompilierungsmodus, Link-Time-Optimierung und an LLVM übergebene Argumente.",
+ passes:
+ "Schaltet die Optimierungsdurchläufe der Stufen Xpp und Xmm ein oder aus. Vorgabe true.",
+ emit: "Was geschrieben wird; siehe Ausgaben.",
+ build: "Was die Eingaben sind; siehe Ausgaben.",
+ type: "Die Art des Pakets. Vorgabe executable.",
+ }),
+ },
+ { kind: "heading", text: "Der Einstieg" },
+ {
+ kind: "text",
+ text: "--entry ist nötig, sobald aus Tala-Quellen etwas gebaut wird, und darf für eine Bibliothek nicht angegeben werden. Ein Artefakt bringt seinen Einstieg schon mit. Eine Prüfung baut nichts, daher kann eine einzelne Quelle ohne Einstieg geprüft werden; mehrere Quellen sind ein Programm und brauchen ihn weiterhin.",
+ },
+ { kind: "code", code: check },
+ { kind: "heading", text: "Warnungen" },
+ {
+ kind: "text",
+ text: "--warnings setzt eine Stufe und getrennt davon die Shadow-Warnung, die eine lokale Variable meldet, die einen Namen eines äußeren Bereichs verdeckt. Keine Stufe schaltet shadow ein, auch all nicht; sie wird beim Namen verlangt. Eine Befehlszeile enthält höchstens eine Stufe und ein shadow, und none lässt sich nicht mit shadow kombinieren.",
+ },
+ { kind: "code", code: warnings },
+ {
+ kind: "note",
+ title: "Noch nicht umgesetzt",
+ text: "Eine Option, die der Compiler liest, aber nicht ausführen kann, wird mit Namen und Exit-Code 2 abgelehnt: die Bibliothekspaket-Arten und --header, --llvm-compiler=orc, Link-Time-Optimierung, --llvm-args, LLVM-IR oder Bitcode als Eingabe sowie --warnings=shadow, dessen Warnung noch nicht im Frontend ist.",
+ },
+ ],
+ },
+ "ru-RU": {
+ nav: "Командная строка",
+ title: "Командная строка · talac",
+ description:
+ "Командная строка talac, компилятора Tala: входные файлы, параметры, класс точки входа и предупреждения.",
+ section: "TALAC / КОМАНДНАЯ СТРОКА",
+ heading: "Компилятор и его командная строка",
+ lead: "talac — это компилятор и ничего больше: на вход подаются исходники или артефакты, на выходе получается один артефакт. Проекты, зависимости, форматирование и линтинг относятся к Tazel, который запускает talac как отдельную программу.",
+ blocks: [
+ { kind: "code", code: compile },
+ {
+ kind: "text",
+ text: "Результат записывается рядом с первым входным файлом под его именем. Исполняемый файл получает обычное для системы расширение: .exe в Windows, без расширения в остальных системах. Несколько входных файлов образуют одну программу.",
+ },
+ { kind: "code", code: program },
+ { kind: "heading", text: "Как записываются параметры" },
+ {
+ kind: "text",
+ text: "Длинный параметр принимает значение после =, например --emit=core. Короткий принимает его слитно или после =: -O2 или -O=2. Не у каждого длинного параметра есть короткий. -- завершает параметры; всё после него — входные файлы. Имена и значения чувствительны к регистру.",
+ },
+ {
+ kind: "terms",
+ items: optionTerms({
+ version: "Выводит версию компилятора.",
+ help: "Выводит справку.",
+ entry: "Класс, чей метод public static void Main() без параметров запускает программу.",
+ standard: "Стандарт языка. 26 — единственный и значение по умолчанию.",
+ target: "Целевая тройка LLVM. По умолчанию — платформа системы.",
+ werror: "Превращает предупреждения в ошибки. По умолчанию false.",
+ warnings: "Уровень предупреждений, по умолчанию medium, и предупреждение shadow.",
+ backend: "Генератор кода. LLVM — единственный.",
+ opt: "Уровень оптимизации, по умолчанию 2.",
+ llvm: "Режим компиляции LLVM, оптимизация при компоновке и аргументы, передаваемые LLVM.",
+ passes: "Включают или выключают проходы оптимизации стадий Xpp и Xmm. По умолчанию true.",
+ emit: "Что записать; см. «Результаты».",
+ build: "Что подаётся на вход; см. «Результаты».",
+ type: "Вид создаваемого пакета. По умолчанию executable.",
+ }),
+ },
+ { kind: "heading", text: "Точка входа" },
+ {
+ kind: "text",
+ text: "--entry обязателен, когда что-либо собирается из исходников Tala, и его нельзя указывать для библиотеки. Артефакт уже содержит свою точку входа. Проверка ничего не собирает, поэтому один исходник можно проверить без точки входа; несколько исходников — это одна программа, и им она по-прежнему нужна.",
+ },
+ { kind: "code", code: check },
+ { kind: "heading", text: "Предупреждения" },
+ {
+ kind: "text",
+ text: "--warn