Posted by mik3y 1 day ago
The double-edged sword of choice!
[0]: https://rune.build/
Various other toolkits have tried this approach, but unfortunately, I'm not aware of any others that succeed. Common deficiencies include keyboard navigation and text rendering.
*(Except on Qt-based desktops like KDE Plasma, of course.)
I like your definition quite a bit, but I need another word for, "code that doesn't need a runtime to execute."
I ended up using "experience layer" to describe the SDK components.
If you define it as "using the widgets provided by the operating system", then "native" is by definition incompatible with "cross-platform." And what does that mean on Linux, where the operating system doesn't provide widgets? Are gtk and Qt not native?
When discussing GUI toolkits, "native" should be understood to mean "native to the host's graphical environment".
"Native to the OS" might or might not be equivalent, depending on the OS and what one considers "OS" to mean. (Does it mean a kernel? A desktop distro? Something else?) Because of this ambiguity, it's not a very practical way to approach the discussion. Different people attach different meanings to that phrase.
Some frameworks are native to Qt. Others are native to Gtk. Practically none are native to Linux. ;)
I don't think "cross-platform" is incompatible with "native". It has been achieved more than once using toolkit wrappers, usually selected at build time.
But this syntax – egads man! It literally hurts my brain trying to parse it:
fn view(s: &State, _: &mut Cx<State>) -> El {
let t = tok::theme(true);
let label = text(if s.on { "Lights on" } else { "Lights off" })
.font(type_::TITLE).color(t.text);
let knob = el().key("knob").size(18.0, 18.0).radius(9.0).fill(t.knob)
.absolute(if s.on { 18.0 } else { 2.0 }, 2.0);
let switch = el().key("switch").role("switch").label("Lights").checked(s.on)
.focusable(true).size(38.0, 22.0).radius(11.0)
.fill(if s.on { tok::accent(0, true) } else { t.control_off })
.motion(motion::SNAPPY)
.on_press(|s: &mut State| s.on = !s.on)
.child(knob);
col().w_full().h_full().center().gap(16.0).fill(t.bg).child(label).child(switch)
}
Maybe I'm getting too old but I'd prefer good old Perl 5 linenoise.e.g. https://github.com/anomalyco/rune/tree/dev/crates/rune-kit/t...
And no live examples...