We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Slint: Are we GUI yet?

00:00

Formal Metadata

Title
Slint: Are we GUI yet?
Title of Series
Number of Parts
542
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Slint is an Open Source GUI toolkit for Desktop and Embedded. It is written in Rust, and comes with a declarative UI description language that compiles into native Rust code. We will present Slint and show how you can build an reactive GUI in Rust One of the question that often comes out is "Are We GUI Yet?". i.e. can you use Rust to create user interfaces? Our answer to that question is "Yes, with Slint" Slint is an Open Source GUI toolkit. It scales from desktop platforms all the way down to micro controllers with only a couple of hundred of KB of RAM. Thanks to the great tooling around Rust, it is also really easy to build a UI that can run on multiple different platform: Desktop native UI, wasm in the browser, or MCUs. This presentation will be a presentation of Slint, demonstrating what you can do with it and how to use it.
Embedded systemKey (cryptography)Ocean currentState of matterDampingProblemorientierte ProgrammierspracheMacro (computer science)Open sourceWeb browserFormal languageBitLibrary (computing)CASE <Informatik>LogicCodeDemo (music)Programming languageExtension (kinesiology)Keyboard shortcutVisualization (computer graphics)Projective planeSoftwareProcess (computing)Service (economics)Diagram
InformationExtension (kinesiology)MaizeCodeVisual systemPressureWrapper (data mining)Visualization (computer graphics)Formal languageCommunications protocolServer (computing)Program flowchart
Augmented realityDisintegrationWindowCodeType theorySymbol tablePower (physics)Multiplication signText editorMacro (computer science)Extension (kinesiology)DemosceneCategory of beingServer (computing)Computer animation
Computer virusDifferent (Kate Ryan album)WindowDifferenz <Mathematik>Source codeComputer animation
Euclidean vectorCategory of beingMenu (computing)Queue (abstract data type)Letterpress printingDemo (music)CountingArithmetic meanCategory of beingWeb browserComputer animation
Demo (music)GUI widgetGame controllerGoodness of fitMacro (computer science)Video projectorProgram flowchart
Web pageBitProjective planeOpen sourceComputer animation
Finite element methodOpen sourceCategory of beingSoftware developerFormal languageRevision controlSoftware bugPresentation of a groupProjective planeOpen setSoftware
Program flowchart
Transcript: English(auto-generated)
So now we have Olivier. He's going to talk about Slint. Hello, yep So about me, I started open source working on contributing to the KD project Which is a project made with Qt So that led me to be hired as my first job at Trolltech, which was a company making Qt, later bought by Nokia
but in two thousand ten years ago, I left to create my own company software services and and still I had a little... I was still a bit in the Qt ecosystem and I was talking with Simon Hausmann also from from Qt and we were like
The sad state of current desktop UI. Can we do better? What would happen if we would create a new UI toolkit from scratch and in 2020 then We created Slint. So this is Implemented 100% almost in Rust
Which is not... almost... most of it is implemented in Rust It's a native toolkit So native as opposed to runs in a browser. So it really runs natively and it's aiming at Desktop and embedded at first and so it uses its own domain specific language
So it's like a macro and you might say wait is this I wanted to To develop in Rust and now you're saying I need to learn a new language to do UI and it's it's yep, but
Fortunately learning this language is not more difficult than just learning the API of any other any other library. So just Just like learning an API and Rust is not really meant for UI There is a lot of ways that Rust is a bit too explicit in some cases where for UI you just want to describe the UI in a really
More in a way that that all language is much better at and then This thing is only to describe the user interface, but all the logic of course is written in a programming language so for example Rust, but we also have bindings to Various languages like C++ or JavaScript and we tend to add more
So, let's try to make a short demo I cannot do the demo because it's a lightning talk, but I just took some screenshots So let's just create a new project at slint as a dependency. There is a extension so this is visual studio code where we can install an extension we search slint there and
one click install and if you don't have visual studio code, it's okay because this is just a wrapper around a Language server protocol just LSP. So that works with most most editors And if you don't want to use a it is also it's all optional but let's go back to main.rs and add some
Some code here. We add our little macro. It shows a small window with a text and a button While typing that of course, I had the full power of this extension. So that includes auto-completion Go to symbol and everything else. We even have this little
Property editor there that we added But the But the coolest thing here is that we have this code lens show preview, let's click on this it can be a collection as well on other editors and a window up here and so the LSP server behind the scene opens a new window and
This is the preview of what you just typed and if you type it updates live So this is really interesting because when you do UI you really want to see What happens as you do you don't want to spend a long time compiling and stuff let's add a callback here btn underscore clicked and
in the rest code, we will instantiate our main window that we created from this macro and connect to it with the The generated on btn clicked. So this is generated by the macro and to have some so some first code can be called so
If we click and run the code, that's it we have we have the thing Here we see that the two the two windows and the screenshot have different Style that's because stain is stable the diff So we have for example the front style or we also have here a native style because we really want to
To be a native toolkit. So using the native style Let's add a property that we can set with Now in the callback we say set count get count plus one. So we added this property that we use in the text
properties are reactive meanings that when you When you change them they automatically change And and slint knows what what to refresh? So what can we do? So here is our little demo
Okay That works so this is this is Apparently not working really good in this in this presentation, but but the idea here that we would see you will see the demo Running on WebAssembly in the browser. So it's some it's meant to be a desktop framework, but it also runs for demo
On the browser and now Okay, so this doesn't look good on this with this projector. But again, this is a Gallery, which show a few controls
So what about the performance? How lightweight is it? So Here I have with me I have with me this macro controller So this is a Raspberry Pi Pico. It has three less than three kilobytes of ham. I said kilobyte not megabyte and
And yes, it's working. We have scrolling a bit some animations So that shows that shows what we can do. So the project is open source. It's entirely developed on github We accept requests
We also accept of course bug reports, please send a github issue open github issues The license the license is GPL for open source projects and we also a company so we want to make money out of it So that's why we have multiple license. So GPL for open source project and
We also have an ambassador license as we call it. It's it's a free license, which you can use for property Software you just have to To say that you're using slant and there is also a commercial license with support and so on
So in the future, we plan to after already three years of development We are now almost ready to release the version 1.0. So it's if all goes well It should be released this month end of February And the other thing we're working on is to improve our little preview there and to make it Like that you could drag and drop things I can talk with jets and have actually a design tool where
So even design your could do the design And without even touching the slant language So that's that's all I hope for the future So that's the end of my presentation. I hope that you got
That it made you want to try slants and please do contact me If you have any question, or if you're wondering if you can use slant, I'll be around please ask questions