News for hackers. Stuff that matters.
Re:M1 dev setup with a virtual Linux box by tbrock on Sunday April 11, 2021 @07:49AM (#26769622)
This is why running something like VSCode on your Mac with the remote ssh dev setup is the best of all worlds.

https://code.visualstudio.com/docs/remote/remote-overview

Virtualized Linux on x86 AND being able to run VSCode on your Mac for great fonts, WiFi, screen etc without having to fuss with drivers.

Of course ssh and tmux also work well for this purpose.

Re:M1 dev setup with a virtual Linux box by vehemenz on Sunday April 11, 2021 @09:09AM (#26770100)
This is pretty neat, but I think the overhead saved with complete remote development might be cancelled out by using VSCode instead of a JetBrains IDE.

People are advocating remote development heavily, so there must be some *huge* benefit that I don't understand. So much so that people are willing to give up amazing features of an IDE. To get VSCode to a usable state requires 16 third-party plugins, and you're left with about 1/3 of JetBrains functionality, in which the features aren't quite as good. YMMV I guess?

Re:M1 dev setup with a virtual Linux box by cpbotha on Sunday April 11, 2021 @12:04PM (#26771282)
I've been paying for the JetBrains toolbox for a few years now, I'm a huge fan.

However, JetBrains unfortunately has nothing coming close to the transparency and speed of the VSCode remote connection, with your source living only on the remote side.

In cases where being able to work on remote, for example very particular configurations, or docker containers, or WSL2, this makes a huge difference.

For me this is mostly Python and TypeScript these days, where VSCode has grown particularly strong in terms of IDE features.

Re:M1 dev setup with a virtual Linux box by ak217 on Sunday April 11, 2021 @12:11PM (#26771354)
The huge benefit comes in when your project involves loading large datasets or talking to cloud APIs. Both cases can be a non-starter on a local Mac (no local disk space, no bandwidth, or the latency overhead of a 100 ms RTT vs. 5 ms RTT adding up over thousands of requests). I would also point out that Docker on Mac is far less efficient than Docker on Linux, since it runs a separate VM.

VS Code Remote is a game changer. It's how IDEs should work. It allows you to run all the GUI chrome locally for responsive editing, while letting the remote do all the heavy lifting (including building, debugging, testing, and deploying). It finally overcomes the latency and other usability issues of using a wimpy local box to connect to a powerful remote box to write software.

I never used VS Code much and otherwise prefer JetBrains myself. But the remote development extension changed my workflow permanently, and I now recommend it to all my colleagues who develop cloud/data intensive code.

Re:M1 dev setup with a virtual Linux box by oblio on Sunday April 11, 2021 @09:18AM (#26770152)
And Jetbrains is working on a solution: https://blog.jetbrains.com/blog/2021/03/11/projector-is-out/

It's still beta so they have a lot of work to do.

Re:M1 dev setup with a virtual Linux box by GordonS on Sunday April 11, 2021 @01:26PM (#26771924)
Oh wow, I'm a JetBrains fan, but didn't know about this - if it delivers in the same way as the remote extensions for VSCode, it's going to be great!

Have you tried the Projector beta yet?

Re:M1 dev setup with a virtual Linux box by crummy on Sunday April 11, 2021 @06:07PM (#26773919)
I have. It's very impressive but not ready for daily use IMO. (I tested it with IntelliJ).

However, the 2012.1 releases now support running code on via WSL2 or SSH, which is closer to VS Code's setup. https://blog.jetbrains.com/idea/2021/02/intellij-idea-2021-1...

Re:M1 dev setup with a virtual Linux box by oblio on Sunday April 11, 2021 @05:58PM (#26773839)
Yes. It's based on toolkit remoting. Think RDP.
Re:M1 dev setup with a virtual Linux box by arvindamirtaa on Sunday April 11, 2021 @11:38PM (#26775865)
If only Jetbrains added something more modern to sync files with a remote host, instead of the SLOW SFTP way they do it now, I'd be an instant convert.

Recently, I've settled for using my remote machine as the source of truth for my codebase (a monorepo) and only sync specific directories I work with locally.

Remote docker interpreter (python) + this is a workable-enough solution. It's not ideal - I still have to switch to the terminal to run git, tests, etc. Compared to this, the VSCode way is just simply better; especially if you don't use all the features of a full-blown IDE.

Re:M1 dev setup with a virtual Linux box by fossuser on Sunday April 11, 2021 @11:59AM (#26771251)
I hope IntelliJ eventually figures out remote dev.

Benefits are more obvious on massive code bases that take a long time to build, test (or really just do anything).

IntelliJ will get stuck indexing forever and can be frustrating to use - having the code live on beefy servers that can run the computationally expensive bits faster can make a big difference.

Re:M1 dev setup with a virtual Linux box by dangoor on Sunday April 11, 2021 @09:32AM (#26770239)
I think Jetbrains IDEs can do the same thing:

https://www.jetbrains.com/help/go/creating-a-remote-server-c...

Re:M1 dev setup with a virtual Linux box by fossuser on Sunday April 11, 2021 @12:04PM (#26771285)
I think what you linked to is different, but they recently announced working on a real remote dev option: https://blog.jetbrains.com/blog/2021/03/11/projector-is-out/

Their old server config is just pointing to a repo I think, but isn’t remote dev.

I looked into this last year before their recent announcement and at the time they said it wasn’t on their roadmap, but looks like that thankfully changed.

Re:M1 dev setup with a virtual Linux box by stef25 on Sunday April 11, 2021 @10:01AM (#26770430)
> To get VSCode to a usable state requires 16 third-party plugins

You mean this literally? It took just that one plugin for me, when experimenting with using another machine on my network as the dev environment.

Re:M1 dev setup with a virtual Linux box by j1elo on Sunday April 11, 2021 @12:00PM (#26771261)
Believe them, VS Code is a strange beast in that it's really powerful and has a very flexible extension system... but that's a double edged sword because it lets the devs easily ignore features with the excuse that they should be done with a 3rd party extension.

EDIT - child comment is right, the following paragraph is not true! I was writing from my phone and remembered installing this extension [0] but now that I've checked it is for counting offsets from the beginning of the file, not lines and columns. Which I'd concede is not so much of a basic functionality expected in any editor.

[0]: https://marketplace.visualstudio.com/items?itemName=ramyarao...

  And I mean *really* basic stuff... like a status bar label 
  that shows the line and column numbers where the cursor
  is! Yes, you already need an extension just for that.
Re:M1 dev setup with a virtual Linux box by jaredmosley on Sunday April 11, 2021 @12:10PM (#26771351)
I mean, that's just not true. The basic VS Code install will tell you the line and column numbers in the status bar without any plugins.

Usually, the only plugins I need to install is the language server plugin for whatever language I'm using. At least, that works for Go and Python while Node and JS/TS work right out of the box.

Re:M1 dev setup with a virtual Linux box by j1elo on Sunday April 11, 2021 @12:24PM (#26771461)
You're right. I've since arrived home and could check my VSCode, which led me to edit my comment above.
Re:M1 dev setup with a virtual Linux box by vehemenz on Sunday April 11, 2021 @10:15AM (#26770510)
I meant to get VSCode to work as a decent development environment, more generally.
Re:M1 dev setup with a virtual Linux box by hasmolo on Sunday April 11, 2021 @11:16AM (#26770865)
would you expand on this? i'm curious what i've been missing, and what possibilities there are!

for me, a TS using node nerd, vs code does these things well:

  1. ts language server
  2. decent plugins (that i can commit to scm)
  3. yarn 2 support 
  4. nice debugger interaction
is there more for me to have? is the core difference i use so much m$ stuff?
Re:M1 dev setup with a virtual Linux box by vehemenz on Sunday April 11, 2021 @12:49PM (#26771684)
There are too many to list. I'd recommend using a JetBrains IDE to see what it has.

Off the top of my head, VSCode lacks a decent code formatter and a "search everywhere"-type command palette. And the Git and database support is not good either, but that's kind of a given.

Re:M1 dev setup with a virtual Linux box by aryik on Sunday April 11, 2021 @01:31PM (#26771964)
I love the gitlens extension personally - I find it to be a big productivity boost when navigating a complex/legacy codebase.
Re:M1 dev setup with a virtual Linux box by dijit on Sunday April 11, 2021 @08:05AM (#26769711)
Ugh, I don't want to descend into "that thread" again, but Wifi/Screen have not been an issue on linux (as long as you don't use nvidia) in over 10 years.

Mixed scale DPI screens are not a problem if you use Wayland, which is basically the default now.

Font rendering though? YMMV.

Re:M1 dev setup with a virtual Linux box by eknkc on Sunday April 11, 2021 @08:45AM (#26769964)
Nope, you people are living in a fairy tale. I’d love to have a decent linux desktop installation. I spent hours yesterday and gave up.

I have a laptop running Ubuntu and connected to my 4k monitor in front of me. Has an Intel gpu. I do not even want to use multiple displays, I’m gonna go with the external only.

Wayland can do fractional scaling but then VsCode, Firefox, Discord and whatever apps I tried became blurry shit. Firefox has an environment variable to fix it. VsCode has an experimental build and command line flags. I have no idea about Discord. I don’t care if its the app developers fault. It is just plain bad.

X11 can do fractional scaling but fonts are a little blurry for some reason and I have the worst screen tearing I’ve ever seen in my life. It is unusable.

macOS and Windows do this perfectly. It is not something you think about. Windows has some weird looking apps here and there but the shittyneas is not even close.

Re:M1 dev setup with a virtual Linux box by dijit on Sunday April 11, 2021 @10:07AM (#26770465)
I don't know what to tell you, maybe I won the lottery on hardware. (though, admittedly I buy computers with linux support in mind). Everything works completely flawlessly for me (even nice font rendering, though idk if I did something manual for that).

For context, I have (currently) a precision 5520 laptop;

I run arch with sway, I have a big USB-C 4k at work and 2*16:10 FHD Dell USB-C monitors at home.

The only issues I have with linux is that I don't have Microsoft Office, and Zoom+Wayland is buggy as hell.

Re:M1 dev setup with a virtual Linux box by vetinari on Sunday April 11, 2021 @11:17AM (#26770870)
> Wayland can do fractional scaling but then VsCode, Firefox, Discord and whatever apps I tried became blurry shit.

X11 apps do that. Firefox can run in Wayland mode, so run it in Wayland mode. vscode and other electron apps do not support wayland yet, so until they do (yes, they are taking their sweet time), you either need to run with integer scaling, or tolerate them being blurry.

In Windows, the shittyness is much worse. Basically any Qt app is unusable with hidpi in Windows.

Re:M1 dev setup with a virtual Linux box by Kwpolska on Sunday April 11, 2021 @11:51AM (#26771181)
> In Windows, the shittyness is much worse. Basically any Qt app is unusable with hidpi in Windows.

In my experience, it isn’t. On my setup (200% + 100% screens, Retina MacBook Pro in Boot Camp) KeePassXC, qBitTorrent, Qt Designer all look great on both screens; VLC has slightly weird fonts on the HiDPI screen but still works fine.

Re:M1 dev setup with a virtual Linux box by vetinari on Sunday April 11, 2021 @12:09PM (#26771344)
Native Windows 10 on a threadripper machine; display at 175%. QGIS, FME completely unusable.
Re:M1 dev setup with a virtual Linux box by devit on Sunday April 11, 2021 @10:12AM (#26770494)
Don't use fractional scaling.

Use the closest integer scaling and adjust default font sizes (and if needed other sizes like window title height or panel height).

It's also best if you just don't buy monitors that have dpis that are not close to integer multiples of 96.

Re:M1 dev setup with a virtual Linux box by eknkc on Sunday April 11, 2021 @10:27AM (#26770568)
Yeah I tried this but I used 1x ui scaling + 1.5x font scaling. It works but then all the buttons and stuff are tiny.

Maybe I should try 2x gui scaling and 0.75 font size? Never occured to me that I could go below 1 on the scales, it might work.

edit: 2x on wayland is still blurry. 1x + 2x font works but as I said, tiny buttons and stuff.

Still, my point is; why the fuck am I dealing with this?

Re:M1 dev setup with a virtual Linux box by whatever1 on Sunday April 11, 2021 @04:36PM (#26773173)
Because it’s free and nobody is willing to put the effort (and pay the cost) to make a pleasing UX for desktop users.

In mobile where there is market, Google did it.

I stopped trying a couple of years ago (after I got a 4K monitor) to convince myself that desktop Linux is workable.

Linux for desktop = console

Re:M1 dev setup with a virtual Linux box by mixmastamyk on Sunday April 11, 2021 @04:41PM (#26773215)
Ubuntu Mate just works, been using with two 4k monitors for over five years.
Re:M1 dev setup with a virtual Linux box by derriz on Sunday April 11, 2021 @09:40AM (#26770302)
Not according to my experience with a top-spec Dell XPS "developer edition" with Ubuntu pre-installed about 2 years ago. Not only did I have intermittant Wifi connection drops but I was never able to get multi-monitor mixed DPI to work at all with or without Wayland. Even closing the lid/entering sleep mode was broken - the battery would continue to be drained (at about half the rate of non-sleep mode but still unusable).
Re:M1 dev setup with a virtual Linux box by chestervonwinch on Sunday April 11, 2021 @03:42PM (#26772845)
Was the sleep issue not resolved by a BIOS update?

Tangentially, I want to mention that the archlinux wiki is a terrific catalog of machines and their known quirks (and sometimes, fixes for the quirks!).

Re:M1 dev setup with a virtual Linux box by acdibble on Sunday April 11, 2021 @08:17AM (#26769796)
If you use fractional scaling on Wayland, Chromium-based applications will render blurry. Obviously it's a Chromium issue but it's been around for a while and is a bad experience.
Re:M1 dev setup with a virtual Linux box by rathboma on Sunday April 11, 2021 @09:34AM (#26770252)
This just got patched, so electron apps are slowly able to update and fix this. VSCode has a beta version with the fix already
Re:M1 dev setup with a virtual Linux box by josephg on Sunday April 11, 2021 @08:42AM (#26769949)
Linux generally works great. I'm typing this on a linux mint, using mixed scale DPI screens and generally it all works pretty well. I think all my hardware is fully supported - I haven't had to mess with drivers at all. ... Well, not recently. There were some zen3 bugs in the stable kernel releases a few months ago, but it all works fine now.

And thats sort of the theme everywhere. Its super fast and I love it, and its mostly stable and mostly great. But tiny bugs shine through all over. I've been totally spoiled by Apple's spit and polish.

For example, I get random graphics bugs after waking from sleep sometimes. Sometimes my mouse cursor is either invisible or for some reason duplicated, so I see a second stationary cursor hovering over my windows. And for some reason my second display doesn't vsync, so I get obvious tearing when I scroll or move windows around.

I use a trackpad, and smooth scrolling works properly in most apps. But Firefox needs an obscure XInput environment variable to make it work. (That trick is only mentioned deep some a bug tracker). Smooth scrolling doesn't work at all in IntelliJ. Intellij also doesn't let me use the Meta key (Cmd / Start) as a shortcut modifier - so my muscle memory for navigation is all messed up and I can't rebind keys to fix it. I hate how Ctrl+C is copy everywhere except the terminal, which needs me to Ctrl+Shift+C instead. Etc etc. Forever.

Its unbelievably responsive compared to my 2016 MBP though. If you haven't upgraded in awhile and you can afford it, its a fantastic time to get a new system. But linux on the desktop still isn't entirely pain free. Way better than it was a few years ago though.

Re:M1 dev setup with a virtual Linux box by pta2002 on Sunday April 11, 2021 @09:13AM (#26770126)
Do you know what that firefox variable is? It's the only reason I'm not using firefox right now.
Re:M1 dev setup with a virtual Linux box by callahad on Sunday April 11, 2021 @10:30AM (#26770593)
Probably MOZ_USE_XINPUT2=1 (note the '2' at the end)

...or use Wayland where smooth scrolling should work by default

Re:M1 dev setup with a virtual Linux box by seabrookmx on Sunday April 11, 2021 @12:50PM (#26771692)
> Wayland, which is basically the default now

In Fedora maybe. Not in most distros. And recall many apps have to run under xwayland for compatibility so all of those apps won't support scaling properly.

It's still not there yet.

Battery life also takes a huge hit on the Dell XPS and HP Elitebooks I've tried, even after trying to apply some tweaks (not that I should need to). For this reason I use Windows+WSL on laptops even though I'd prefer Ubuntu.

Re:M1 dev setup with a virtual Linux box by barrucadu on Sunday April 11, 2021 @11:32AM (#26770982)
Wayland is "basically the default now"? Since when?