you need to build a RUST desktop app!!
ฝัง
- เผยแพร่เมื่อ 1 ก.ค. 2024
- This year, build a desktop app or two to help you speed up your day-to-day tasks.
And there's a great solution for it found with Rust and the Slint UI.
In this video, I'll walk you through how to build a practical desktop app and bundle it as an App on your Macbook (or PC or Linux flavor).
Join me!
Timestamps
00:00 Intro / App Overview
01:12 Slint UI
02:32 Create project template
03:50 Slint and Career Advice
11:12 Adding the Logic in Rust
20:49 Bundling to a Mac app
22:20 Adding the animation
26:48 Outro
My Newly Launched Coding Community - imposterdevs.com
GitHub Repo - github.com/rodgtr1/profit-fir...
Updated Udemy deals - travis.media/udemy
** Career Path Coding Tracks **
Web Developer - geni.us/jBigBd
Software Engineer - geni.us/AbMxjrX
Machine Learning - geni.us/GporLlT
Python Developer - geni.us/tv2FJBU
DevOps Engineer - geni.us/MgHtJ
** My Coding Blueprints **
Learn to Code Web Developer Blueprint - geni.us/HoswN2
AWS/Python Blueprint - geni.us/yGlFaRe - FREE
Both FREE in the Travis Media Community - travis.media/community
My microphone - amzn.to/3sAwyrH
** I write regularly **
travis.media
** FREE EBOOKS **
📘 travis.media/ebooks
LET'S CONNECT!
📰 LinkedIn ➔ linkedin/in/travisdotmedia
🐦 Twitter ➔ / travisdotmedia
🙋🏼♂️ Website ➔ travis.media
#rustprogramming #slintui #desktopapplication #selftaughtdeveloper
** Some of the links in this description may be affiliate links that I may get a little cut of. Thank you. - วิทยาศาสตร์และเทคโนโลยี
I wanted to chime in for anyone that’s learning to code. This is EXACTLY how to learn. Finding a little project that you want to exist and that will drive you to actually finish.
Good video, I love that you still are playing around with little projects like this.
One of the best, tutorial i have ever seen , no taking ppl too much by the hand and still clear enough to be applicable ! Nice work getting some concise ! Thanks
Awesome tutorial! And thanks for letting me know about Slint. It seems to have everything I was looking for: native, easy UI syntax, many components, and that uses C++ and Rust.
I like that you explain things left and right and not just focus on the UI stuff
Fantastic video! 🚀 We're thrilled to see you enjoyed using Slint for your Rust UI tutorial. It's always awesome to witness creators like you exploring and appreciating our product. Thanks a bunch for taking the time to make this tutorial and sharing your experience.
How are things progressing with your original stated vision to make Slint “useable from any language?”
It’s 2024 now, and slint remains locked in to Rust. There are GitHub issues about having a usable C api that would enable this vision… but they are all getting rather stale now, and show little progress.
Same with the js version being locked into legacy runtimes only.
This makes the whole product only have niche appeal, with a high level of risk to build a product around.
Any plans to fix this anytime soon ?
Good to see there are finally ways to use Rust for desktop apps. I spent the end of '23 learning how to use GTK4, and that works pretty well, too.
This is a good introduction video. It shows everything I need to get started, setting up the project, setup the app and window(s), make the UI interactive with callbacks and properties...
This is the best video I’ve seen on Slint, great work! 🎉
Travis is such a friendly dad figure in CS TH-cam, glad to have someone be able to explain things without all the fluff and really convey the important details.
Do ya swallow?
Really good advice on focusing on concepts versus the specific tools. Great video that delivered on more than just a tutorial
Thanks, this was somehow so comforting and informative at the same time.
Great advice on being language agnostic! The focus on facilitating a programmatic mindset allows folks to move away from, ‘I can only do X because I only know Y language,’ to, ‘Ok, I need to do X. How do I do that in Y language?’ This has always been my approach to development, even when I didn’t fully understand what I was doing.
I can barely code in python...I'm not a developer at all. But because I understand programming concepts, I was able to coach GPT into writing a functional project in Go for me yesterday. I knew enough to troubleshoot, ask GPT the right questions, and let it worry about the syntax.
Awesome! Coming back to this video later.
Nice and all, but once you go futher with Slint, you will eventually hit this brick wall: "Royalty per device for Embedded". Sure, Slint offers a free tier, but it comes with a GPLv3 license for embedded. Meaning you need to release your sources(!). Other options are pay per device or pay a single huge fee (which apparently still depends on the number of embedded devices). You invest time in learning a new framework, invest time in making your application and then you want to release it... But now you're at a crosspoint: do you pay up, or switch and spend more time learning and implementing another framework? Your time is the most valuable asset, so there is a high chance of you paying up. This is a prime example of a vendor lock. And that's what these companies aim for. I'd try to avoid getting in that situation and do some investigative work before you start. This way you can avoid hitting that brick wall later.
Well this is only for embedded devices. With the community version you can build and ship desktop & web apps. I would say if you are targeting embedded devices, you most likely have a commercial target audience. And if not, its not a problem to go open source and align with GPLv3. I think the costs are okay-ish for enterprise applications. As other licensing costs may be way higher then the buyout price. In the end, theres a company behind slint, that also needs to pay their developers. And I think it is a fair deal. If you're making open source stuff, you can use the community license. If you want to make money with it, you have to pay.
And also, you should build your applications UI agnostic (as possible) so, that if you have to switch to another GUI framework you can without much hussle.
Limitations like these make this a no go. Framework dead in the water.
"...eventually"? What kind of developer are you? Before you use something you have to evaluate it - and yes, this includes checking the license beforehand. Which is probably one of the first things you want to do, before even writing a single line of code, even before installing it.
When you use something you either accept the licensing terms or not, what do you expect? That they create a framework for you for free on your terms? That's just silly and entitled.
Slint has a perfectly fair and balanced licensing scheme - they also need to pay their staff somehow.
This is really comprehensive. Thanks for the video. This made me proceed with Slint, ignoring the complaints about 'another language added'. Actually, the 'added language' made it all very easy.
I'm not going to take time to learn a library which is not free for any commercial use.
Excellent! Just enough information to follow along very productive. Keep these coming!
you are such a great teacher! I learned a lot from you. Thank you very much!
good advice on features concepts linking to documentation
Thank you for the video, it motivated me to start writing Redis GUI app and practice Rust for the first time since russia invaded my country. Coding in Rust is a kind of therapy
This is very easy to follow
Thank you sir 🙏
Amazing! thanks a lot Travis!
Truth be told. Rust makes me feel like a true programmer. Superb video with simple and detailed explanations. Slint is awesome and looks way better than top UIs
Ohhh a framework without silly web stuff and 3000 dependencies! I'll be giving that a try right away.
Did I miss something when he execute cargo build?
I'm quite sure there is web stuff in it... they're just hidden. But I may be wrong. It feels like it.
Such a helpful tutorial! I like how you teach so that we can learn from the documentation!
Hey there, thank you for this, this is how I learn best and you opened the way for me :)
Very nice! thanks Travis
Excellent video. Thank you.
Totally awesome! Thank you for putting this video together. This video triggered the my curiosity on Rust.
I had no idea Rust had gui bindings now! And at least from this Slint seems like a pretty nice api. Very CSS esque.
This video is DOPE! please more examples with RUST language.. Dude great content!!!
Very nice video. I've been exploring Rust and was looking for something to make a gui interface. I'm going to give Slint a whirl. Thank you so much.
This is giving me inspiration to converet a similar app i have (cli tool for splitting income) into rust lol. Great Vid Travis !
Awesome video. Thank you!!! I really like it.
Will code in this for sure. Nice UI with Rust
Nice. Have to add slint to my Rust toolchain.
Nice! Slint is awesome!
Indeed. I enjoyed it.
Very good advice embedded here.
This is awesome!! Thanks
Very interesting tutorial, nice and simple
Awesome very informative
Amazing Video, Thank you!
Very interesting, great video!
Great video. Personally I've had a hard time with the idea of the design of the GUI in separate config files. Reminds me of the old Android days with XML files to lay out the GUI. I have enjoyed frameworks like React that offer components and layout managers. I recall my days 20+ years ago with Swing and using TableLayout and loved that style of arranging components, sizes, auto fill, etc. I would love to see a GUI framework that can be used like that with Rust or Zig.. ideally Zig. Maybe Go.. I think Fyne in Go is pretty close and if you're not looking to build a super fast desktop app (e.g. like a DAW or similar real time or near real time needs) Go may be a great desktop language with Fyne (or similar). Still trying to figure out which way to go. Anything to replace Electron and web app for desktop though. That route sucks.
try egui, is a library to build uis but uses an immediate mode, meaning that the design and the logic are on the same (rust) code
This is absolutely fan-tas-tic!!!! I wonder if you can also build mobile apps with it, if so I would completely move from Flutter to this!!
slint looks awesome thanks! I am going to look into it. shame about all the BS around the licensing though and widgets are a bit basic to do anything mature.
Thanks Travis! 😀 @TravisMedia
I look forward to learn Rust this year! and this is going to be my first desktop app ever!
Great video and easy to understand even for noobs
Nice learning watching you do work
finally something interesting in rust programming😜
my favorit project I've done is just this type of project, The most important partis to make something you want to use yourself. I choose to use Tauri for my tool, which I can recommend as well. I used it to build a application that displayed my machines CPU temp, usage, ram usage, etc.
This was a good tutorial, I am also practicing more Rust this year and project like these are very good starting points for more complex apps. Thank you @Travis Media :)
@Slint-UI love your product and docs, keep up the good work!
One note - as Neovim user, we currently do not have LSP and Treesitter highlighting for .slint files. We also do not have linting. I have discovered we have all this in VSCode so I was wondering if you'd consider taking a look at that? I have in the back burner a PR with the current maintainer of the only slint LSP to ask Treesitter maintainers to point to your newest resources. Thanks :)
Totally cool App and Code!
Super useful tutorial, I'm evaluating Rust GUIs for a project and this was a big help. Thanks!
Good stuff man
How well does Slint work with screen readers. Is it possible to customize the information kinda like aria?
Hi Travis ! Thanks for the video. Great! - Man... is that laguage for UI the known CSS ?
Thanks
Which UI libraries are there that are more liberally licensed than Slint?
hope they add support for Zig once it hits v1.0
as a 3+ yrs flutter dev my self I found slint very intuitive
awesome!
looks awesome, I've been wanting to get into C++ more and doing application to either show some physic related stuff like simulation, or just add some interaction from the user. Slint looks really simple compare to Qt and better looking that like nanogui and that is crossplatform. that seems the case with Slint ^^
thanks you help me a lot
I’ll consider
You have a great voice!
Great tutorial and very well explained but I still prefer QT or electrom
please make more on slint
Nice stuff
So... this is basically QML for Rust ?
I'm still looking for reasons to move from C++ to Rust. I'm still not convinced, but having some QML-like toolset is definitely a good selling point.
That's amazing, thanks for the Video! Would this also be possible for Holochain Apps?
Prolly should learn rust this year huh
I'm 47 I've been programming since I was 11 on a TRS80CC2. I've never written a script for anything, never automated a thing in all my time. I do things manually every time and discover better simpler ways to get to the end. This is very similar to how if you define something or even name something you diminish it or limit it in some way. In this instance what your automation has done is lock you in and limit future alternatives that might have happened sooner.
expand on it maybe?
1:55 "changed their interface from QT to Slint." That does not surprise me at all. I never got the feeling that QT was all that great. I remember making a big project, upgrading to a new version, and everything was broken. Never went back after that.
Interesting. What I found amazing with Qt is that projects that I developed 10 years ago still build on newer versions of Qt with merely a minimal amount of changes. As I mostly work on web development, where everything decay in a matter of months, this was very impressive to me.
I had the same feeling as you about Qt, after using it in school. Then I was forced to use it at work. And it changed my mind entirely. I even re-wrote a game engine I was working on using Qt, precisely because I was unhappy with dependencies issues, so I figured it'd be great to just reduce it to one single dependency. It made shipping for Windows a lot easier too.
TL;DR Qt's APIs are actually incredibly stable, and that's actually one of their main selling points.
Just a side note: not only do you not need the braces in the format! macro, but you don't need the extra parameters. You could have done: "Taxes: {tax:.2}..." as well.
Thx!!
A Rusty project is exciting.
Im trying to build a text editor using Tauri even though i hate rust its really make it easy to make apps Tauri is trying to compile both desktop and mobile
what's the bundle size situation compared to a tauri app with leptos example?
could you also show an example on how to use a web ui within the application and have callbacks from html5/javascript to rust app
but does it have background blur capabilities?
can someone explain me the animation part, especially why we are animatic the x in the second rectangle, also if both recatngles width property is exactly same, how can one starts from left, and other one from right?
what are the benefits of using slint instead of more established frameworks like Qt?
Good videos, could you also do a video on tauri?
Have you tried to compare slint with tauri? I have used tauri and it was nice and I wonder how does it compare with slint
If you want good mobile or web compatibility, go ahead and use Tauri, but otherwise QT-style or native frameworks are preferred.
tauri is super quick, easy to style, super versatile, can compile to lots of platforms.. and is actually free to use unlike slint, where you have to attribute them LOL
@@Hacking-KittenGiving them credit isn't a cost, or not a net cost. It helps the project get more attention and builds the community, which helps you down the road if you keep using Slint, which benefits you more than the trivial cost of mentioning them.
Once again, great video.
license is confusing with Slint and that too when you need to invest in new syntax
Would prefer Tauri with any frontend framework.
No, I don't.
No, You should.
Thanks. I needed that.
Ok
So you can use C++ or JavaScript instead. 😂
@@vikrantmotasara2006 No, I don't.
Is there any specific reason why to go for rust instead of the golang?
Slint is very similar to Kivy's KV design language.
what database engine does it support?
`format!("Tax: {tax:.2}
...");`
Just curious, why not Dioxus ? Easy to learn as it is almost near to react.
Great video! Syntax feels a bit like SwiftUI (which I like very much!)
Does anyone know if Slint supports drag-and-drop (i.e. dropping a file into your app or dragging an object from your app to another app) ? I'm trying to figure out the best framework to use for a Windows app before I follow the Rust+Slint rabbit hole! I found a drag and drop module in Rust for Windows (windows::ApplicationModel::DataTransfer::DragDrop) in the Microsoft docs but I'm not sure how or where this ties into Slint. Thanks.
That seems easy, Currently I am building a Linux Desktop App in flutter to centralise and access the Server for me and my DevOps teams. The back-end going to be in Rust. We have 20 above client , its hard to keeps their private key of servers in pc and login.
Nice video! I have a question: If the input is empty, the program crashes. How can i validate that in Rust?
Parse returns a result. You can catch the Err(_) and set a default value to zero. An example to this would be
let num = match s.parse::() {
Ok(v) => v,
Err(_) => 0.0,
};
Or inline
let num = s.parse::().or::(Ok(0.0)).unwrap();
@@petrostrak7737 Thank you!
The full library costs €5,900...a bit too much considering there are free solutions like JavaFX, MAUI and Electron.
What would be it's advantage compared to others ? Can it be used for very complex applications, like Teams or Slack ?
Thanks for the video, i am facing a bit of a challenge when I run cargo build and this is I need some help to continue from here.
ld: warning: ignoring duplicate libraries: '-lSystem', '-lc++', '-lobjc'
ld: framework 'QtCore' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Anyone know how to change the font size of the text inside a Button? I've looked, couldn't see anything
So, it seems like less usable copy of QT QML.
If I already have a Rust console application with some text and text-based graphics, how easy is it to convert to a desktop application to run in Windows and maybe even Mac OS?
That really depends on how tightly coupled your application is to your TUI.
Sorry if this is already mentioned, but is this app cross-platform? I am trying to make a simple desktop/macOS app that will work in both Mac and Windows.
Everything in your walkthrough has been extremely helpful and i've learned a lot, however i have a question and i cant see to find the answer in the documentation as Im still very new to this kind of stuff:
How do I make it so that if i press return/enter it will run the calculation in the GUI? Like instead of having to click the "calculate" button, i can just press "return?"
Every time I use it I ask that same question but haven't looked into it yet. I'll check in the next couple of days when I get a minute and update this.
@@TravisMedia thanks dude, if you figure it out please let me know! It would be greatly appreciated