Re:A simple UI framework for Rust
by halosghost on Tuesday May 19, 2015 @09:34AM
(#9569889)
Cool, I didn't know about IUP at all! Rust has burned me a bit lately (muh 128-bit arithmetic, no!), but I still have a fair bit of nostalgia for Lua; I have a sneaking suspicion I will look to IUP for some of my planned projects. At the very least, cool project and I learned about another cool thing!
Re:A simple UI framework for Rust
by fit2rule on Tuesday May 19, 2015 @07:50AM
(#9569336)
Can anyone explain what IUP is and why its needed for this toolkit? Because it seems to me that a UI framework shouldn't come with a dependency on system-specific binaries, but that's just because I don't understand what it is, probably.
Re:A simple UI framework for Rust
by sanderjd on Tuesday May 19, 2015 @11:41AM
(#9570925)
All the other comments are right, and in Rust this is referred to as "the builder pattern", and is used quite commonly. Here's a guidelines link[0] describing it in more detail.
Re:A simple UI framework for Rust
by steveklabnik on Tuesday May 19, 2015 @04:53PM
(#9573062)
It's at least partially our fault. (And basically entirely so, really :) ) Gotta get on that rel=canonical at least. Old search results are a big problem :/
Re:A simple UI framework for Rust
by sp332 on Tuesday May 19, 2015 @11:14AM
(#9570695)
To expand a bit: Sometimes, instead of thinking about nouns all the time, you want to think about verbs. Instead of saying "mutate this noun by applying verb1" and then "mutate this noun by applying verb2" etc, you are creating a new verb. The new verb is "verb1 then verb2 then...." And then when you have the verb defined, you apply it to your object.
Re:A simple UI framework for Rust
by Jweb_Guru on Tuesday May 19, 2015 @12:02PM
(#9571094)
I feel APIs like that are a bit misleading in Rust in many cases, though, since they're also mutating the original. In Rust, if you want to perform a functional update like that you should take the type by move, but almost everyone just uses mutating APIs because mutation is explicit in the signature anyway. I think that's one of the biggest differences in practice between Rust and other MLs (with which it otherwise has a lot in common): in most MLs, mutation is treated as a last resort, while in Rust it's extremely common because it (generally) doesn't have nonlocal effects.
Re:A simple UI framework for Rust
by amelius on Tuesday May 19, 2015 @09:26AM
(#9569821)
Does that matter? I bet the core Servo libraries don't even deal with networking. And using Servo has obvious advantages such as a being a good render engine supporting incremental updates, probably being well-documented, well-tested, and conforming to well-known standards (yes, also used on the web, but does that matter really?)
Re:A simple UI framework for Rust
by phn on Tuesday May 19, 2015 @10:50AM
(#9570433)
Honestly, it matters. Current web technologies aren't the end game solution for interfaces and, IMO, are pretty horrible to work with for that purpose. (Pretty beaten up topic by now, but lets take a moment to think for a second about vertical centering in HTML+CSS. /sigh </rant>)
Still, my answer was just referring to the fact that this is not using web tech, and thus, not using servo or any other existing browser engine.
These are for the widget toolkit this project is based on, rather than from the project proper, but it's better than nothing I guess.
Anyone seen any projects like this for rust?
[0]: https://aturon.github.io/ownership/builders.html
Note that _those_ guidelines are outdated, superseded by https://github.com/rust-lang/rust/tree/master/src/doc/style and http://doc.rust-lang.org/style/
Note that we haven't linked to those publicly all that much yet, as there's so much TODO in them still.
Ahh, Rust. :)
There's a part in the book about the builder pattern: http://doc.rust-lang.org/stable/book/method-syntax.html#buil...
dialog.set_title("blah");
dialog.set_size_piels(100, 100);
on two lines?
Still, my answer was just referring to the fact that this is not using web tech, and thus, not using servo or any other existing browser engine.