43 ms·
It would be better to use Rust+Servo (no JS, or at least optional) IMO
by silon42 5y ago
It would be better to use Rust+Servo (no JS, or at least optional) IMO
- simion314 5y ago>(no JS, or at least optional) IMO reply At this point why not focus on some actual GUI toolokit, like write a Qt clone in Rust, for real world apps we don't need all the CSS and HTML crap, you need simple layout, GUI components and an option WebView you can embed in the app if needed. Probably there is no commercial interest to pay professional developers with real experience to implement this.
- sanxiyn 5y agoPeople are doing that too. https://sixtyfps.io/ https://sixtyfps.io/ is basically a Qt clone in Rust, actually developed by previous Qt developers.
- detaro 5y agoI don't think "basically a Qt clone" is a fair framing, in both directions. (sixtyfps aims to cover things Qt doesn't, Qt does things sixtyfps doesn't and won't for a long time if at all)
- seumars 5y agoI believe the interest is there, it's just not as easy as it seems: https://raphlinus.github.io/rust/druid/2020/09/28/rust-2021.html https://raphlinus.github.io/rust/druid/2020/09/28/rust-2021....
- jackosdev 5y agoegui is a really fantastic Rust GUI toolkit, best I've used in any language
- MathCodeLove 5y agoHTML and CSS, while not perfect, are still the best tools I've found to create a pleasant UI. Other libraries like Qt do work, but it's more difficult to get things looking exactly how you want them to look.
- lillecarl 5y agoThis is obviously a different camps kind of thing, but I don't think you're supposed to make everything look exactly pixel perfect to how you want it, you're supposed to follow the look and feel of the OS with native controls and such. I understand both, I don't agree with either more than the other.
- kaba0 5y agoIt is definitely slightly subjective, but come on. God damn winforms were more productive than HTML+CSS hooks you have to go through. In sane frameworks you have proper layouting (not some third party css library with ton of boilerplate to do something like vbox/hbox) and easy customizability through inheritance (eg. try to create a datepicker in HTML.)
- com2kid 5y agoHell even Swing had good layouts decades before CSS caught up with things. WPF has amazing layouts. CSS is irritating as hell. Even modern CSS, justify-content, justify-items, seriously? Flex has so many weird edge cases it is overwhelming. I have used flex type systems in other frameworks that worked 10x better, while Flexbox is way better than what existed before on the web, it is still and endless source of frustration. And yes, Winforms is 100x more productive than HTML. Awhile back I designed a fully functioning UI in Winforms to get an idea what I wanted my website to look like. I hadn't used Winforms in years. Took me less than a day to get a UI up and running with data binding to my backend and all the features implemented. TWO MONTHS of web dev later I had the same thing working in a browser. Now the browser was styled, and responsive, sure. But 2 months vs 6 hours. The loss of productivity there is insane.
- simion314 5y agoCSS has too much old crap, how many ways you can center a thing? How many ways you can horizontal align some stuff? There should be only 1 way and that way should not have hacks like use negative margins. What a Qt or other similar frameworks gives you is consistency, all components in all apps will look and work the same (with the exception of customized ones). This means you can focus on UX and not on bad design. My experience is that some bad designer will force his opinion on the users, will force his preferred fonts, font sizes and font colors on the users(making text hard to read), will disabgle text selection for some weird reason, will fuck with the scrollbars because the native ones are ugly etc. For a working app that is not a music player you don't need the "power" of css, say you seen video games have a small Launcher/config window that hase buttons,drop downs, checkboxes , I noticed those use Qt or Windows Forms. I am also noticing that modding tools , open source tools (that are not GNOME) also focus on functionality and you will not see buttons with round corners, fancy fonts and animated borders. IMO Electron advantage is not his the "powerfull"css and html and it is that you can reuse the existing node ecosystem and existing web developers and the alternatives are also lacking for higher level languages (GTK is shit IMO)
- austincheney 5y agoI have written a full OS like GUI in JS proving that it can be tiny and memory efficient. The GUI part of the application is about 2k loc across two JS files plus CSS and includes full file system display and navigation. It’s all vanilla JS and static DOM methods so it’s as fast and memory efficient as the browser allows. It’s amazing how fast the browser can be for this (and tiny) when you aren’t using querySelectors, vDOM, or event listeners.
- oceankid 5y agoCurious, what do you write that is 'OS like GUI' that doesn't require querySelectors, DOM and event handlers? How do you handle the nuances of GUI and input handling?
- austincheney 5y agoContent is dynamically generated in response to user interactions. For example a user clicks a button to navigate to a parent directory the new directory contents are fetched and populated into DOM artifacts using a function which recognizes the returned object as a microservice instance. Instead of querySelectors I use things like getElementById, getElementsByClassName, getElementsByTagName, and some custom DOM navigation utilities I wrote for this application like getAncestor, getModalsByModalType, getNodesByNodeType, and so forth. You don't need any kind of framework or fancy wiring to work with events. You always know what you are working with from within the event handler, because event handlers receive an implicit event object as their first argument. From that there is event.target which returns the element the handler is assigned to or event.currentTarget which returns the element the user interacted with that fired the event after bubbling. State management is also just as easy.
- duped 5y agoBecause layout, rendering, and accessibility are not easy problems to solve and already handled by browser engines that come with your OS. It's more work to reinvent those wheels than bind to them.
- Blahah 5y agoTauri allows you to build apps that are pure rust - the js is optional and has multiple configurable integration models called 'patterns' that allow defining and constraining the engines includsd, the interfaces between them, and the tradeoff between binary size and distribution simplicity/robustness. https://tauri.studio/en/docs/usage/patterns/about-patterns https://tauri.studio/en/docs/usage/patterns/about-patterns