5 ms·
Writing GUI with rust is totally possible: http://gtk-rs.org/ http://gtk-rs.org/
by vhakulinen 9y ago
Writing GUI with rust is totally possible: http://gtk-rs.org/ http://gtk-rs.org/
- StavrosK 9y agoYes but "possible" and "pleasant" are very different :(
- pjmlp 9y agoIt is possible, but far from productive, which I learned exactly by trying to use Gtk-rs to port an old basic Gtkmm demo, that I used for a C/C++ Users Journal article.
- amelius 9y agoWasn't Rust invented to write a GUI? A webbrowser can be regarded as a kind of GUI.
- foldr 9y agoThere aren't any good GUI libraries available for Rust at the moment. GUI libraries are huge and take an enormous amount of work to get right. It's typically only the most popular three or four languages at any given point in time that have satisfactory GUI libraries. Rust has the additional burden that it is far from trivial to wrap Gtk, Qt or other C/C++ toolkits in a safe manner.
- amelius 9y agoDidn't Mozilla write a GUI library before they wrote Firefox? It would strike me as odd if they didn't.
- foldr 9y agoThere is no mature GUI library for Rust that I'm aware of. I believe the servo project is focused on writing a browser rendering engine, not a browser GUI. It certainly has not so far yielded a GUI toolkit that can be straightforwardly used in other projects.
- lima 9y agoRust was invented for low-level parsing/rendering code. The high level GUI in Firefox is not implemented in Rust for all I know.
- coldtea 9y agoNo, it was invented to write a generic (web) rendering engine. So, even if we consider a web app as a GUI, Rust wasn't invented for writing that (you still use CSS, HTML, JS etc for that part). It was invented for writing the backend for that UI. In other words, Rust is not GTK (a UI library), it's C (the language the UI library itself is written in).
- amelius 9y agoOk what is the GUI of Firefox written in/using?
- coldtea 9y agoUntil recently-ish something called XUL, a markup language for UI (similar to HTML, or even better XAML). Not sure if they've moved on since. https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL
- coldtea 9y agoYeah, but the parent point is that "possible" is a very low bar.
- v_lisivka 9y agogtk-rs needs a macro package to parse a HTML or a XML snippet and generate GUI, with embedded rust code in appropriate place. Look at Yew for example: https://users.rust-lang.org/t/yew-a-framework-for-client-side-web-apps/14597 https://users.rust-lang.org/t/yew-a-framework-for-client-sid... .