Um. Hi. I have… a lot of questions these days as a washed out programmer who burnt out in college.

1. How does Linux do Arch

First, I got myself an Arch Linux install cause being able to build the operating system with the pieces I need sounds very cool, but ngl… the Arch community scares me. So if I may…

  • Do y’all know where I could find help for this?
  • If I uninstall a desktop environment, do I get my settings back if I reinstall it?
  • Is there a safe ish way to repartition if I set root and home to different partitions?

2. Very rusty

I’ve been trying my hand at Rust recently. But I am not sure of what can it actually do.

  1. Can Rust make .exe programs?
  2. Does it get crazy over time?
  3. How does one use git with Cargo?

3. Windows

So I have a main build that runs Windows, but I have been thinking of switching to a Linux DIstro. One SSD for OS, one HDD for data, 16GB RAM, AMD stuff. Anything I should know?

Yes I know this is dumb but I dont know where else to ask… Any help is appreciated

  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    Could be worth splitting your questions across posts, but given its here now, ill have a crack at the first few questions.

    Arch wiki is pretty good, if you need more help, ask here or somewhere similar?

    Your desktop environment settings are stored in your home directory, as long as you dont delete them, it should reinstall just fine.

    Having home on a separate partition is safe, and a fairly good idea, it lets you wipe your root and reinstall without losing your home data. You can move your home off the root by creating the partition, mounting it somewhere temporarily, copying all files across, and them set it to mount to /home in fstab.

    Rust works on windows, so exes are definitely possible. And i think you can cross compile for windows if you want/need to.

    Dunno what you mean about crazy, do you mean complexity wise? I have found that rust is really painful to get started, but eventually it’ll click, and it starts to make sense.

    Git and cargo are two different things, i think its currently recomended that you dont commit the cargo.lock file. https://stackoverflow.com/questions/43667176/what-files-in-a-cargo-project-should-be-in-my-gitignore

    Cant think of anything specific for your windows question, try it and ask questions when you get stuck?

    I would consider asking questions in more general communities, this one is a little specific, so you may not be seen by the people who can help you.

    • Stella! (she/her)@lemmy.blahaj.zoneOP
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      About that last one… yeahhh good point. Sorry I just dunno where to find them.

      The partition problem is that… well I made the root 30GB and it’s about to fill up and now I wanna asign more space to root while taking some from home but im not sure if this gonna nuke my data if i try…

      • CameronDev@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        Boot a live usb with gparted, and you can resize and move partitions. It will take a while though, but should still boot.

  • wolo@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    1 year ago

    For 2:

    • Yes, and it doesn’t cheat by bundling some huge scripting runtime like some other languages do. It produces real, native code which will run almost as fast as an equivalent program in C (sometimes a little faster!)
    • It gets as crazy as you make it, but the design of the language tries to help you keep things manageable.
    • When you run cargo new or cargo init it should initialize a local git repo for you, just add a remote and push. If you’re setting it up on your own, add the target directory to .gitignore.

    Also, for point 1.2: As long as you don’t delete your settings or change them in another program, they should stay where they are even if the DE using them is gone. However, if you aren’t short on disk space, there’s no need to get rid of a DE you aren’t using, since you can pick from all of the installed desktops in your display manager (the screen where you log in for the first time after booting).

  • Franzia@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Lmao. Try the commhnities Linux, ArchLinux, or UnixSocks. Lemmy isn’t really the elitist arch community everybody here is sweet. Can even try stackoverflow 😂

    I don’t have a lot of info since I’m new to desktop linux, but you can run portable Linux on a Live Disk (an .ISO file on a USB drive) and this is a way to try Linux without having to install it. Also making sure you’re aware of the tools balena etcher, and ventoy.

    By safe if you mean you can do this on a drive with important files on it, I so wouldn’t. With arch linux it’s better to be ready for it to break, because if it does you often do not have to start from scratch again, there’s usually a step you can take to fix it.

    • Stella! (she/her)@lemmy.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Don’t worry, I am making sure that I do things in the ThinkPad first, I know the risks!

      Also I am not aware of the tools you mentioned! I’ll look them up!

  • jennraeross@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Looks like most everything has been answered, but I’ll note that if you struggle with arch, endeavor os has the same underpinnings while being a fair bit more beginner friendly (graphical installation, easy drivers, utilities to rank mirrors and update your packages, etc.). Arch wiki is great for questions that have already been answered, endeavor forums are useful for asking questions when the wiki falls through.

  • AVincentInSpace@pawb.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    8 months ago

    It just so happens I can answer all these questions!

    1. How does Linux do Arch
    • Do y’all know where I could find help for this? As cliche as it sounds to say, Archwiki is your best friend here. I’ve been running Arch exclusively for ~4 years now and there’s rarely been a problem I’ve encountered with needing to get something specific set up that I haven’t been able to just Google. “Rarely”, however, does not mean “never”, and the Arch Linux forums (bbs.archlinux.org) as well as people you can reach out to who are already familiar with Arch specifically (hi!!!) are invaluable resources here. DMs open if you have specific questions.

    • If I uninstall a desktop environment, do I get my settings back if I reinstall it? Yes! Settings for your desktop environment (or any other program, for that matter) are stored as dotfiles in your home directory. (If you weren’t already aware, this is just a fancy name for files whose names start with a dot, which on nix is how you mark a file as “hidden”. Programs that are competent will follow the XDG specification and put their configuration in a program-specific subdirectory of ~/.config, and programs that are not coughcargocough* will put them as folders or (shudder) collections of files directly in your home directory.) Pacman does not know or care about these files, so if you uninstall and reinstall a program that uses them, you should keep your configuration (unless the program itself does something stupid and wipes its configuration on first startup, although I’ve never seen a program do this). That said, if there’s one thing that using Linux for nearly half my life has taught me, it’s that just because something theoretically should work doesn’t mean it will. I’m also not sure why you’d want to uninstall and reinstall a DE, other than to save disk space – any halfway decent display manager (this is the program that presents the login screen, not to be confused with a window manager or desktop environment, which is what you get after you log in) will give you a drop down menu of installed desktop environments to pick from each time you log in.

    • Is there a safe ish way to repartition if I set root and home to different partitions? I am not entirely sure what this question means, but I’ll try to answer it anyway. First, let’s get the important stuff out of the way – NEVER try to resize or (worse) move the partition you’re currently booted from. That is a one way ticket to disk corruption, and most partition managers will flatly refuse to let you do it. Resizing Linux partitions from Windows is also not a great idea, since Windows doesn’t understand the filesystem and can’t do it safely. If you want to repartition your system, ALWAYS do it from a Linux boot image separate from your main system. Usually this is the bootable flash drive you used to install Linux in the first place, although creating a separate, minimal Linux install on, say, a 16GB partition specifically for system recovery is never a bad idea. To this end, it is possible to install and use a desktop environment while booted from Archiso. Here’s how to do it:

    # increase the size of the in-RAM filesystem to make room for the software we're about to install
    mount -o remount,size=50% /run/archiso/cowspace
    # install the desktop environment and assorted other utilities (konsole for terminal emulator, gparted for, well, gparted)
    pacman -Sy plasma plasma-wayland-session konsole gparted
    # launch Plasma
    startplasma-wayland
    

    From there you can launch Gparted and screw around to your heart’s content.

    As for “safe-ish way to repartition” I’m not sure what you mean. Repartitioning is usually pretty safe if done from within a program that holds your hand, like Gparted, although having backups is never a bad idea. If you’re talking about having root and home as separate partitions to start with, and being able to decide down the line to redo it as a single partition, that’s certainly possible, but not without copying your entire home directory off onto an external hard drive and back again. Depending on why you want your home and root partitions to be separate, specifically if it’s to make backups easier, you may be able to achieve something similar that wouldn’t have that requirement using Btrfs subvolumes. If your root partition is formatted Btrfs, you can set up your home directory to be a subvolume. You’ll then be able to take snapshots of your root partition, not unlike Windows’s System Restore, to go back to if anything goes catastrophically awry, while keeping your personal files intact. I can provide detailed instructions on how to do this if you’d like.

    1. Very Rusty
    • Can Rust make .exe programs? Yes! This is the default option if you run Cargo on Windows, and you can make Windows .exe’s from Linux too if you’d care to set up cross compilation. There are a number of different methods you can find for doing that if you just Google “rust linux to windows cross compilation”. Here’s my preferred one:
    # install the Windows toolchain (stdlib etc. for Windows targets)
    rustup target add x86_64-pc-windows-gnu
    # install a Windows C compiler, in case we find ourselves depending on a Rust crate that needs to compile C code
    sudo pacman -S mingw-w64-gcc
    # compile your project for windows
    cargo build --release --target x86_64-pc-windows-gnu
    

    Note that I had to find the second command out for myself. Usually you can get away with just the first and third one, but sometimes you’ll need to depend on a Rust crate that is partly written in C, and Cargo will need to be able to find a C compiler in order to compile them. It failed to build, complaining that it couldn’t find the Windows C compiler:

      CMake Error at CMakeLists.txt:35 (project):
        The CMAKE_C_COMPILER:
    
          x86_64-w64-mingw32-gcc
    
        is not a full path and was not found in the PATH.
    

    I asked Pacman which package that binary was found in (pacman -F x86_64-w64-mingw32-gcc) and it told me the name of that package, which I then installed. pacman -F (find packages containing the given file) is an invaluable resource that every Arch user should know about!

    • Does it get crazy over time?

    Rust is famous for being difficult for existing programmers to pick up, due to new syntax constructs like named lifetimes that (to my knowledge) have no equivalent in any other language, and the unique way the borrow checker forces you to think about program flow, and, to a certain extent, about programming as a concept. It definitely took me a while to pick it up, but once I did, I was in heaven. There are a lot of rules to memorize about how things have to be laid out, but they’re all clearly spelled out, they never change, and the Rust compiler holds your hand a lot as you learn them. For someone like me, at least, that’s ideal. I love it when I can predict exactly how the compiler will behave and why with any given piece of code.

    Rust’s borrow checker may seem stifling at first, but as you learn more and more Rust and start to use RefCell<T> and Rc<T> less and less, you start to learn how to have the borrow checker work with you instead of against you, and I swear it gives you wings.

    1. Windows

    If your GPU is AMD as well, there’s nothing you need to worry about. Nvidia compatibility on Linux can be a bit dodgy, but it does work for the most part. Dual booting Windows and Linux from the same boot drive works fairly well, but unless your boot disk is exceedingly roomy (on the order of multiple terabytes), if you’re anything like me, you’ll fill up one partition or the other pretty quickly. I like to have physically separate drives for my Windows and Linux installs, but that’s personal preference – it works just as well either way. As for sharing your data drive, that will just about happen automatically.