[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I declare a string variable — is it the same in ling-lang and PowerShell?

[Assistant]
No — these are three different mechanisms:
- In ling-lang: `bind name = "Ling"` — `bind` is a language keyword that creates a name binding.
- In PowerShell: `$name = "Ling"` — variables are always prefixed with `$`, no declaration keyword.
- In Bash: `name="Ling"` — no spaces around `=`, no `$` on assignment (only on use: `$name`).
`bind` is not a shell variable sigil and ling-lang never uses `$` for variables — don't blend the two.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I declare a number variable in ling-lang, PowerShell, and Bash?

[Assistant]
In ling-lang: `bind count = 42` — numbers are a plain literal, no type sigil needed.
In PowerShell: `$count = 42` — PowerShell auto-types the variable.
In Bash: `count=42` (arithmetic context needed later, e.g. `count=$((count + 1))`) — Bash treats
everything as a string/integer hybrid unless you use `declare -i`.
These are not interchangeable: writing `bind $count = 42` or `$count = 42` inside a `.ling` file is a syntax error.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I declare a boolean variable in each of ling-lang, PowerShell, and Bash?

[Assistant]
- ling-lang: `bind ready = true` — `true`/`false` are literals (per the language glossary).
- PowerShell: `$ready = $true` — booleans are `$true`/`$false`, WITH the dollar sign.
- Bash: has no real boolean type; convention is `ready=1` / `ready=0`, or use exit codes (`true`/`false` as commands).
Note ling-lang's `true`/`false` have no `$` prefix at all — that's a PowerShell-only convention.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] I want to update a loop counter — do I write `change i = i + 1` or something else in ling-lang, and how does that compare to PowerShell/Bash?

[Assistant]
ling-lang has a dedicated `change` keyword for mutating an existing binding (per the keyword glossary: "Mutate a binding"), so `change i = i + 1` is valid. In practice, real ling-lang source in this ecosystem (e.g. `fu.ling-lang.org/controllers/packages.ling`) just re-binds the counter inside the loop: `bind i = i + 1`.
Compare:
- PowerShell: `$i = $i + 1` or `$i++`.
- Bash: `i=$((i + 1))` or `((i++))`.
None of these spellings are interchangeable — `$i++` is meaningless in a `.ling` file.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I print a value — is it the same in ling-lang and PowerShell?

[Assistant]
No. In ling-lang: `print("hello")` — confirmed in the canonical English demo in `ling/examples/basics/advanced.ling` (`bind greeting = "Hello from Ling!"` / `print(greeting)`), and in the README's Hello World: `fn main() { bind x = 42 print("Hello!") }`.
In PowerShell: `Write-Host "hello"` (or `Write-Output "hello"`).
In Bash: `echo "hello"`.
These are NOT interchangeable: ling-lang's `print` is a builtin function call (parentheses, comma-separated arguments), not a shell cmdlet or command — `Write-Host` and `echo` do not exist as ling-lang builtins.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I print several values on one line in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `print("fib(", i, ") = ", result)` — comma-separated arguments to the `print(...)` builtin (this exact pattern appears in `ling/examples/basics/fib.ling`: `출력("피보나치(", i, ") = ", 피보나치(i))`, English builtin name `print`).
- PowerShell: `Write-Host "fib($i) =" $result` or string interpolation `"fib($i) = $result"`.
- Bash: `echo "fib($i) = $result"`.
ling-lang has no string interpolation like `"$var"` — values are passed as separate arguments or joined with `+`.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Is there a print-with-newline builtin in ling-lang, and how does it differ from PowerShell/Bash?

[Assistant]
Yes: `println(v)` (alias of `print` with a trailing newline, per `ling/docs/src/multilingual/builtins.md`'s Output table). It's a builtin function call: `println("done")`.
PowerShell's `Write-Host` already appends a newline by default, and Bash's `echo` does too (`echo -n` suppresses it).
Don't write `println "done"` (no parens) — that's shell command syntax, not a ling-lang function call.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Write a simple if statement in ling-lang, PowerShell, and Bash for checking if n <= 1.

[Assistant]
- ling-lang: `if n <= 1 { return n }` — braces, no `then`/`elseif` keywords, condition is bare (no parens required). Real example from `ling/examples/basics/fib.ling`: `만약 n <= 1 { n }` (`만약` = `if`).
- PowerShell: `if ($n -le 1) { return $n }` — condition MUST be parenthesized, and comparison is `-le`, not `<=`.
- Bash: `if [ "$n" -le 1 ]; then return $n; fi` — needs `[ ]` test brackets, `-le`, `then`/`fi`.
ling-lang's `<=` operator (from the literals/operators glossary) is the C-style symbol — PowerShell's `-le` text operator will NOT parse inside a `.ling` file.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Show an if/else in ling-lang vs PowerShell vs Bash.

[Assistant]
- ling-lang: `if n <= 1 { n } else { fib(n - 1) + fib(n - 2) }` (from `ling/examples/basics/fib.ling`) — `if` is an expression, so the branches' final values can be the function's return value with no explicit `return`.
- PowerShell: `if ($n -le 1) { $n } else { fib ($n-1) + fib ($n-2) }` — braces required, condition in parens.
- Bash: `if [ "$n" -le 1 ]; then echo "$n"; else echo $(( $(fib $((n-1))) + $(fib $((n-2))) )); fi`.
ling-lang's `else` never takes a condition of its own — for else-if chains you write `else { if ... }`, unlike Bash's dedicated `elif` keyword.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I write an if / else-if / else chain in ling-lang, compared to PowerShell and Bash?

[Assistant]
ling-lang has no `elif`/`elseif` keyword — you nest: `if hour < 12 { "morning" } else { if hour < 18 { "afternoon" } else { "evening" } }`.
PowerShell: `if ($hour -lt 12) { "morning" } elseif ($hour -lt 18) { "afternoon" } else { "evening" }` — has a real `elseif` keyword.
Bash: `if [ "$hour" -lt 12 ]; then echo morning; elif [ "$hour" -lt 18 ]; then echo afternoon; else echo evening; fi` — has a real `elif` keyword.
Don't reach for `elif`/`elseif` in ling-lang source — it isn't a keyword there (see `ling/docs/src/glossary/keywords.md`).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I test equality in a condition in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `if lang == "en" { ... }` — C-style `==`, confirmed throughout `ling-lin.me/controllers/home.ling` (e.g. `if lang == "th" { return th }`).
- PowerShell: `if ($lang -eq "en") { ... }` — uses the `-eq` text operator, NOT `==`.
- Bash: `if [ "$lang" = "en" ]; then ... fi` — single `=` (or `==` only inside `[[ ]]`).
Using PowerShell's `-eq` or Bash's single-`=`-in-`[ ]` inside ling-lang code will not compile — ling-lang always uses `==`/`!=`/`<`/`<=`/`>`/`>=` per its operator glossary.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I combine two conditions with AND/OR in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `&&` and `||` (per `ling/docs/src/glossary/literals.md`'s operator table), e.g. `if a > 0 && b > 0 { ... }`.
- PowerShell: `-and` / `-or`, e.g. `if ($a -gt 0 -and $b -gt 0) { ... }`.
- Bash: `&&`/`||` between `[ ]` tests, or `-a`/`-o` inside a single `[ ]` (discouraged), e.g. `if [ "$a" -gt 0 ] && [ "$b" -gt 0 ]; then ...; fi`.
ling-lang and Bash happen to share the `&&`/`||` symbols here, but PowerShell's `-and`/`-or` text operators do not exist in ling-lang.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Write a for loop counting 0 to 9 in ling-lang, PowerShell, and Bash.

[Assistant]
- ling-lang: `for i in 0..10 { print(i) }` — `0..10` is a range literal (per the literals glossary), and `for`/`in` are the loop keywords. Confirmed real usage: `ling/examples/basics/fib.ling` has `위해 i 안에 0..10 { ... }` (`위해`=`for`, `안에`=`in`).
- PowerShell: `for ($i = 0; $i -lt 10; $i++) { Write-Host $i }` — C-style three-part for, OR `0..9 | ForEach-Object { $_ }`.
- Bash: `for i in {0..9}; do echo $i; done` (brace expansion) or `for ((i=0; i<10; i++)); do echo $i; done`.
ling-lang's `0..10` range and `for x in range { }` shape looks closest to Bash's `for i in {0..9}`, but the syntax (no braces around the range, real `{ }` block instead of `do...done`) is distinct — don't mix them.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I iterate over a list/array in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `for word in words { print(word) }` — same `for`/`in` keywords as range iteration, just swap the range for a list value (per `ling/docs/src/glossary/keywords.md`: `in` = "Iteration source").
- PowerShell: `foreach ($word in $words) { Write-Host $word }` or `$words | ForEach-Object { $_ }`.
- Bash: `for word in "${words[@]}"; do echo "$word"; done`.
ling-lang uses the single keyword `for`, never `foreach`, and list elements are not accessed with `$_` or `${arr[@]}` expansion syntax.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Write a while loop in ling-lang, PowerShell, and Bash that runs while i is less than n.

[Assistant]
- ling-lang: `while i < n { bind i = i + 1 }` — confirmed pattern in `chat.ling-lang.org/controllers/chat.ling`: `while i < n { bind m = list_get(messages, i) ... bind i = i + 1 }`.
- PowerShell: `while ($i -lt $n) { $i++ }`.
- Bash: `while [ $i -lt $n ]; do i=$((i+1)); done`.
ling-lang's `while` condition is bare (no parens, no `[ ]` test brackets) and uses `<` directly, unlike both shells.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I break out of a loop early in ling-lang, versus PowerShell and Bash?

[Assistant]
- ling-lang: `stop` (per the keyword glossary: "Break out of the loop"), e.g. `while true { if done { stop } }`.
- PowerShell: `break`.
- Bash: `break`.
ling-lang deliberately does NOT use the word `break` — it's `stop`. Writing `break` in a `.ling` file is not a recognized keyword there.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I skip to the next loop iteration in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `again` (per the keyword glossary: "Continue the loop") — NOT `continue`.
- PowerShell: `continue`.
- Bash: `continue`.
This is a real trap for a model fluent in shell scripting: ling-lang's continue-equivalent keyword is spelled `again`, while both shells use `continue`.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I define a basic function in ling-lang vs a PowerShell function vs a Bash function?

[Assistant]
- ling-lang: `fn greet() { print("hi") }` — keyword `fn`, parens even with no params, braces for the body. Confirmed in the README Hello World: `fn main() { bind x = 42 print("Hello!") }`.
- PowerShell: `function Greet { Write-Host "hi" }` — keyword `function`, PascalCase-Verb-Noun convention, parens usually omitted.
- Bash: `greet() { echo "hi"; }` — no keyword at all, just `name() { ... }`.
ling-lang always requires the `fn` keyword; Bash never uses one.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I define a function with typed parameters and a return type in ling-lang, and how does that compare to PowerShell/Bash?

[Assistant]
ling-lang: `fn fib(n: number) -> number { if n <= 1 { n } else { fib(n - 1) + fib(n - 2) } }` — param types after `:`, return type after `->` (confirmed by `ling/examples/basics/fib.ling`'s English-glossary equivalent and the `->` operator entry in `ling/docs/src/glossary/literals.md`: "Function return type").
PowerShell: has optional type annotations but no arrow-return syntax: `function Fib([int]$n) { if ($n -le 1) { return $n }; return (Fib ($n-1)) + (Fib ($n-2)) }`.
Bash: has no real typed parameters or return values at all — functions only return exit codes (0-255) via `return`, and "return a value" means echoing to stdout and capturing it with `$(...)`.
ling-lang's `->` return-type arrow has no equivalent in either shell language.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I define a function that takes multiple parameters in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `fn t(lang, en, th, ko, ja, zh) { if lang == "th" { return th } ... return en }` — comma-separated parameter names in parens, confirmed in `ling-lin.me/controllers/home.ling`.
- PowerShell: `function T($lang, $en, $th) { ... }` or the `param()` block form.
- Bash: functions don't declare named parameters at all — you read `$1`, `$2`, `$3`, ... positionally inside the body.
ling-lang parameters are named and referenced directly by name inside the function, unlike Bash's positional `$1`/`$2`.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Write a recursive function in ling-lang and show how it's unlike calling a function recursively in PowerShell/Bash.

[Assistant]
ling-lang: `fn fib(n: number) -> number { if n <= 1 { n } else { fib(n - 1) + fib(n - 2) } }` — the function just calls itself by name, same as any other call (from `ling/examples/basics/fib.ling`).
PowerShell: `function Fib($n) { if ($n -le 1) { return $n }; return (Fib ($n-1)) + (Fib ($n-2)) }` — same idea, but note calling a PowerShell function does NOT use parens around all-args like a normal language call.
Bash: recursion works but returning a computed number requires `echo` + `$(...)` capture, e.g. `fib() { if [ "$1" -le 1 ]; then echo "$1"; return; fi; echo $(( $(fib $(($1-1))) + $(fib $(($1-2))) )); }` — substantially clumsier than ling-lang's direct arithmetic expression.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I return a value from a function in ling-lang, and are there other keywords for it?

[Assistant]
The primary keyword is `return` (e.g. `return lang` in `ling-lin.me/controllers/home.ling`). The glossary (`ling/docs/src/glossary/keywords.md`) also lists `post` ("Return a value (idiomatic return)") and `give` ("Yield / return a value") as alternate spellings, and the last bare expression in a block is itself the return value (no keyword needed) — that's how `fib.ling`'s `if n <= 1 { n } else { ... }` works.
PowerShell's `return` is similar in spirit but PowerShell also implicitly outputs anything not captured/assigned. Bash's `return` only sets a numeric exit status (0-255) — it cannot return a string or computed value directly.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I concatenate strings in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: the `+` operator, e.g. `"<a href='/?lang=" + code + "' class='" + cls + "'>"` (real pattern from `ling-lin.me/controllers/home.ling`'s `lang_option` function).
- PowerShell: also `+` (`"Hello " + $name`), OR string interpolation `"Hello $name"`.
- Bash: no operator at all — strings concatenate just by being adjacent: `greeting="Hello "$name` or `greeting="Hello $name"`.
ling-lang, unlike Bash, has NO `"text $var"` interpolation — you must use `+` (or `format(...)`) to splice a variable into a string.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Does ling-lang support string interpolation like Bash's "$var" or PowerShell's "$($var)"?

[Assistant] No. ling-lang builds strings with the `+` operator (`"fib(" + i + ") = " + result`) or the `format(...)` builtin (per `ling/docs/src/multilingual/builtins.md`'s Output table: `format(fmt, ...)`). Writing `"value: $x"` inside a `.ling` string literal does NOT substitute `x` — it stays a literal dollar sign and letter x. This differs from both Bash (`"$x"` interpolates) and PowerShell (`"$x"` also interpolates) — ling-lang is the odd one out here.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I build up a string across a loop in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: repeatedly re-bind and concatenate with `+`, e.g. (from `fu.ling-lang.org/controllers/packages.ling`): `bind result = "" ... while i < letters.len { ... bind result = result + "<a>..." ... }`.
- PowerShell: `$result = ""; foreach ($x in $items) { $result += "<a>$x</a>" }` (`+=` works on strings).
- Bash: `result=""; for x in "${items[@]}"; do result+="<a>$x</a>"; done` (`+=` also works, Bash 4+).
ling-lang has no `+=` compound-assignment operator confirmed in its operator glossary — use `bind result = result + ...` instead.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I write a comment in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `// this is a comment` — double-slash, used pervasively across the real codebase (every `.ling` controller file in `ling-lin.me` and `fu.ling-lang.org` opens with `//` header comments).
- PowerShell: `# this is a comment` — hash/pound sign.
- Bash: `# this is a comment` — also hash/pound sign.
ling-lang uses C-style `//`, not the `#` used by both shells — don't write `# comment` expecting it to be ignored in a `.ling` file (it isn't a recognized comment marker there).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I comment out several lines of ling-lang code at once, compared to PowerShell/Bash?

[Assistant]
ling-lang's confirmed comment syntax is the line comment `//` (no block-comment form has been observed in the source read for this project) — so commenting out multiple lines means prefixing each line with `//` individually, as seen throughout `ling/examples/basics/advanced.ling`.
PowerShell supports a real block comment: `<# ... #>` in addition to `#` line comments.
Bash has no native block comment either — the common trick is a `: <<'EOF' ... EOF` here-doc, or prefixing each line with `#`.
Don't assume ling-lang has a `<# #>`-style block comment just because PowerShell does.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I read a file's contents in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `bind contents = read_file("path/to/file.txt")` — builtin function, returns the file as a string (per `ling/docs/src/multilingual/builtins.md`'s File I/O table: `read_file(path)` — "Read file to string").
- PowerShell: `$contents = Get-Content -Path "path\to\file.txt" -Raw`.
- Bash: `contents=$(cat path/to/file.txt)`.
ling-lang's `read_file` is a single builtin call returning a string, not a cmdlet (`Get-Content`) or external program invocation (`cat`).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I write a string to a file in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `write_file("out.txt", "hello")` — builtin (per the File I/O table in `ling/docs/src/multilingual/builtins.md`: `write_file(path, content)` — "Write string to file").
- PowerShell: `Set-Content -Path "out.txt" -Value "hello"` (or `"hello" | Out-File out.txt`).
- Bash: `echo "hello" > out.txt`.
There is no shell-style redirection operator (`>`) in ling-lang for writing files — you must call the `write_file(path, content)` builtin explicitly.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I create a list/array literal in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `bind letters = ["0", "a", "b", "c"]` — square-bracket list literal (per `ling/docs/src/glossary/literals.md`: `[1, 2, 3]` = "List"), confirmed real usage in `fu.ling-lang.org/controllers/packages.ling`: `ผูก อักษรๆ = ["0", "a", "b", ...]`.
- PowerShell: `$letters = @("0", "a", "b", "c")` or the shorthand `$letters = "0", "a", "b", "c"`.
- Bash: `letters=("0" "a" "b" "c")` — parens, no commas, space-separated.
ling-lang's `[ ]` list literal looks like PowerShell/Bash's array indexing syntax on first glance, but it's actually the literal itself, not an index operation — don't confuse `["a","b"]` (a list) with `$arr[0]` (an index).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] What builtins does ling-lang have for building/growing a list, and how does that compare to PowerShell/Bash arrays?

[Assistant]
ling-lang: `list_new()` (empty list), `list_push(lst, v)` (append and return new list), `list_pop(lst)`, `list_set(lst, i, v)`, all confirmed in `ling/docs/src/multilingual/builtins.md`'s Lists table — these are function calls, e.g. `bind items = list_new()` then `bind items = list_push(items, "x")`.
PowerShell: `$items = @(); $items += "x"` (or `.Add("x")` on an `[System.Collections.ArrayList]`).
Bash: `items=(); items+=("x")`.
ling-lang's list builtins are ordinary function calls returning values (functional style, note `list_push` "returns new list") rather than mutating operators like `+=`.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I get an element out of a list by index in ling-lang vs PowerShell vs Bash?

[Assistant]
- ling-lang: `bind first = list_get(letters, 0)` — builtin call (per the Lists table in `ling/docs/src/multilingual/builtins.md`), confirmed real usage `packages.ling`: `รับรายการ(อักษรๆ, ก)` (`รับรายการ` = `list_get`).
- PowerShell: `$first = $letters[0]` — bracket indexing.
- Bash: `first="${letters[0]}"` — bracket indexing inside `${ }`.
ling-lang does NOT use `letters[0]` bracket-indexing syntax for this — it's the explicit `list_get(letters, 0)` function call. (Field/property access like `.len`, seen below, does use `.`, but element access is a function call.)


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I get the length of a list in ling-lang vs PowerShell vs Bash?

[Assistant]
ling-lang has both a builtin function `list_len(lst)` (per `ling/docs/src/multilingual/builtins.md`) AND a `.len` property confirmed in real code, e.g. `fu.ling-lang.org/controllers/packages.ling`: `รายการ.len > 0` and `ขณะที่ ก < อักษรๆ.len` (while i < letters.len).
PowerShell: `$letters.Count` (or `$letters.Length`).
Bash: `${#letters[@]}`.
ling-lang's `.len` reads like a property access (dot syntax), distinct from both PowerShell's `.Count`/`.Length` naming and Bash's `${#arr[@]}` special expansion syntax.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I mark a program's entry point in ling-lang, and how is that different from a PowerShell or Bash script's entry point?

[Assistant]
ling-lang uses a `do { ... }` block bound to a name — confirmed two real conventions in this ecosystem: `bind start = do { ... }` (per `ling/docs/src/glossary/keywords.md`'s `start` entry, and used in `ling/examples/basics/fib.ling`'s `바인드 시작 = 실행 { ... }`), and `bind main = do { app.start(cli_args(list())) }` (the actual `main.ling` in this `ai.ling-lang.org` project). The README's Hello World instead shows a plain `fn main() { ... }` function.
PowerShell and Bash scripts have no declared entry point at all — the interpreter just runs top-level statements in file order, top to bottom.
ling-lang programs are structured around named bindings/functions even at the top level, unlike shell scripts' unstructured top-to-bottom execution.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I import another file/module in ling-lang, and is there an equivalent in PowerShell/Bash?

[Assistant]
ling-lang: `use "app"` or `use "controllers/auth"` — a `use` statement naming the module path without a file extension (confirmed in `ai.ling-lang.org/main.ling`: `use "app"`, and `ai.ling-lang.org/controllers/chat.ling`: `use "controllers/auth"`).
PowerShell's closest equivalent is dot-sourcing: `. .\lib.ps1` or `Import-Module .\Module.psm1`.
Bash's closest equivalent is sourcing: `source ./lib.sh` or `. ./lib.sh`.
ling-lang's `use "path"` is a language-level import statement resolved by the compiler/interpreter, not a runtime file-sourcing operation like PowerShell/Bash's.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I run a ling-lang web app locally for development, the way it's done across this ecosystem?

[Assistant]
Use the vendored interpreter binary with `run --interp`, pointing at the app's entry file and a port, e.g. (from `ling-lin.me/README.md`'s "Run it" section):
`bin\ling.exe run --interp app.ling --port 8420`
Then open `http://127.0.0.1:8420/`. `--interp` runs the tree-walking interpreter deliberately — the same pattern is used by `countries.ling-gov.org` and `fu.ling-lang.org`.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Why do production ling-lang sites in this ecosystem run with --interp instead of the faster JIT/AOT backend?

[Assistant] Per `ling-lin.me/README.md`: the AOT/JIT backend has a known struct-member-access bug in this Ling build, so production sites in this ecosystem (ling-lin.me, countries.ling-gov.org, fu.ling-lang.org) all run interpreted via `--interp` deliberately, trading some raw speed for correctness until that bug is fixed.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] By default, what interface does `ling.exe run` listen on, and how do I restrict it to localhost only?

[Assistant]
By default it listens on `0.0.0.0` (all interfaces). To restrict it to loopback only, pass `--listen "127.0.0.1"`, e.g.:
`bin\ling.exe run --interp app.ling --port 8420 --listen "127.0.0.1"`
(per `ling-lin.me/README.md`'s "Run it" section).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How is fu.ling-lang.org (the package registry) started, and on what port?

[Assistant]
Per `fu.ling-lang.org/README.md`'s "รันเซิร์ฟเวอร์" (Run server) section:
`ling run app.ling --listen "0.0.0.0" --port 6688`
It can alternatively be installed as a Windows service via `install-service.ps1`, run as administrator.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] The `ling.exe` on my PATH seems out of date compared to what a project expects — why, and what should I do?

[Assistant] Per `ling-lin.me/README.md`: the `ling.exe` installed via `cargo install ling-lang` on `PATH` may lag behind the locally built one. This project (and others in the ecosystem) vendors a known-working copy directly in `bin/ling.exe`, so run the project with that vendored binary (`bin\ling.exe run ...`) rather than relying on PATH.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I scaffold a brand-new ling-lang project from scratch?

[Assistant]
Use `lingfu new <name>`, e.g.:
`lingfu new my-room`
`lingfu` (also spelled `灵符` / `霊符` / `영부` / `ลิงฟู` in other languages) is the Ling project manager — think Cargo for Ling (per `ling/README.md`'s "ling-fu · Package Manager" section).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] What's the lingfu command to build and run a project in one step, versus just compiling it?

[Assistant]
`lingfu run` builds and runs the project; `lingfu build` compiles only, without running it (per `ling/README.md`):
```
lingfu run     # build & run
lingfu build   # compile only
```


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I run a ling-lang project's test suite with lingfu?

[Assistant] `lingfu test` (per `ling/README.md`'s ling-fu package-manager section, listed alongside `lingfu new`/`run`/`build`).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Can I translate an entire ling-lang project's keywords/builtins to another human language from the command line?

[Assistant]
Yes — `lingfu normalize <language>` rewrites all `.ling` keywords, builtin names, and file/folder names to a single target language project-wide, e.g.:
`lingfu normalize thai`
Add `--dry-run` to preview the change first without touching files: `lingfu normalize zh --dry-run` (per `ling/README.md`). This is useful for keeping a large codebase consistent in one language.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Do lingfu's own commands have non-English spellings, consistent with ling-lang's polyglot keywords?

[Assistant] Yes. Per `ling/README.md`, the same operation can be invoked in different languages, e.g. `lingfu run` is also `灵符 运行` (Chinese) or `ลิงฟู รัน` (Thai) — the package manager itself follows the same multilingual-alias philosophy as the language's keywords and builtins.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I compile a ling-lang project into a native Windows executable, and can I target other platforms?

[Assistant]
`ling build <file.ling|dir> --platform win` compiles to a native executable; `--platform` also accepts `lin` or `mac`, and `web` for a web build (per `ling/docs/BUILD_PACKAGING.md`). Full form:
`ling build <file.ling|dir> [--platform win|lin|mac|web] [--out dir]`


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I choose a custom output directory for a ling build?

[Assistant]
Pass `--out <dir>` to `ling build`, e.g.:
`ling build my-game --platform win --out dist/custom`
(per the `ling build` synopsis in `ling/docs/BUILD_PACKAGING.md`).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I set a custom app icon on a compiled ling-lang Windows executable?

[Assistant]
Three ways, in priority order (per `ling/docs/BUILD_PACKAGING.md`'s "App icon" section):
1. `--icon <file>` on the command line (highest priority): `ling build my-game --icon branding/app.png`
2. the `icon` field in the project manifest:
```toml
# Ling.toml
[project]
name = "my-game"
entry = "main.ling"
icon = "images/logo.svg"
```
3. the bundled Ling logo (default) if neither is given.
Sources may be `.svg` (rendered via resvg), `.png`/`.jpg`/`.bmp` (resized), or a ready-made `.ico` (used as-is); all are packed into a multi-resolution `.ico` (16-256px).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] What happens if I reference an icon file in Ling.toml that doesn't exist?

[Assistant] Per `ling/docs/BUILD_PACKAGING.md`: a missing explicit icon warns and falls back to the default bundled Ling logo — the build still succeeds, it just doesn't use your custom icon.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I bundle extra asset files (music, fonts, level data) with a ling-lang build?

[Assistant]
Declare them under `[includes]` in `Ling.toml`, relative to the project root, with glob support (`*` within a segment, `**` across segments, `?` for one char):
```toml
# Ling.toml
[includes]
"/music/*.wav",
"/font/*.otf",
"/levels/**/*.json",
"somefile.bin"
```
The leading `/` ("from the project root") is optional; an inline array form or the Chinese header `[包含]` also work (per `ling/docs/BUILD_PACKAGING.md`).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] By default, where do a ling build's included asset files end up, relative to the exe?

[Assistant]
By default matched `[includes]` files are copied into `dist/<platform>/`, preserving their folder structure, e.g.:
```
dist/windows/
├── my-game.exe
├── music/song.wav
├── font/title.otf
└── somefile.bin
```
The app loads them by their normal relative paths (per `ling/docs/BUILD_PACKAGING.md`).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I produce a single self-contained .exe with all my assets embedded, instead of an exe plus a folder of files?

[Assistant]
Add `--pack` to `ling build`, e.g.:
`ling build my-game --platform win --pack`
The included files are embedded inside the executable (`include_bytes!`); at startup the app transparently extracts them to a per-app temp directory and switches its working directory there, so existing asset loaders (`read_file`, `font_load`, `music_load`, `audio_sample_load`, ...) work unchanged — no code changes required (per `ling/docs/BUILD_PACKAGING.md`). Use this when you want to ship just one file.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] When should I use the default ling build output versus --pack?

[Assistant]
Per the mode table in `ling/docs/BUILD_PACKAGING.md`:
- default (exe + resource folders in `dist/<platform>/`) — use when assets may be patched or modded separately.
- `--pack` (one self-contained exe) — use for simplest distribution, a single file.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I log in to the Ling package registry so I can publish a package with lingfu?

[Assistant]
`lingfu login <api-key>` — the API key is created in the registry's web dev portal at `/me/keys`. If you omit the argument, it reads the key from stdin instead (per `ling/crates/ling-fu/src/registry.rs`).
Example: `lingfu login lfk_xxxxxxxxxxxxxxxx`


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I publish my ling-lang project to the registry, and can I override its version at publish time?

[Assistant]
Run `lingfu publish` from inside the project (it walks up to find `Ling.toml`/`灵符.toml`). It builds a tarball of the current project and uploads it, authenticated with the API key saved by `lingfu login`. To publish under a different version than the manifest declares, pass `--version`:
`lingfu publish --version 1.2.3`
(per `ling/crates/ling-fu/src/registry.rs`). You must be logged in first, or you'll get "not logged in — run `lingfu login <api-key>` first".


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] What is a ling.ignore file, and how is its glob syntax structured?

[Assistant]
`ling.ignore` lists files kept OUT of published packages (and out of anything `lingfu` walks across the whole project) — one glob per line, `#` starts a comment. Per the header comment repeated in both `fu.ling-lang.org/ling.ignore` and `ai.ling-lang.org/ling.ignore`:
`*.db` matches at any depth, `storage/` matches a whole directory, and `**` spans path segments. It's gitignore-style but consumed by `lingfu`, not by git.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] My ling-lang project uses a SQLite database file — how do I make sure it never gets published as part of my package?

[Assistant]
Add its patterns to `ling.ignore`. Both `fu.ling-lang.org/ling.ignore` and `ai.ling-lang.org/ling.ignore` exclude the runtime database the same way:
```
*.db
*.db-wal
*.db-shm
```
This covers the main SQLite file plus its write-ahead-log and shared-memory sidecar files.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I keep secrets and credentials out of a published ling-lang package?

[Assistant]
List them in `ling.ignore`. Real examples from this ecosystem:
`fu.ling-lang.org/ling.ignore`: `*.key`, `*.pem`, `.env`, `credentials.toml`, `*.totp`
`ai.ling-lang.org/ling.ignore`: `.env`, `secrets.toml`, `*.key`, `*.pem`
Both are commented "Secrets / credentials that must never end up in a package" — treat any key/cert/env/credentials file the same way in your own project.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I exclude a whole directory of large model weights from a ling-lang package?

[Assistant]
Give the directory name with a trailing slash in `ling.ignore` — per `ai.ling-lang.org/ling.ignore`:
`weights/`
commented "Model weights — huge binary artifacts, fetched separately". This matches the whole directory, same pattern used for `fu.ling-lang.org/ling.ignore`'s `storage/` (server-side package storage: uploaded artifacts, checksums, and backups).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Does ling.ignore support matching files nested arbitrarily deep, like compiled Python bytecode leftovers?

[Assistant]
Yes, with `**`. `fu.ling-lang.org/ling.ignore` uses exactly this to catch any-depth `.pyc` files:
`**/*.pyc`
alongside `.venv/` and `__pycache__/` for local Python tooling noise that shouldn't ship in a Ling package.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] What OS/editor noise files should I put in ling.ignore, based on how this ecosystem's real projects do it?

[Assistant]
Both `fu.ling-lang.org/ling.ignore` and `ai.ling-lang.org/ling.ignore` exclude the same trio under a "Local dev + OS noise" section:
```
.DS_Store
Thumbs.db
*.lnk
```
(`*.lnk` specifically because these are Windows launcher shortcuts — machine-specific, not part of the package.)


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] I'm building ling from source and want native code generation via LLVM — what cargo flag do I need?

[Assistant]
Build with the `llvm` feature:
`cargo build --release --features llvm`
Per `ling/Cargo.toml`'s `[features]` section: `llvm = []`, commented "Enable LLVM-backed native codegen (requires LLVM toolchain)" — you need the LLVM toolchain installed for this to build.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I build ling with GPU-accelerated rasterization support?

[Assistant]
Build with the `gpu` feature:
`cargo build --release --features gpu`
Per `ling/Cargo.toml`: `gpu = ["dep:wgpu", "dep:pollster"]`, commented "Native GPU rasteriser (wgpu offscreen). Opt-in foundation for GPU drawing; the default build is unaffected."


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I enable CUDA-accelerated compute (N-body simulation, batch vertex projection) in a ling build?

[Assistant]
Build with the `cuda` feature:
`cargo build --release --features cuda`
Per `ling/Cargo.toml`: `cuda = ["ling-gpu/cuda", "ling-physics/cuda", "ling-ai/cuda"]`, commented "Enable the CUDA compute backend (ling-gpu): GPU-accelerated N-body and batch vertex projection across every NVIDIA device (multi-GPU). Runtime-detected — falls back to the parallel CPU backend when no CUDA device is present."


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I build a ling.exe that can run in-process LLM chat completion (the kind chat.ling-lang.org uses)?

[Assistant]
Build with the `llm` feature:
`cargo build --release --features llm`
Per `ling/Cargo.toml`: `llm = ["ling-ai/llm"]`, commented that this brings in the `llm_load`/`llm_generate_start`/`poll` builtins — candle-transformers loads a GGUF checkpoint and runs generation on a background thread so it never blocks `http_serve`'s single-threaded dispatch loop. It's off by default because it pulls in candle-core/candle-nn/candle-transformers/tokenizers, irrelevant to builds that don't need local LLM inference. Pair with `cuda` for GPU acceleration, or see the next question for the combined flag.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Is there a single cargo feature for GPU-accelerated local LLM inference in ling, or do I combine two flags?

[Assistant]
There's a dedicated combined feature: `llm-cuda`. Per `ling/Cargo.toml`: `llm-cuda = ["ling-ai/llm-cuda"]`, commented "See ling-ai's Cargo.toml for why this is separate from `cuda` above." Build with:
`cargo build --release --features llm-cuda`


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I build ling with its HTTP server builtins (http_route/http_serve) enabled?

[Assistant]
Build with the `web` feature:
`cargo build --release --features web`
Per `ling/Cargo.toml`: `web = ["dep:ling-http", "dep:tower-http", "dep:reqwest", "dep:zip", "dep:hmac", "dep:sha1", "dep:tar"]` — this pulls in axum/rustls/rusqlite via `ling-http`, `tower-http`'s ServeDir (backs `http_static`), `reqwest` (backs `http_post_async`/`http_job_poll` for non-blocking outbound calls), `zip` (backs `zip_files`), and `hmac`/`sha1` (TOTP 2FA builtins).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] Why isn't the `web` feature enabled by default in ling's Cargo.toml, given how many projects in this ecosystem are web servers?

[Assistant] Per the comment directly above the `web` feature in `ling/Cargo.toml`: "the compiler/game/graphics build shouldn't carry a web server stack unless a program actually uses it." Keeping it opt-in keeps `cargo build` for non-web ling programs (games, graphics, the compiler itself) free of axum/rustls/rusqlite/reqwest/zip weight.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] I've been editing several .ling controller files — how do I see what changed before committing?

[Assistant] Same as any git-tracked project: `git status` to see which files changed, then `git diff` to see the actual line-by-line changes, e.g. `git diff controllers/chat.ling` to review just one file's edits before staging.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I commit my ling-lang changes to git with a clear message?

[Assistant]
Stage the specific files you changed (not everything blindly) and commit, e.g.:
`git add controllers/chat.ling app.ling`
`git commit -m "Add conversation title truncation to chat sidebar"`
Prefer naming the actual `.ling` files changed over `git add -A`, especially in a project like this one that also has a local SQLite `.db` file and a `bin/ling.exe` binary sitting in the working tree that you don't want accidentally staged.


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I start tracking a new ling-lang project in git for the first time?

[Assistant]
`git init` in the project root, then stage and commit the source files:
`git init`
`git add Ling.toml main.ling app.ling controllers/ static/`
`git commit -m "Initial commit"`
Note this is separate from `ling.ignore` — git needs its own `.gitignore` (project's `.env`, `*.db`, `bin/`, `weights/`, etc. should typically be excluded from git too, not just from `lingfu publish`).


[System] You are a coding assistant for the Ling programming language and its development workflow.

[User] How do I create a branch to work on a new feature in a ling-lang project and push it?

[Assistant]
`git checkout -b add-language-toggle`
... make your `.ling` edits ...
`git add controllers/home.ling`
`git commit -m "Add language toggle to nav"`
`git push -u origin add-language-toggle`
This works the same as any other git-tracked codebase — ling-lang source files are just text files as far as git is concerned.