feat(lang): L11 views and templates - the UI is markup, not code

A `view Name { field = x; function q(..); on e(..) }` declaration is the one bridge between a
program and its UI: it writes view_<name>() -> UiView, whose model is a Value of every field and
whose call runs a query or an event by name.

ludic.ui is a template runtime:
- HTML-shaped XML screens and components, loaded at run time;
- {expression} bindings, if/else/each, props, slots, per-instance state;
- on-press / onclick actions (event, set, emit);
- component libraries (export="true", <import src as>).

Styling:
- stylesheets in <style> or importable .lss files (@import);
- CSS selectors (#id, .class, [attr=v], descendant and > combinators, :hover, :disabled,
  :first-child, :last-child, :nth-child, :not) weighed by specificity;
- the box model and flex under CSS's property names.

Also:
- default parameters, and positional-then-named calls;
- Value gains a float kind;
- a function shadowing a runtime one is refused;
- an index is evaluated before the slice is read;
- runtime errors name the right file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-24 15:58:47 +03:00
parent 334469ef61
commit 66a2bc2214
64 changed files with 74806 additions and 63975 deletions

View file

@ -0,0 +1,14 @@
---
id: value-as_float
name: Value.as_float
category: value
kind: namespace-method
tokens: Value.as_float
sig: Value.as_float(value) -> float
tip: Read a number node as a float.
order: 37
ns: Value
member: as_float
---
Returns the number any number node carries as a float: a <code>float</code> as it is, an <code>int</code> widened, a <code>fixed</code> converted from Q16.16. Other nodes return <code>0.0</code>.

View file

@ -11,4 +11,4 @@ ns: Value
member: as_int
---
Returns the raw scalar an int/fixed/bool node carries (a <code>fixed</code> comes back as its Q16.16 bits). Non-scalar nodes return <code>0</code>.
Returns the raw scalar an int/fixed/bool node carries, or a float node's whole part (a <code>fixed</code> comes back as its Q16.16 bits). Non-scalar nodes return <code>0</code>.

View file

@ -0,0 +1,14 @@
---
id: value-float
name: Value.float
category: value
kind: namespace-method
tokens: Value.float
sig: Value.float(x: float) -> value
tip: Wrap a float in a value node.
order: 36
ns: Value
member: float
---
Builds a <code>float</code> node (kind <code>7</code>) carrying <code>x</code>. Read it back with <a href="value-as_float"><code>Value.as_float</code></a>; <a href="value-as_int"><code>Value.as_int</code></a> gives its whole part. <code>Json.encode</code> writes it as a number.