reddit / emacs
Native Windows Emacs vs WSL Ubuntu Emacs
sen-san · 2022-12-08 06:25
Hi,
I'm just stepping my feet into emacs world. I have a Windows 10 machine. I have 2 options to install emacs. either install the native windows version of emacs or install ubuntu in WSL and get the linux version of emacs.
How to decide which one to use?
Heavy-Onyx · 2022-12-08 06:49
I am running Emacs in WSL using VcXsrv to get the GUI version running in Windows. It is way faster than the Windows version when starting up and while using it. It also integrates itself nicely when opening shells, e.g. by using vterm. And most of the tools that some packages require (grep, ag, etc.. ) are already installed or easily available in WSL.
The only disadvantage is that you are more or less limited to the WSL file system, as opening files from the Windows file system is possible, but can get slow for large files.
hangingpawns · 2022-12-08 06:58
Why can't you find windows files in wsl under /mnt/c/....?
Heavy-Onyx · 2022-12-08 07:01
You can access all files on the Windows filesystem but access is slower (at least on my system). In some cases, like using magit, it becomes painfully slow in a way that I decided to move as much as possible into the WSL filesystem.
electricity-wizard · 2022-12-08 07:15
I use wsl and emacs when I’m stuck with windows and it’s surprisingly nice. It’s pretty fast and I didn’t have to change my normal configuration at all.
I have not tried windows emacs because I was already going to use wsl anyways. Its important for me to have a decent terminal
hkjels · 2022-12-08 08:26
I have the opposite experience. I started out with WSL, but it was just too slow for a lot of operations. Also the Xsrv part of it was really acting up when switching displays etc. I'm now using Emacs built from source on Windows 10 and I have most of my config running properly. As you mentioned though, Magit is super slow and also eglot on typescript projects. Clojure projects works fine, so I suspect it's to do with the language-server itself
hungry_m8 · 2022-12-08 09:43
i''ve tried both (didn't try wsl GUI tho). only thing i didn't really like about native windows emacs is that magit is slow, and you can't have some packages like vterm
yep808 · 2022-12-08 11:06
Definitely WSL
HappyDancingApe · 2022-12-08 12:33
I use both, and have an init that calls a common config. Can't do some embedded loading/debugging from the WSL side due to USB issues, if it weren't for that, would only use WSL version.
phr46 · 2022-12-08 12:40
What will you use Emacs for?
If you'll be programming on it, consider that by using the WSL, you will be developing Linux software, not Windows. If you go with WSL, it's easier to have all your other tools also installed inside WSL and integrate it all in there; and if you go with Windows, install the Windows versions. If you try to mix, even though WSL can technically run Windows .exes transparently, in practice you'll get into weird issues.
And if you're doing C++ development, like I do, you might end up having two environments set up, with WSL Emacs for all your coding and Linux builds, and Visual Studio just to make sure things still build on Windows once in a while. Because who's got the time to try to make MSVC run through Emacs?
If you're going to use Emacs for org-mode / other tasks, than you probably don't need WSL. Try Native, see if it works well enough.
radian_ · 2022-12-08 16:23
WSL
( but I found WSL2 to be slower (?!?!) so I use WSL1 and GWSL from the Windows store to do the display part )
kdoomsday · 2022-12-08 19:46
I use Emacs 29 with gtk on WSL2. I chose this because it is faster for me than native Windows Emacs. However, copying or pasting to/from Windows requieres some fiddling every time I start the application
shelper9527 · 2022-12-08 23:36
https://shelper.github.io/posts/setup-emacs-in-wsl2/
This is what I did for emacs in wsl2, hope it helps
sen-san · 2022-12-10 01:20
I do want to use files from windows. Need to consider this. Thank you for the input
sen-san · 2022-12-10 01:21
Thank you
sen-san · 2022-12-10 01:24
Thank you. I intend to start using orgmode initially.
phr46 · 2022-12-10 01:35
WSL1 was an attempt to implement Linux syscalls on Windows, similar to what wine does for the Windows API in Linux. WSL2 runs a modified Linux kernel on a lightweight VM, so it has a bit more overhead than WSL1. It's not that surprising depending on what you're doing, 1 could be faster. 2 is usually faster on filesystem calls as long as you keep the files within the VM, and it has better compatibility.
radian_ · 2022-12-10 02:08
Thanks for the extra detail.
In my case I'm working with files not within the vm mostly so that explains it.
(and also audio is smoother in gwsl vs wsl2)
rswgnu · 2022-12-10 04:51
No comparison. The WSL version under X is much smoother except for Windows file access. For that I run a second, Windows-native Emacs.