Commit Graph
17 Commits
Author SHA1 Message Date
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