by mattfrommars · 2y ago · 0 comments
I'm thinking to begin developing on Linux but love to know what is the current strategy to develop on or for Linux.
What I'm trying to say is of WSL2 and all the work Microsoft is doing with Linux operating system has any other bigger purpose beyond docker or container
Honestly, the Linux ecosystem is more than mature - if not better - for most of the things you need as a developer imo. The edge cases are usually when you'd need a: 1) A specific proprietary toolchain/IDE for some microcontroller. 2) Windows specific C++/.Net Projects that didn't work well on VS Code.
The shell and desktop environment (for me, KDE Plasma + Yakuake drop down terminal + Dolphin File Manager + KDE Connect) offers a way more superior development experience than anything I found on Windows.
I have been told that Ubuntu based distros are a bit finnicky these days. So, here's the obligatory: "I use Arch btw."
Of course you can hose your system on Arch pretty easily, but it's not like it's difficult to hose your system with Debian or Ubuntu variants. The sneakier thing is that on Debian/Ubuntu variants, there will often be tools, be they third party repositories or even utilities included with the OS, that will make certain bespoke changes to your system for the sake of e.g. installing proprietary drivers, and the combination of those changes will leave you with a snowflake system that may or may not explode when you go to do something complicated (like upgrade major versions.) Whereas with Arch, _a lot_ of the things that you can do that will hose the system will _feel_ like things that will hose the system, and a lot of the scary-looking problems are surprisingly easy to resolve.
Arch shouldn't be any better since obviously, you still need e.g. proprietary drivers or non-standard packages, right? But in my experience, using the AUR to grab those things yields a very good success rate with a low chance of impacting system stability. It's not _zero_ - you can definitely run into problems - but the AUR is generally more reliable for me than third-party dpkg repos have been, and this seems to still be true today.
I wrote a huge wall of text below that nobody will read because it's too long and meandering, but I really think it's time to push for immutable Linux. Arch is oddly stable for what it is, and in my opinion it's a testament to the power of simplicity. But, SteamOS and Fedora Silverblue are starting to show that using modern Linux technologies, you can bring the benefits of immutable operating system design to the Linux desktop today. There's obviously much work to be done, but in my mind the tipping point is either here or coming very soon.
Amen. You hit the nail when it comes to AUR vs. ppa. Steam OS was also going to bring in support for Nix packages, so definitely want to see how immutable desktop + nixpackages end up changing Linux Desktop.
For a new switching user choosing stable Ubuntu-based distro is the best choice. It has the best software support, the best informational support (distro articles, googling problems), the best quality (because of the popularity).
I am using Mint since 2014 and I am still using the same install of 9 years ago. I update software packages whenever. With big OS updates that come twice a year I wait just in case for 2 extra months and update to that new version. 9 years and counting.
And now imagine an Arch user and how many times something would break during 9 years of operation... It is very telling when discussing this topic and Arch users use arguments like "Arch doesn't really break that much" without truly realizing what others hear and notice. "THAT much", Karl!..
And I'd like to share an anecdote - I installed Pop!_OS in a Samsung Galaxy Book3 Ultra (a combination of weird names) 2 days ago and I'm pleasantly surprised with everything that worked out of the box. The NVIDIA driver works, switching to Intel or NVIDIA works out of the box with zero issues. They even have a nifty command line tool, system76-power.
There are some rough edges. For example, the notebook's speakers do not work, but audio works via bluetooth or connected to a TV. Apparently, Linux Kernel 6.8 should solve that, and I could install it via PPA, but... I'm too afraid to do it. I got old, my primary job is no longer as a dev, and I don't want to spend all that time fixing a Linux system. The Arch Wiki for NVIDIA is incredibly detailed, but Pop!_OS... solves that out of the box.
The main reason I wasn't recommending Ubuntu is because of it's recent annoyances. I recently recommended Ubuntu to a Linux newbie, but after seeing him deal with issues of having to add ppas for some of the toolchains he needed, deal with snap headaches for steam, How gnome takes away certain basic features like being able to edit the path in it's open dialogs, it seemed like there are better options.
Now, I agree, Ubuntu seems to have got a bit to sh*t.
I guess nowadays I would recommend Cinnamon to everybody. Or perhaps PopOs for people from Macs, not sure?
Everything about Windows for software development is worse in my experience. From basics like text rendering to more complex things like managing toolchains and project dependencies. I've done a bit of work porting software from MacOS and Linux to Windows in order to support Windows users (because there are still many) but holy shit, it's a nightmare.
I don't know yet if WSL is a death rattle for software development on Windows, but it feels like one.
I think it's more of an embrace/extend/extinguish thing.
I use it everyday, it's Windows only, and I didn't find an alternative as easy and "free" (it requires a Nvidia card, but there is no subscription. Unlike, say, Krisp.ai)
Unless you're working on something that is heavily Windows-specific (legacy .NET Framework, Win32, Visual C++, etc.) that requires Visual Studio and Windows as a runtime developing on Linux is a much nicer experience.
I used to use Linux as a primary OS and sometimes dual boot in Windows. However, I have since transitioned to using Windows directly and WSL2. It is seamless overall.
There are a few edge cases, e.g. it was as little annoying to set up LUKS encryption and it's a lot easier to just use BitLocker. Other minor edge cases with permission of volumes that are mounted from Windows into Linux.
Further, there are some nuances around networking, especially if you are running docker in WSL2.
Once you get over these hiccups, it's quite comfortable.
I played with WSL2 and it's interesting to see Windows can directly access Wsl2 Ubuntu directory.
I'm sure it has limitation such as once I tried LLM model and WSL2 lacked support for AMDGPU, therefore it did not have any GPU acceleration.
I am doing UI,backend API services, ML research, ML services
I'm always good to braindump my thoughts so here goes.
Hardware:
If you want to run Linux as a primary desktop OS, please think about your hardware choices. There's a surprising amount of tradeoffs, and while the Linux desktop is generally a mess, I'd say this roughly defines people who wind up loving it versus hating it. Even in ways you could never realize, it will just impact your entire experience.
- GPUs: If you go with AMD, you have to be aware that choosing the latest cards may not be the best choice. The software stack is rarely ever fully ready for a launch, and if you are not tracking the latest stable kernel it will take even longer to get kernel driver updates. That said, I strongly recommend AMD in general as AMD cards have been very reliable for me and have good drivers across the board once they're ready. NVIDIA has the advantage that you can pretty much get a card at launch and run it on Linux, one of the notable advantages of them staying out of mainline; on the other hand, if you want to keep up with the latest Linux kernels, you may find yourself unable to get the NVIDIA driver working sometimes, as it does not always work on mainline. Further, NVIDIA's drivers still have some issues on Wayland, although it's not nearly as bad as it used to be, though for compatibility reasons I would still not strongly recommend it.
- NICs: Intel NICs generally work pretty good. They're not always perfect but they almost always have good mainline Linux support and reliability issues are definitely an exception case. WiFi is always a bit more persnickety, but things have gotten a lot better. The particular on-board WiFi used by my current motherboard is actually not generally recommended (A MEDIATEK MT7922), but I've been tracking mainline Linux and the only issues I've run into were unrelated. (There was an annoying issue with 6.6.5, it was fixed by 6.6.6 a few days later.)
- Audio: Believe it or not, Linux audio has gotten very compelling lately, after decades of being probably the funniest joke about Linux. Be skeptical if you must, but Pipewire + Wireplumber is probably about as good as Linux audio has been, and has compelling pros and cons when compared even with commercial OSes. Bluetooth will probably work out of the box, and getting low latency "Pro" audio routing features without breaking your desktop audio no longer requires a bunch of specialized knowledge; nominally, it's a dropdown in your audio settings. That having been said... You may face some issues, especially with cutting-edge motherboards and laptops. In general, Linux does not adequately support laptops that need a lot of software DSP in the driver to sound good. In addition, some of the more advanced audio codec setups may not work correctly out of the box. This is NOT the case for the majority of desktop motherboards, but it is worth googling to see if you can find someone reporting that it works.
Software:
There is a lot of heated debates about what the best distro and desktop environments are. Normally, I'd recommend sticking with a stalwart like Debian, but in this changing environment I'm really not sure what I'd personally recommend. I run NixOS, which I think is a fantastic operating system for people who know they need it, but like Linux itself, I would not recommend it to anyone unless they're relatively sure it's something that solves a problem they actually have. I pretty much knew immediately I wanted it when I heard about it.
But even when not considering NixOS, I strongly would recommend trying to find an "immutable" Linux distro that will work for you. This is because immutable Linux has proven to be a much better model for desktop usage that is far more robust and easier to reason about. A good example would be Fedora Silverblue. There was a nice looking project on here recently that may be of particular interest to developers, based on Silverblue, called Bluefin:
I can't necessarily personally recommend it, but the concept seems solid. Recommending a random recent project is a little risky, but it at least has the benefit that it's essentially just a spin of Silverblue that can be reverted back to plain old Silverblue safely as far as I know.
My personal choice for a desktop environment is none. I use SwayWM with a bunch of bespoke configuration. It's... ugly[1]. But it works, and for me, it works quite well.
But that is a horrible recommendation for someone who is trying to get into Linux by any measure. Instead, I recommend KDE. KDE has a fair amount of stability issues, but what I can say about KDE is that it's got a great balance of customization, features and polish for a desktop system, and I think that the current iteration of KDE is going to age well into the future. We'll see how that thought holds up, but I have my hopes.
If you are using an AMD card, I can also say that running KDE/Plasma Desktop in Wayland mode is a pretty good experience, if you can. It does come with some challenges and downsides, but there are some positives, especially if you like high DPI or high refresh rate screens, or you want to use OBS to capture or stream the screen, as it will be a lot more efficient using Pipewire on Wayland. At the very least, it's not a huge commitment since you can log out and jump back in with an X11 session through your display manager if anything goes too wrong.
P.S.: While I don't immediately recommend anyone to go and try NixOS, I can't say the same about Nix. Go and install Nix on your macOS or Linux machines! It's a great tool to have and is generally not obtrusive on a machine. Especially see the `nix develop` command. It drops you in a shell with the development tools used to build a package, so I can do say, `nix develop nixpkgs#_86Box` to get all of the dependencies to build the 86Box emulator, and just start building it with CMake.
[1]: https://github.com/jchv/nixos-config/tree/master/modules/pro... - In case anyone is curious about a "real world" Sway setup, this certainly is one. In the back of my mind, I'm secretly hoping someone will suggest improvements. :)