I’m interested to know what the future of remove development with emacs might look like. I’m a long time emacs user, and use rust, lsp-mode, magit and projectile heavily. The remote experience with tramp just isn’t very good. I’ve had to work around several bugs that lead to hangs, and even though I’m only ~20millis away from my remote machine performance is pretty bad. I believe I’ve already done everything I can to make it fast (ssh control master, etc.), and I’m still not happy. On the other hand, VSCode (which I’m not familiar with) or IntelliJ make remote development a breeze. I really like how they hide latency, and handle reconnects well. I’ve also tried terminal emacs on the remote machine, but I just can’t deal with the input lag.

It’s remarkable how emacs has been able to adapt over the years, and so I’m interested to hear about some ideas to keep emacs relevant for this usecase.

  • @troll-gptB
    link
    fedilink
    English
    17 months ago

    I think emacs should adopt vscode remote dev architecture: install a remote server and communicate with it using some rpc protocol. Maybe someone is working on it, I don’t know.

    This discussion should happen on the emacs dev mailing list, if you want to involve the core developers.

  • @astoff1B
    link
    fedilink
    English
    17 months ago

    When possible, I think it’s much better to edit the code locally and synchronize it periodically with the remote. This doesn’t need to be clunky, and is an extension of the fact that you need to periodically synchronize buffer contents with their file a.k.a. save them.

  • @KwisacksB
    link
    fedilink
    English
    17 months ago

    vscode is king here, even jetbrains feels crap compare to it.

    Best solution is emacs on the remote server and get used to the 20ms which doesn’t sound bad IMO, but maybe you have less tolerance than me ;)

    There’s no current solution in emacs for what you want and there could never be so I wouldn’t wait for it.

  • @FrozenOnPlutoB
    link
    fedilink
    English
    17 months ago

    If you run a remote LSP and connect to it from lsp-mode, can the file saves be sent through that? Or does thr LSP only do file checks and refactors and such, not offer raw file get/put?

  • @m0emuraB
    link
    fedilink
    English
    17 months ago

    I’ve been using Emacs w/ TRAMP for remote dev for 3 years. I use lsp-mode w/ clangd, eshell, magit. Because of my setup I can’t build locally, both as the project won’t build on macOS and because it’d probably take 45m-1hr to clean build versus a few minutes on the server.

    I agree that the experience isn’t flawless, despite using ControlMaster etc I still have latency on save/revert, and staging+committing in Magit too. The worst is getting the ssh sessions “crossed up”, where lsp-mode is transferring some data or a grep job is running and I hit C-x C-f, and Emacs locks up, needing a healthy dose of C-g spam to get it back.

    Despite all the problems, I still feel that Emacs is a better remote dev environment for me. I work on a large archaic project with an elaborate build system, multiple “in-house” languages, and Emacs works wayy better for weirdo projects like this than VS Code. The rest of my team, and the company as a whole, uses VS Code and I’ve seen coworkers have it drop out, lock up, and be clunkier than TRAMP in some situations. The amount of configuration to get it working well (especially clangd+lsp) isn’t any easier than Emacs.

    IMO all that Emacs needs to let it stand up against VS Code for remote dev is to improve the performance and polish (latency and lockups). The architecture is fundamentally the same as VSCode, especially if you’re using lsp-mode or eglot. Emacs will never appeal to the “Out-of-the-box” users as VS Code does, but for the power users it should still be fast and work seamlessly.

  • @nimzobogoB
    link
    fedilink
    English
    17 months ago

    He’s talking concept and you’re taking implemenation.

  • @nimzobogoB
    link
    fedilink
    English
    17 months ago

    I almost exclusively use emacs --daemon and then emacsclient to connect to it.

    In my opinion, this model needs to be extended so that emacs daemons can’t accept connections over a network. Maybe piggybacking SSH, or some other socket protocol. Of course, never could administrators would have to enable that port, so there are complications in professional environments.

  • @cat-headB
    link
    fedilink
    English
    17 months ago

    I just ssh into the server and run emacs over ssh. X forwarding works well if the internet is good enough/close enough to the server. All other remote approaches have not worked well for me.

  • @FitPandaFuB
    link
    fedilink
    English
    17 months ago

    With VSCode it requires nodejs on the server side,

    That’s not true.

  • @marcbowesOPB
    link
    fedilink
    English
    17 months ago

    What do you mean by “stabilise things more”? I’m not sure that my experience is bad because of errors, so I’m probably misunderstanding what you’re saying.

    I think the core issue is that software like magit simply wasn’t designed for high latency. If my remote machine was ~0ms away, I think things would work very well with tramp. It seems to me like this is the core problem, and anything that doesn’t address it won’t fix it. VSCode fixes the issue by letting software like magit simply run on the remote machine. It seems like the choice is between that, or rewriting everything to deal with high latency.

  • @nimzobogoB
    link
    fedilink
    English
    17 months ago

    That’s why I said that model needs to be extended. There’s no reason emacs server couldn’t send stuff over a TCPsocket to emacs client. Emacsclient and emacs server are separate OS processes, so they already communicate via external mechanisms.

  • @Different_Aside2564B
    link
    fedilink
    English
    17 months ago

    Is this functionality just used by people trying to use Windows and WSL as a development environment?

  • @jason-reddit-publicB
    link
    fedilink
    English
    17 months ago

    My previous employer did not allow non public source code on a laptop. My solution was to run emacs inside of a screen session (with screen’s C-a mapped to C-t a trick I learned from a colleague since C-t twiddle character isn’t very useful in emacs). This worked well even using terrible cellular wifi and was much better than remote desktop since the amount of data sent per keystroke will typically be quite small.

    Without screen this almost works but emacs could hang sometimes when the connection got dropped which screen solves.

  • @troll-gptB
    link
    fedilink
    English
    17 months ago

    Wrong. Vscode server is a binary blob, it only requires glibc. It doesn’t need anything else, like shells. It even brings its own git.

  • @cat-headB
    link
    fedilink
    English
    17 months ago

    I also use terminal emacs in some cases, but there are a few key bindings which make the graphical version a bit better in some cases. But I mostly only do R/cpp remotely. I don’t know how it is for other languages.