Live data from Hacker News

Conrod – A Rust GUI Library

blog.piston.rs

41–50 of 76 posts

Re: Conrod – A Rust GUI Library

#41
post #27

Isn't using immediate mode going to make implementing more complex widgets like multi-line text-edits with selection and style, and more importantly tree controls with collapsed/expanded persistent state that lazily load children (or only display items that are visible in the active view area) more difficult?

Yes.

For a good GUI library, you ideally want the layout to be data driven. This means you can draw the entire tree without writing a line of code; this also implies "retained mode" (the opposite of immediate mode).

If it's not data driven, you can't write an editor for it -- or if you do, you end up with something that can write code but that has a hard time re-reading code that you've modified.

Ideally there's more inherited and inferred information, and less parameter noise. A crucial feature of any modern GUI library is the ability to auto-position all the elements, for instance: The placement by "pixel" location is an outdated practice in an age of multiple screen resolutions, aspect ratios, and densities. And getting the layout part right is much harder than getting a few widgets up.

Sorry, but as a GUI library this is not impressing me.

Re: Conrod – A Rust GUI Library

#42
post #4

Last time I checked this was the main thing that was missing for Go (a complete, multi platform GUI lib). Has there anything like this arisen yet? Some quick googling points to Gothic, which sounds promising.

This looked promising the last time I looked at it: https://github.com/andlabs/ui

Interesting, thanks

Re: Conrod – A Rust GUI Library

#43
post #27

Isn't using immediate mode going to make implementing more complex widgets like multi-line text-edits with selection and style, and more importantly tree controls with collapsed/expanded persistent state that lazily load children (or only display items that are visible in the active view area) more difficult?

I was wary of this when we had first started the project. Originally I had planned to just go ahead and start a classic retained UI - the idea of trying to structure a widget lib without widget structs/classes sounded incredibly painful... however after watching some vids and actually having a go myself I'm realising just how wrong I was.

A handy breakthrough in my case was to use Rust's algebraic data type to store each individual widget state within a single container in the UIContext. This is akin to "caching" the state of every widget in one place with a process that is invisible to the user, rather than requiring the user to instantiate large number of objects and work out where they will store widgets, canvases, etc. This approach also makes it really simple to only access certain parts of the state depending on what is needed via Rust's pattern matching and destructuring. I'm yet to come across any kind of widget that is more difficult to store state for than it is in a retained UI (it's even easier for the user of the lib as they don't have to think about it) though perhaps I'm naive in my early days!

All of the widget examples that you have given are already in the plans, I might as well just implement them and do another Show HN instead of rambling in the comments :)

Re: Conrod – A Rust GUI Library

#44
post #30

I have mixed feelings about this. On one hand, I'm enthused that Rust, arguably the only serious contender to C++'s throne, is gaining traction. On the other hand, I'm scared that respectable projects like Qt (~6M lines of C++, man-millenia of work!) will be considered "obsolete" by the coming generation and another cyle of wheel reinvention will begin, tossing away man-centuries worth of polished, working code on th…

>Rust, arguably the only serious contender to C++'s throne

Does anyone consider Ada another contender to C++? Statically strongly typed, safe manual memory management, wide-spectrum, hard real-time & embedded capable.

Re: Conrod – A Rust GUI Library

#45
Does anyone has the same thought with me? The complexity of Rust is close to C++ and around equal to Java.And as many people's tought, if you don't advocate to use the GC, are there any reason to use a language which is no-simple and not faster than C++????

Re: Conrod – A Rust GUI Library

#46
post #30

I have mixed feelings about this. On one hand, I'm enthused that Rust, arguably the only serious contender to C++'s throne, is gaining traction. On the other hand, I'm scared that respectable projects like Qt (~6M lines of C++, man-millenia of work!) will be considered "obsolete" by the coming generation and another cyle of wheel reinvention will begin, tossing away man-centuries worth of polished, working code on th…

"Respectable"? "Man-centuries worth?" Of course I'm used to hearing crazy things on the internet, but you just totally blew my mind right now. You know, man-centuries were spent to build and "polish" such glorious (and surely working!), once respectable pieces of technology like threshing machine or steam engine, yet I somehow don't feel I miss them much. Seriously, it's just ridiculous.

No, what worries me much more is the fact that there is no antialiasing on the "Envelope" in demo video.

Besides, probably it will surprise or even scare you, but Qt isn't the only, the first or the last GUI framework, there're many more, and new are created all the time. …And not even single actually good one invented still, but that's another topic. So there isn't any reason to think of that Conrod thing as something more than "just another one GUI framework". At least, until it would turn out to be somehow superior to ones that already exist. And if it will turn out to be superior to, say, Qt, then Qt should go to trash and I couldn't care less about all that "man-centuries" of yours. But, realistically, it's unlikely to happen, so everything we could hope for is some less complicated, useful for just some subset of GUIs micro-framework. In fact, it would be already very nice by itself, since it would spare Windows-developers of the pleasure of 30Mb cross-platform "Hello worlds" using Qt.

Re: Conrod – A Rust GUI Library

#47

Does anyone has the same thought with me? The complexity of Rust is close to C++ and around equal to Java.And as many people's tought, if you don't advocate to use the GC, are there any reason to use a language which is no-simple and not faster than C++????

I think you're asking why you'd want to use Rust over C++?

First, to establish what we're not losing by using Rust:

* It can be as fast as C++ (in essentially all cases--all but compile-time metaprogramming related situations, after some in-the-works reforms are implemented).

* It can be as deterministic as C++ (usable in hard realtime systems).

* It has great FFI-level C compatibility.

Advantages over C++:

* It is substantially safer than C++. Outside of unsafe blocks, it is memory-safe and many other forms of undefined behavior are absent, including data races (unlike not only C++, but Java, Go, and most other mainstream languages that support multithreading).

* In a number of cases, it could potentially be faster than C++ by utilizing Rust's much stricter aliasing semantics.

* It should be able to compile much faster than C++, and it can infer much more thanks to its type system.

The above are things that I don't think can be shoehorned into C++ backwards-compatibly. I'm not including features like ADTs because I see no reason C++ couldn't have them.

There are plenty of reasons not to choose Rust over C++, including language immaturity, implementation immaturity, library immaturity, ecosystem immaturity, and lack of familiarity. But language feature for language feature, it offers substantial benefits.

Re: Conrod – A Rust GUI Library

#48

Does anyone has the same thought with me? The complexity of Rust is close to C++ and around equal to Java.And as many people's tought, if you don't advocate to use the GC, are there any reason to use a language which is no-simple and not faster than C++????

Linear types!

Re: Conrod – A Rust GUI Library

#49
post #30

I have mixed feelings about this. On one hand, I'm enthused that Rust, arguably the only serious contender to C++'s throne, is gaining traction. On the other hand, I'm scared that respectable projects like Qt (~6M lines of C++, man-millenia of work!) will be considered "obsolete" by the coming generation and another cyle of wheel reinvention will begin, tossing away man-centuries worth of polished, working code on th…

>Rust, arguably the only serious contender to C++'s throne Does anyone consider Ada another contender to C++? Statically strongly typed, safe manual memory management, wide-spectrum, hard real-time & embedded capable.

Public opinion is a matter of very considerable importance in such questions, and Ada simply doesn’t have it there, while Rust does. So no, I would not consider Ada “a serious contender to C++’s throne”, regardless of technical comparisons with Rust and/or C++.

Re: Conrod – A Rust GUI Library

#50
post #4

Last time I checked this was the main thing that was missing for Go (a complete, multi platform GUI lib). Has there anything like this arisen yet? Some quick googling points to Gothic, which sounds promising.

Im working in a weird "application platform"(looks more like a crazy userspace OS) right now and as a step 2, im planning to bind to the chrome compositor in the low level.. and build a ui framework in Go from there.. but the phase 1 is really the most important, and i think i will pre-launch before the UI kit..

The good side of it, is that you can also bind a web rendering engine totally coded in Go or bind the webkit rendering to the compositor backend..

I hope i get there soon..

Post reply on HN