News for hackers. Stuff that matters.
Re:Notepad++ is 21 years old by 8n4vidtmkvmk on Friday November 01, 2024 @04:11PM (#42021044)
I think I'm one of the last people using WSL1. I think everyone jumped to WSL2 because 2 is bigger than 1, but they're really different things. WSL1 lets me keep my files on the Windows side, let's my IDE (PHP storm) remain performant with no Linux to Windows file system overhead, but I still get to use all the Linux CLI tools. I still pay some overhead for that, but it's better than doing it the other way around and paying for every keystroke in my IDE.

What I really want is a damn good Terminal/Emulator for Windows AND Linux that can run the same set of tools with zero overhead. Boggles my mind that everything is slow and janky to this day.

Re:Notepad++ is 21 years old by mrweasel on Friday November 01, 2024 @04:17PM (#42021110)
Wait what? I'm not a Windows user, so I haven't used any version of WSL, but WSL 2 doesn't store the files on the Windows side? It seems to me that the whole "easy access to your Windows files in a Linux environment" was the point of WSL.
Re:Notepad++ is 21 years old by roland35 on Friday November 01, 2024 @04:20PM (#42021154)
Wsl 2 can access files in windows, but it is very slow.
Re:Notepad++ is 21 years old by nuancebydefault on Friday November 01, 2024 @04:52PM (#42021445)
With the benefit of Linux and its filesystem being super (natively) fast in WSL2.

What I've very often done is use command line tools like compilers, search&replace etc inside WSL2, in a Windows terminal. You have the benefits of speed and all the CLI tools of the Linux world. And then have the GUIs, like vscode, running on Windows. Vscode has its server running on the WSL side, so still very good performance.

Best of both worlds, since the GUIs and the CLIs are tightly integrated.

Re:Notepad++ is 21 years old by 8n4vidtmkvmk on Sunday November 03, 2024 @12:02PM (#42034243)
That's the crux of the issue. Vscode works ok because you can run it as a server, but other IDEs (yes there are others) are slow.
Re:Notepad++ is 21 years old by peterfirefly on Friday November 01, 2024 @09:12PM (#42023246)
WSL1 is really just a new system call interface for Windows.

WSL2 uses "disks" emulated via image files that are stored as ordinary Windows files (but in a secret place). This makes most file I/O from inside WSL2 faster than from inside WSL1.

WSL2 can use the Windows file system (and vice versa) via file servers.

When a Linux app inside WSL2 wants to use a Windows file, the Linux kernel (there is only ever one for all running WSL2 images!) talks to a Windows app that does the file serving.

When a Windows app wants to use a Linux file from a WSL2 image, the image first has to run (might take a little while for it to boot) and then a daemon there serves the file to the Windows app.

I think one of the file servers use a version of the 9P protocol. Maybe they both do.

https://en.wikipedia.org/wiki/9P_(protocol)

Things that do lots of file I/O (such as compiling) are way faster under WSL2 using local file systems than under WSL1.

Re:Notepad++ is 21 years old by B1FF_PSUVM on Friday November 01, 2024 @04:17PM (#42021118)
> one of the last people using WSL1.

(waves). Yep, it does "the needed".

"2 is bigger than 1" can take a hike.

Re:Notepad++ is 21 years old by augustk on Friday November 01, 2024 @05:11PM (#42021597)
MSYS2 is quite decent. I use it everyday at work where I have to use MS Windows.

https://www.msys2.org/

Re:Notepad++ is 21 years old by dgfitz on Friday November 01, 2024 @05:23PM (#42021691)
Msys2 is really great, I also daily drive it when I’m on a windows box.
Re:Notepad++ is 21 years old by EasyMark on Friday November 01, 2024 @07:14PM (#42022484)
Yeah I switched from cygwin to msys2 a few years ago, it works quite well for most things, seems a little slow when scripting though, as windows process forking is slow af. It kind of pushed me to learn a lot more python and switch over from bash which was my primary scripting language for various tasks, msys python is roughly as fast as straight windows python install
Re:Notepad++ is 21 years old by TeMPOraL on Friday November 01, 2024 @05:24PM (#42021702)
I was like you until last year. I did all my development from Emacs on WSL1, writing mostly Windows-specific code (DCOM). I maintained a set of brittle hacks to allow me to drive Windows side CMake and MSBuild straight from Emacs, and then run LSP on compile commands from Clang tricked into thinking it's cross-compiling. It held up surprisingly well.

Eventually, I installed a WSL2 distro so I could run Docker, then I had to reimage the machine because corporate reasons, and then, with my work involving less Windows-specific code, I decided to not recreate my pile of hacks, but start with a fresh WSL2 setup. It works well enough, so that's what I use now.

FWIW, I always liked WSL1 more. WSL2 is basically just more streamlined VirtualBox setup; WSL1 is magic.

Re:Notepad++ is 21 years old by nyarlathotep_ on Friday November 01, 2024 @08:40PM (#42023068)
Genuinely impressed at this bespoke approach.
Re:Notepad++ is 21 years old by nine_k on Saturday November 02, 2024 @04:03AM (#42024808)
WSL1 reminds me of coLinux of old times.

https://en.m.wikipedia.org/wiki/Cooperative_Linux

Re:Notepad++ is 21 years old by chungy on Saturday November 02, 2024 @04:33AM (#42024932)
That's more comparable to WSL2 than WSL1.

WSL1 is a subsystem on the NT kernel, allowing Linux binaries to run natively on Windows itself (not a virtual machine). It's the spiritual successor to Interix, that showed up in NT 4.0 and was removed in Windows 8.

The flip side is Wine, allowing Windows binaries to run natively on Linux.

Re:Notepad++ is 21 years old by HeavyStorm on Saturday November 02, 2024 @09:54PM (#42030655)
Actually, it's a streamlined Hyper-V setup, rather literally.
Re:Notepad++ is 21 years old by 8n4vidtmkvmk on Sunday November 03, 2024 @12:06PM (#42034269)
You run emacs on the Linux side now though, right? So you're probably better off that way.
Re:Notepad++ is 21 years old by underdeserver on Friday November 01, 2024 @05:34PM (#42021776)
Remember Cygwin?
Re:Notepad++ is 21 years old by ale42 on Friday November 01, 2024 @05:44PM (#42021861)
I mainly remember (mostly) not wanting to install it because of the so many weird things it does, or rather it did when I last used it more than a decade ago (including strange NTFS ACLs to emulate POSIX permissions).
Re:Notepad++ is 21 years old by i80and on Friday November 01, 2024 @05:51PM (#42021911)
I remember Steve Yeggie selling me on it as a better Unix than Unix, then getting bogged down in cryptic inexplicable failure modes

Really cool technology really early, but I can't say I'm nostalgic!

Re:Notepad++ is 21 years old by SoftTalker on Friday November 01, 2024 @10:29PM (#42023625)
Yep, I used it a lot. Made Windows tolerable.
Re:Notepad++ is 21 years old by nocman on Saturday November 02, 2024 @12:52AM (#42024146)
What do you mean "remember"? It still makes using the command line in Windows tolerable. And yes, I am familiar with PowerShell, and NO I'm not interested in using it.
Re:Notepad++ is 21 years old by 725686 on Friday November 01, 2024 @06:28PM (#42022184)
Completely off topic, but I was a Linux user for years, then I had to use Windows with WSL2, and it was a constant struggle. I recently switched to a Mac M3, and oh boy, it is a pleasure to use. No more fighting the Windows/WSL divide, slowness and command line tools. Also M3 is a really fast beast.
Re:Notepad++ is 21 years old by kccqzy on Friday November 01, 2024 @07:03PM (#42022414)
It sounds like you would be happier with WSL1. It also has way less divide between Windows and WSL.
Re:Notepad++ is 21 years old by dataflow on Friday November 01, 2024 @07:26PM (#42022573)
> I think I'm one of the last people using WSL1.

I think you're the second-to-last one :-)

Re:Notepad++ is 21 years old by CoolCold on Friday November 01, 2024 @11:19PM (#42023814)
I still run one distro on WSL1 - the fact it shares network with "main" Windows helps me to do simpler TCP proxying when needed. So you are not alone ;) While WSL1 is nothing bad, the most of things I do involving WSL happens in WSL2.

Not to say you are doing something wrong - whatever suite your needs. For me, WSL2 provide Linux tooling, i.e. systemd, which WSL1 just cannot by design. The very same way managing system as I do on servers.

When it's possible/makes sense, I do run gitlab-runner in my WSL2 for easier builds debugging, when setting up new projects for programmers - comparing to 250-300+ ms latency working on remote hosts, it's often much more productive.

Basically stable Linux without fighting with Linux-on-desktop-year-to-come.

Re:Notepad++ is 21 years old by roeles on Saturday November 02, 2024 @11:48AM (#42027088)
Work only permits wsl1. I use vs code with the wsl1 plugin. The editor runs on windows, but it is as if you're on Linux. Terminal is Linux, Filesystem looks like native Linux...
Re:Notepad++ is 21 years old by drchap on Saturday November 02, 2024 @11:13PM (#42030928)
Have you tried WezTerm? It is a modern, performant, and full-featured cross-platform terminal written in Rust.

https://wezfurlong.org/wezterm/index.html

Re:Notepad++ is 21 years old by 8n4vidtmkvmk on Sunday November 03, 2024 @12:08PM (#42034290)
I have not. Native mouse and scrollback is one of the important things I want. I'll give it a go, thanks!