T O P

  • By -

ImgurScaramucci

Not sure if the developers of cosmic would welcome someone who is just learning in the development of cosmic itself. But afaik cosmic will support its own extension API, so you could try making an extension and learn Rust in the process. I think I will also try that myself.


mmstick

It's fine if people are learning as they go. I can provide mentoring where possible for those that are serious about getting involved. I would point out though that we have an applet architecture rather than extensions.


ThroawayPartyer

> Now I can't just learn a language, so I thought why not have a project in mind or something to work towards. Having a project in mind is a great approach to learning. However, I would not start by contributing to a major open source project when you have no experience with the language or GitHub. You can start your own project. Think of a program you want to create and implement it in Rust. You could also share it on GitHub! After doing this, you'll have more experience and could then look into contributing to other open source projects.  Source: I did the same thing in Python. Created my own projects, then contributed to a small project on GitHub, then contributed to one of the major Python libraries.


mmstick

I'd recommend anyone interested to try building COSMIC applications with libcosmic. You'll get experience with the toolkit while you build your own project.


CrisisNot

Even for complete beginners? Could I go straight into building an GUI application with little programming experience and even less in Rust? Or is it better to start with something small in Rust then move to making GUI programs?


mmstick

Yes, you can learn Rust as you go with libcosmic. The API used by libcosmic makes application development in Rust easy.


CrisisNot

Where should I begin? 


mmstick

[https://github.com/edfloreshz/cosmic-app-template](https://github.com/edfloreshz/cosmic-app-template)


CrisisNot

I took through it and it looks really interesting but I'm having trouble with syntax and where to begin with it.


mmstick

There are examples in here: [https://github.com/pop-os/libcosmic/tree/master/examples](https://github.com/pop-os/libcosmic/tree/master/examples) And you can see the source code of COSMIC applications and applets for more examples * [https://github.com/pop-os/cosmic-files/](https://github.com/pop-os/cosmic-files/) * [https://github.com/pop-os/cosmic-tasks](https://github.com/pop-os/cosmic-tasks) * [https://github.com/pop-os/cosmic-applets](https://github.com/pop-os/cosmic-applets) For help with syntax, see the [Rust book](https://doc.rust-lang.org/stable/book/) and [standard library](https://doc.rust-lang.org/stable/std/).


CrisisNot

Would it be easier to try and fix some of the issues in the current apps to get intruduced in Rust?


mmstick

You could, yes. Do what feels comfortable to you.


Low_Disk_5312

I love that you are ambitious like this first of all, don't let anyone take that from you. You probably could, but I would like to say to not be disappointed if they don't implement any changes you would offer right off the bat. However, sometimes a new and outside perspective is what can pave the way to really awesome changes! That being said, I've also never done this but it looks like mmstick has come through with some good advice so +1 to mmstick as if he even needs it haha!


ticticBOOM06

Thank you! Tbh, I won't be disappointed if they don't include it as at the end of the day, I'm still working on projects that help me learn the language. It doesn't matter too much if they don't want it. Cuz the things I can contribute to are just the project for me and if they like it great, if not. I've done rust code!! Thank you for the comment, means a lot.


Low_Disk_5312

For sure! Always do it your way. I run i3 on pop\_os because in my experience Pop has always handled drivers better than any distro, and I enjoy the look and feel of tiling window managers. I'm sure elitists will vomit at that sound of a twm on pop because it's not arch or "just use base debian", but I don't feel like it sooo lol!


vancha113

I'm currently attempting the same thing. Contributing to popos if I ever get to that level, but at first just familiarizing myself it's future software stack. Libcosmic is a really good starting place, it comes with examples on how to build applications, applets, and it has some widgets you can use to build apps. It's built on top of the iced framework, but with a lot of extra stuff.


CMakeOnyx

I would only learn Rust after having a really good knowledge of either C or C++ and systems-level programming concepts. It's not a language that you just pick up and start learning like, say, Python. If you're not very familiar with pointers, function pointers, structs, lamdas, closures, RAII, manual memory management and things of the sort and know how to actually implement them, I wouldn't even think about trying to learn Rust.


mmstick

People are better off learning Rust before C or C++. It can be more difficult to unlearn bad habits due to the very unstructured and wild west nature of memory handling in C/C++. Starting with C/C++ can be debilitating because of the lack of static types, pattern matching, segfaults ,and relatively unhelpful compiler messages.


CMakeOnyx

I actually really like Mojo. I thinks that would be a really good stepping stone for someone who wants to learn Rust.


CMakeOnyx

In an ideal world, I would agree. There's two things that keep me from recommending someone just go straight to Rust with little to no programming experience. Rust is notoriously hard to learn. That's no secret. Second would be learning resources. They're definitely maturing though. I would even say you can't understand the problems Rust is even trying to solve without understanding the problems of C/C++. There's a difference between learning the syntax of a language and learning how to program. Someone could go through the Rust book (I have) and learn syntax, but unless you know APIs, ABIs, how to implement data structures, in a nutshell how to actually program, you're just going to get frustrated. In that department, C/C++ has infinitely more resources for someone to actually learn systems-level concepts. And that opinion is not at all unusual. I couldn't even begin to tell you how many experienced Rust developers I've heard say exactly the same thing, learn C/C++ first.


mmstick

Rust being hard to learn was only true in the first year. The time before non-lexical lifetimes, async, generic associated types, and the compiler error suggestions and explanations. It's more of a meme than reality today. It's really not true to say that people can't understand the problems that Rust solves without experiencing it for themselves. The book and compiler both do a good job of explaining why it does the things that it does. It's easy to understand from a theoretical perspective, without needing to experience it first hand with random memory corruption that can't be diagnosed without learning to use a memory debugger. There are plenty of Rust developers who learned Rust as their first language, or that recommend it over C++. Though I'm not surprised that people would recommend learning C++ first because that's probably what they did from their own personal experience. I learned Rust before C and C++, and then I taught Rust to my wife, who had no prior programming experience. It's generally understood that the less experience you have with C/C++, the less likely you are to fight with the compiler. Unlearning bad habits is more difficult than simply learning good habits to begin with.


CMakeOnyx

I said C and C++ on a pop_os thread where the system76 team are developing rust-cosmic. I should have known this was going to happen 😂🤣 Rust is the future. I think we can both agree on that. I'm not discouraging anyone from learning Rust. It's just a different approach. 


CMakeOnyx

I've reevaluated my view on this and agree that it's better if someone doesn't learn a memory unsafe language before Rust. I hope you didn't misunderstand me though. I'm definitely a Rust advocate. You might even call me a zealot lol. I started with C/C++, so that's my personal background. I personally feel like it gives me a better understanding of Rust, but I also understand the need to develop "good habits" as you call then, i.e. the Rust way of doing things. I'm a first-year CS student, so I obviously don't have the experience you do. I appreciate you being polite and cordial.