Commit Graph
21 Commits
Author SHA1 Message Date
waozi e2629fae38 Declare the inspector host in its props header
Move the eighteen inspector calls, including PushInspectTransform's Camera2D
(which kryon_compat already supplies), into runtime/inspect_props.kry as
"#extern #export" declarations, so the tracked props header carries the public
ABI and include/ui_inspect.h is deleted. k2c and k2cpp now emit
"#include "ui_inspect_props.generated.h"" for instrumented modules instead of
the handwritten header, and the syntax tests assert the new include.

widget-instance-test fails identically before this change and stays outside
the standard gates.

Gates: generated-runtime-parity-test, fast-test, k2c/k2cpp/k2go-syntax-test,
go-runtime-test, examples-syntax-test, and the refreshed public-API snapshot
pass.
2026-09-21 01:07:38 -03:00
waozi 0a65540031 Migrate retained UI to .kry and fix the native C boundary
Move app shell, frame, locale, node, screen routes, theme state, and window
policy ownership into src/ui/*.kry, delete the replaced src/core owners, and
make generated public ABI the type source for capability and retained-node
records.

- runtime/capability_props.kry and runtime/node_props.kry generate the public
  capability and node type headers; handwritten headers keep only the C-only
  declarations (function-pointer typedefs, unions, host functions).
- k2c/k2cpp: terminate a same-line case body and map fixed-width casts
  (i32/i64/u8/f32/...) to their C types.
- locale.c matches the generated LocaleParseEntries argument order;
  locale_policy.kry keeps its return type on the signature line.
- ui_window.c renames the X11 dlopen shim symbols off the downstream app prefix.
- Refresh the canonical surface doc, public API snapshot, and test gates.

Verified: runtime parity (C+Go), k2c/k2cpp/k2go syntax, go runtime,
public-api-names, canonical-surface, kryon-boundary, public-api-snapshot,
laws, fast-test, smart-test.
2026-09-20 22:45:56 -03:00
waozi 4b7c4e84f0 Release v0.2.0: Kry UI runtime authored in .kry
Widget, layout, interaction, style, and UI-tree logic is now authored in
the Kry (.kry) UI language and compiled into the native C and Go runtimes,
replacing the hand-written C widget implementation. The remaining C is
platform and raster backends (X11 window, font rasterization, paint command
execution, surface/image caches, test helpers).

- Clipboard OSC52/paste callbacks are host-provided write functions instead
  of raw function-pointer typedefs, unblocking Go runtime generation.
- AccessibilityNode and Accelerator types are generated from .kry.
- Generated-runtime parity test passes for both C and Go.
2026-09-20 19:36:28 -03:00
waozi b97812e34e Add borrowed slice checkpoint, starter Bend laws and phased law plan 2026-09-19 15:59:49 -03:00
waozi aa07f3f4f8 Implement portable fixed-array function arguments and results
Use shared C/C++ input copies and caller-owned result buffers with equivalent Go value semantics. Normalize imported signatures and reject incomplete returns or unchecked ABI callers. Array, aggregate, record and string execution fixtures pass across all three targets; C/C++ syntax checks pass. Combined runtime generation and latest Go integration remain blocked by concurrent slider source/generated-host changes, recorded in the plan.
2026-09-19 14:50:32 -03:00
waozi 69f162fd7b Include array bounds support in standalone generated modules 2026-09-15 18:24:37 -03:00
waozi 781d7b704b Harden the Kry frontend against injection and silent truncation
- Escape source paths interpolated into generated C/C++ string literals
  (PushInspectSource) and validate #import/#style targets at parse time so
  crafted paths cannot escape emitted #include lines.
- Reject source lines exceeding the frontend line buffer with a located
  error instead of silently splitting them; mark truncated lexer tokens and
  fail the expression parser on them.
- Fail lowering when statement rewriting or name-shadow lists overflow
  their fixed buffers; both previously changed generated-code meaning
  silently.
- Strict checking no longer explodes on C interop: unresolved calls,
  statements, and address-of in modules importing C headers are left to the
  C compiler, and runtime enum members resolve through the embedded runtime
  declarations exactly as the emitter resolves them.
- C/C++ indexing of fixed arrays and string bytes lowers through
  KRYON_INDEX; builds defining KRYON_BOUNDS_CHECK trap out-of-range indexes
  with a diagnostic, release builds stay raw.
- Emit ui_tree.h and host-hook prototypes only when a module actually uses
  block widgets, so scalar-only modules no longer require widget types.
- Mark raw-c statements in generated output with a provenance comment and
  document the .kry trust model in the language spec.
- Add spec fixtures for over-long lines and invalid #import targets; teach
  the language harness about the ui_tree.h header.
2026-09-15 16:09:04 -03:00
waozi 502013dd0a Canonicalize Kryon widget surface 2026-09-12 10:38:55 -03:00
waozi 0f3dd1238d Compile captured child-content bodies through shared KIR 2026-09-10 01:11:23 -03:00
waozi 3b1a3f1e08 Bind Kry function values to typed child-content slots 2026-09-10 00:27:57 -03:00
waozi 80b632259e Represent typed child-content parameters in shared KIR 2026-09-10 00:19:04 -03:00
waozi 678e9777e0 Share numeric support across generated runtime Go modules 2026-09-09 23:51:44 -03:00
waozi 773e7604c1 Bind generated widget host services to their owning runtime 2026-09-09 22:06:47 -03:00
waozi 0c64f21dac Declare host drawing records in Kry and generate native Go types 2026-09-09 21:37:44 -03:00
waozi 5f45819519 Generate public Button props from their Kry declaration 2026-09-09 20:53:35 -03:00
waozi ab3bca6b59 Generate retained widget state bindings across native and web hosts 2026-09-09 20:45:13 -03:00
waozi a0852111e2 Define shared Kryon widget styling and Magnetic Lightfield defaults 2026-09-09 18:14:42 -03:00
waozi ec6a4dcbae Make Kry constants available to generated interfaces 2026-09-08 11:15:42 -03:00
waozi 79b57569c9 Emit portable scalar operations from shared KIR and remove cgo 2026-09-05 10:33:14 -03:00
waozi 0410787ee5 Drop --plan9 from k2cpp
Plan 9's native compilers are C compilers; the C++ backend never feeds
them, so the ported 8c rewrite pass was dead code. k2cpp now takes only
--no-main, --root, and -o.
2026-09-03 13:54:27 -03:00
waozi b24fde792f Add k2cpp backend with full k2c parity
.kry -> C++ compiler sharing the Kir frontend with k2c. Emits .cpp/.hpp
per module calling the C Kryon runtime through extern "C" declarations,
plus kryon_project.h/.c (still plain C) and the --plan9 and --include-dir
options ported from k2c. Inferred declarations emit 'auto' instead of
__auto_type so g++ accepts the output. Wired into the Makefile, tools
package, conformance matrix, feature matrix, and a k2cpp syntax test.
2026-09-03 13:39:37 -03:00