-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project goals & design #6
Comments
And it's stil not merged yet 🙈 😂 I wanted to automate everything.... Mhmmm. well. But hey, I've learnt cool things about
We're not doing a 1:1 rewrite of dunst. We're splitting the good things from the bad things of dunst, "borrow" (I don't want to say steal 😀) the good things and enrich them with the better concepts.
Oh yeah. That's one part we'll completely drop and won't provide any backwards compatibility. The dunst ini file is disastrous. Ini is just a 1-dimensional file format with groups.The command line arguments are awful (who the heck has thought, that I want to supply my config file via cli arguments!?!). Modern programming languages use dictionaries (or trees however you want to call it) and so I think it's the right thing to use a dictionary-based config file: YAML (I remember you've asked the question once to implement it in dunst, can't find it rn). Also having the possibility to have proper rule naming schemes (having matchers and actions):....
Oh yeah, those are getting more and more on dunst. But we haven't yet defined a path to go. We had thoughts about using HTML/CSS for the GUI stack once another time we thought just using plain cairo (like dunst does it). We haven't settled on this topic yet. The only thing GUI-wise, we have settled: GUI is logically split from the core. So that it's easy to support X11 and wayland at the same time (@Stunkymonkey uses wayland, I'm still on X). customisability with rules? Definitely! Every option is a rule! Our current plan for durst:
At our start (IIRC beginning of march), we said, that we want to have a replacement, which works for our use case. It'll take some additional time and effort (we're willing to take) to make others regard it as a viable replacement. |
So, I forgot the most important thing.
Nice to have you on board! I'm not sure about your Rust skills, but as you can see, there are plenty of different jobs to do. Currently, I'm not familiar with Rust and have to learn it, too. But most of the jobs aren't really bound to Rust. So, whenever you make your first PR, I'll invite you into the org. |
Initially one of my first goals was to implement the whole pipeline. Because I got a bit more experience in rust then @bebehei . Should I continue to do so? Because both of you are much more experienced with notifications. |
Well just continue. If something isn't clear, ask. There will be always another pair of eyes looking on your code, before it's getting merged. So you can consider yourself as safe. If you'll break the standard, someone will tell you. For the case, that nobody found the mistake prior to merging it, nobody will rip off your head 😃 🔪 And yeah, I could continue. But I'm not just not familiar with Rust, I've got no skills in it currently. The output would be a solid zero. The goal for me is clearly to learn Rust first. Are you afraid of making "wrong decisions"? You won't be immune to wrong decisions. Today, someone delivered a perfect Pull Request on the dunst repository. it was in itself complete. I could have pressed the merge button. The only thing: he implemented a string splitter function (see python's I bet we all experience a similar situation, you probably have already. The only difference between you and me: I haven't. But I haven't tried at all. So, please keep up the work and we'll support each other! 💪 |
I'll add my thoughts here based on the things I've seen in dunst. Mulitple windowsAdd the ability to draw multiple windows that can be modified independently. Add include directiveAs proposed in dunst-project/dunst#796. As more Improve code hierarchyDunst currently has some bad patterns in the code structure. Make running and testing easierThis is a bit personal, but I often have some sort of notification coming in Single source of truthAs we've seen in dunst, it's hard to keep two different files have the same
What do you mean exactly by this? A GUI for configuring durst?
I'm not convinced there are enough use cases for this to implement a HTML/CSS On another note, since durst is marketed as a replacement for dunst on wayland |
Great to see some activity in this! I was starting to think it was dead.
Wayland isn't the only reason for a rewrite, in fact, I'm pretty sure the wayland support is a consideration made after the fact. On another note, @bebehei & others, whats your thoughts on rewriting dunst directly (and part by part) rather than starting from a clean slate? Rust has excellent C interop so it could be replaced part by part. It would save on rebuilding the reputation of the repo/waiting for it to be picked up by users. |
@tsipinakis I would be fine with rewriting dunst in rust inside the dunst project. I've never thought about this. This had some personal reasons. I've switched from i3 to sway in December, so I don't see any personal gain in supporting legacy C/X11 infrastructure. And albeit I've got good overlook over the dunst source code, I assumed it will overwhelm the project. But since you're openly thinking about it, I might rethink this. @Stunkymonkey @fwsmit What are your thoughts on this? |
Full ACK.
This is covered with a simple YAML anchor. Yes it's I'm absolutely fine with ever format. YAML has its downsides ( The docs are easy to write:
And we only have to write down the structure, what we're actually using. Nothing more. There is no syntax to actually specify. Include, deduplication features are all in the syntax already included.
💯
I don't fully get what you mean. Are you talking about the ability to specify (too many) options via cli and via config file (and while it's not specified, it's taken from the default structure)?
I switched to NixOS end of 2018 or so and started to work full time in 2019, moved cities, full programme. The switch to NixOS diminished my contributions to dunst in some way, while the full time job then killed the rest. Developing on NixOS has a steep learning curve. In hindsight, I have to admit I switched way too early. But now, I know how the stuff works, and I'm fully productive again on this system. Now with the pandemic going on in Germany, I've got way too much time available again. With the switch from C to Rust, it'll be the same like switching from Arch to NixOS. It'll be a steep learning curve and I don't expect to be productive at the beginning. |
Yeah me too. I'm working on a settings refactoring for dunst, so I can try to write that in rust.
I think the X11 infrastructure is relatively separate from the rest. You can basically ignore it when writing other things. There is of course all the legacy C code, but I think it's OK to work with. As far as I can tell it's not possible to make a single binary from the rust and C code, but then we can just ship a library with dunst that contains the rust stuff (source). |
I take this one partly back. You can ignore the example I gave here, but the idea still holds. When documenting things, make sure there is only one source and generate your documentation from that where possible. Edit:
Ah thanks for explaining 👍 . |
That'll work as a PoC on the rewrite but please refrain on submitting a PR just yet. I want to a) submit an issue on the dunst tracker about this, get some feedback there. and b) contact @knopwob. I believe he still gets veto rights here, even if he's been inactive that long :) |
One more thing to consider that I just thought of now: Rewriting means we, to some extent, have to keep backwards compatibility until we can dub it 'dunst 2.0' and drop all the built-up baggage of the ages. At this point it will essentially be a completely different project - with different configuration formats and (probably) different display options. And on top of that there's the effort of interfacing with the current code So perhaps keeping it here would be more appropriate. I'm having mixed feelings about this. |
Dunst started as a weekend project to learn C. The biggest lesson I've learned while writing Dunst was "don't use C unless you have a very good reason!" So I don't mind switching the language. I personally can't code in Rust but I don't see myself working on Dunst in the near or far future therefore I don't really have an opinion on that decision. |
Couldn't agree more. I guess that's one thing crossed off the list!
We can link that library to the binary, no need to ship a separate file. See newsboat, a project I know that is in a similar process. Given, that case in a bit more complicated as it's C++, so they're doing a C++->C->Rust interface system which is quite messy. Edit:
The other option here is to just have an 'unstable master' for a while and do a big backwards compatibility drop a long while later when we're ready to change things. |
The settings refactor should not change any behavior of how the settings work. It should only improve the code structure and the error messages. It implements the idea proposed in dunst-project/dunst#412. |
I've developed in dunst for the exact same reason. Let's misuse the project to learn a new language. I'm in! 💯
Well, I had a try there. And also I wanted to use it as a single source of truth, like you said. But in C, it turned out to be a whole preprocessor hell. Rust might be suited much better for it. Especially for documentation stuff. The settings are a perfect type of moving it into a separate library! |
Yep me too 😅
Yep, especially since you easily make mistakes with out of bounds access of arrays. I started implementing in C, because I have to use quite some structs and functions from other parts of the code. I didn't rewrite the reading of ini file. |
I don't think the reasons for rewriting dunst need a lot of thought, C is definitely not the right language and has caused a lot of headaches over the years (I have flashbacks to reviewing that markup parser @bebehei wrote... God knows what that must have been like writing it)
I've been thinking of doing this for a while as well actually, but my version never made it past 'Hello World'. So I'd definitely like to help here and see how this evolves.
I took the initiative to open this as a tracking issue to track the current implementation goals until durst reaches feature parity with dunst.
Are we doing a 1:1 rewrite of dunst or will we look into improving the design?
Apart from the language choice, I think dunst suffers from piling on too many hacks over years of configuration updates without a lot of thought.
I'll throw some improvement ideas to start off:
Configuration: I've already opened numerous issues on the dunst repo about possible improvements and I think it's a no-brainer to include these as well. When it comes to the rule system I think that can also be massively improved by making the match rules have
a = "b" and b = "c"
type of syntax.Customizability: There have been many issues opened on the dunst repo about requests to slightly tweak the layout in one place, or make the separator a bit different etc, given that rust is a much more flexible/powerful language than C it might even be possible to expose the notification layout as a configuration. Though I have no idea in what way that would be achieved.
The text was updated successfully, but these errors were encountered: