Upcoming Changes to the Slint Language #1818
Replies: 3 comments 5 replies
-
I feel like the old syntax for inheriting from another component could be more consistent and clear. And while I feel like explicitly writing "inherits" makes the intent more clear I definitely don't like it. Maybe using the same syntax as what rust does for declaring required traits would work. component AnotherComponent: MyComponent { /*...*/ } What is the reasoning for switching to explicitly writing "inherits"? |
Beta Was this translation helpful? Give feedback.
-
Haha well I actually did end up going back and rewriting the tree-sitter grammar. Good fun. It had been a while since I had used slint so it was a good reminder of the things in the language that I find funny. The biggest issue I have is with the for loop syntax. It still feels unintuitive to me. It would add a little more noise but I think it would be more consistent with how for loops worked if the for loop just opened a body and then inside of that body the component was created. for tile[i] in memory-tiles {
MemoryTile {
x: tile-spacing + mod(i, column-count) * (tile-size + tile-spacing);
}
} To me this makes a lot more sense and is a lot closer to regular for loops. And I'm my mind this would allow for instantiating other components inside of that for loop as well. Makes sense to me. My other biggest challenge with the language (and this becomes very apparent when writing the grammar) are the inconsistencies with expressions. I'm sure there is probably a good reason but I don't know why some expressions are only valid in some contexts, such as if expressions inside of callbacks handlers. Functionally I don't think this actually ends up making UI's too much more complicated but it does just feel off and inconstant in a way that is distracting. |
Beta Was this translation helpful? Give feedback.
-
Update: Part 2 published: https://slint-ui.com/blog/changes-to-the-slint-language-part-2.html |
Beta Was this translation helpful? Give feedback.
-
This is the discussion for the blog post "Upcoming Changes to the Slint Language"
-PART 1
-PART 2
We are welcoming your feedback. See also the meta-issue #1750
Beta Was this translation helpful? Give feedback.
All reactions