News for hackers. Stuff that matters.
Re:Introducing Google Cloud Shell’s new code editor by cm3 on Wednesday October 19, 2016 @04:32AM (#12742084)
Not criticizing the project, genuinely curious:

It's great that browsers can achieve more functionality previously exclusive to native applications, but anytime a code editor written in JavaScript to be run in a browser is announced, I wonder one thing: why don't we try to come up with a client/server protocol that would allow you to use your local editor, which is already fully customized to your needs? Is the idea that the files being edited are remote and therefore the only thing that would make sense is improving extensions like "It' All Text!" or wasavi?

It ought to be enough if one can trigger opening a buffer in a local editor, which accesses a local webserver provided by your browser, backed by the textarea, and having a means of updating the textarea on save via a POST issued from, say, Emacs to Firefox's textarea-httpd.

Re:Introducing Google Cloud Shell’s new code editor by LoSboccacc on Wednesday October 19, 2016 @06:00AM (#12742448)
Well, the idea is sound, but the timing is wrong. we're past company caring about interoperability, i.e. compare FTP vs WebDAV.

There won't be new open protocols to exchange data for a long while as the whole tech scene is built around growing as a monopoly of a sector.

Re:Introducing Google Cloud Shell’s new code editor by camwest on Wednesday October 19, 2016 @10:19AM (#12743974)
I'm not sure about that. Recently the https://github.com/Microsoft/language-server-protocol has been getting traction. Could that be used instead of a web based editor I wonder?
Re:Introducing Google Cloud Shell’s new code editor by amelius on Wednesday October 19, 2016 @07:06AM (#12742726)
Sad but true. Any ideas what may turn the tide?
Re:Introducing Google Cloud Shell’s new code editor by nojvek on Wednesday October 19, 2016 @10:28AM (#12744072)
Vision. Vscode folks have a great vision for an open source js based editor. They aren't an add on like Google cloud shell, it's built on ground up to be a developers favorite light weight editor.

I'm glad language server protocol is getting more adoption.

Re:Introducing Google Cloud Shell’s new code editor by sytse on Wednesday October 19, 2016 @10:26AM (#12744053)
At GitLab we're exploring an idea that may turn the tide. I agree that online editors don't seem the way forward. The problems are:

- People have wildly different preferences (TextMate, Sublime, Atom, VScode, vim, emacs, etc.)

- It is really hard to get an online IDE right. The most advanced version is probably Eclipse Che and they have an API to do autosuggest by looking in all the files.

Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/22863

"It ought to be enough if one can trigger opening a buffer in a local editor, which accesses a local webserver provided by your browser, backed by the textarea, and having a means of updating the textarea on save via a POST issued from, say, Emacs to Firefox's textarea-httpd."

I think the better approach is to sync the entire directory so you can do global search and replace and autosuggest.

My idea of how to make the IDE sync work:

1. You click on an icon in GitLab, it is next to where we now show the url for the terminal.

2. The icon opens a url, with a schema specific for our solution (although we should open source the protocol so others can reuse it). In the url is the following information: server and project location, pod and container to connect to, a token to identify the user.

3. Beforehand the user has installed a local client that is registered to handle this type of schema.

4. The filesystem of the container is synched to the users machine by the local client (I propose to a default directory system specific to the local client).

5. The local client also opens up the favorite editor of the user (make this configurable with smart default by seeing what editors are installed via which).

6. The local editor talks to an endpoint of GitLab, similar to how our terminal works.

7. GitLab uses kubernetes/docker exec to run unison and fswatch on the container (this is a different approach that the volume approach suggested in https://github.com/leighmcculloch/docker-unison#docker ).

8. GitLab makes a reference implementation of this for MacOS, using unison and fswatch. The community will hopefully make Linux and Windows clients.

What do people think?

Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/22876

Re:Introducing Google Cloud Shell’s new code editor by TylerJewell on Wednesday October 19, 2016 @01:59PM (#12746077)
Hi - I am the project lead for Eclipse Che. While I'd love to take credit for a special API for handling intellisense with languages, we didn't do it alone. We had a proprietary API that we built over a number of years that distributed intellisense using JSON. But when we saw Microsoft's VS Code doing something very similar but for local services, we consolidated into a single "Language Server Protocol" that we announced with Microsoft and RedHat earlier this year. This allows any IDE to plugin to any language. Languages have to provide their own language server implementation that matches the JSON protocol.

In Eclipse Che, we package these language servers for distribution into dynamically deployed agents. so when you start a workspace, your workspace can add a "PHP agent", for example and then we will deploy the language server and then hook up the browser IDE to the language server. To the end user, it feels seamless, but we actually install the language server for them. There are something like 2 dozen languages being built for language servers now. Rust just announced theirs and others are working on C/C++/RAML - even Emacs is getting one. RedHat is working on an advanced Java version and we use CSharp and eventually typescript from Microsoft. We want total interop with VS Code. Eventually Eclipse Orion (an editor) and Eclipse IDE (desktop IDE) will add support.

With Eclipse Che, we provide a simple CLI that lets you live sync your workspace to your desktop IDE. You just "che mount" and we use a fuse-based file system with unison sync to keep the hosted workspaces synchronized with the desktop. You can then use your local IDE and still have your workspaces entirely in the cloud.

These language servers must have access to the project file system, and we are handling that by either embedding the language server into the same container as the workspace, but since we now support compose workspaces where a workspace can be many containers, we are moving all of the language servers to run as separately deployed agent containers. When a user requests a language intellisense, we'll deploy for that workspace an agent container which is volume mounted to the projects in the workspace containers, so that the workspace can have the utilties needed.

Re:Introducing Google Cloud Shell’s new code editor by sytse on Thursday October 20, 2016 @07:40AM (#12751450)
Thanks for the background Tyler. The Language Server Protocol is certainly interesting. We've linked this comment from https://gitlab.com/gitlab-org/gitlab-ce/issues/22876#note_17... let's continue the conversation there.
Re:Introducing Google Cloud Shell’s new code editor by LoSboccacc on Wednesday October 19, 2016 @05:27PM (#12747837)
the amount of replies with people trying should hint you that the solution is far from close

https://xkcd.com/927/ :P

Re:Introducing Google Cloud Shell’s new code editor by stuartaxelowen on Wednesday October 19, 2016 @09:08AM (#12743393)
A new sector arising, I suspect.
Re:Introducing Google Cloud Shell’s new code editor by vbezhenar on Wednesday October 19, 2016 @05:08AM (#12742265)
I guess that most people want to launch a browser and start to work. Installing, launching another application is a burden and if you want to use it, why do you need a browser at all? Just do your work locally.
Re:Introducing Google Cloud Shell’s new code editor by tkinom on Wednesday October 19, 2016 @12:08PM (#12745048)
It is much harder to monitor / monetize you when you just do work locally.

You need to be part of the Matrix.

Re:Introducing Google Cloud Shell’s new code editor by nl on Wednesday October 19, 2016 @05:33AM (#12742357)
Oh, I know this one!

I use 3 different computers regularly, two tablets and occasionally a phone.

I used to try to keep environments synced across them all. That was fun during the 1990s, but I'm over it now.

Now I do as much work as possible in Jupyter notebooks. They suck on tablets, but I never, ever have to worry about having the tools installed anymore.

Re:Introducing Google Cloud Shell’s new code editor by TheAceOfHearts on Wednesday October 19, 2016 @05:24AM (#12742321)
I can't see myself using this regularly, but I can see the value for many people. I can definitely see some value in being able to try stuff out from the browser.

Honestly, having to setup and configure your environment and tools is tedious. When you're unfamiliar with the ecosystem, it can take you pretty long to get everything up and running. I think this is more approachable for the average person.

Re:Introducing Google Cloud Shell’s new code editor by falcolas on Wednesday October 19, 2016 @09:49AM (#12743707)
It's probably just me, but:

"having to setup and configure your environment and tools is tedious"

has never really been a problem for me. Between dotfiles, bookmark backups, and a few choice CLI commands, I can get a *nix/OSX development environment up in under an hour (including downloading and compiling non-standard tools).

Re:Introducing Google Cloud Shell’s new code editor by sitkack on Wednesday October 19, 2016 @12:58PM (#12745469)
The is a lot of mutation. And that is with practice. Wouldn't if it be nice if we could clone fork undo merge dev environments?
Re:Introducing Google Cloud Shell’s new code editor by abysmallyideal on Wednesday October 19, 2016 @11:05AM (#12744415)
I can see how working for Google, there is no issue using their cloud infrastructure... For other companies I don't see the benefit esp since Google is an enormous data broker to the US government and security infrastructure. Microsoft used a similar, yet relatively benign tactic, of copying works created in their dev environment and then pushing out the competition simply through free or cheaper prices.

It just can't be ignored that promising or lucrative businesses, workflows, models using SV infrastructure provided by Google et al, will just be passed off to those passing through the revolving door as "rewards", etc.

Re:Introducing Google Cloud Shell’s new code editor by Sargos on Wednesday October 19, 2016 @09:45AM (#12743667)
Google Drive (the web app) does something similar to this (at a high level anyway). You can open a file from the Drive website in Photoshop, Word, etc and make changes with your desktop software and when you hit save it is actually saving the cloud copy. So the file stays in the cloud but you can use any local software you like or need to be productive.

I believe this uses a Chrome extension at the moment but extensions are also web based for the most part so the idea is solid.

Re:Introducing Google Cloud Shell’s new code editor by z3t4 on Wednesday October 19, 2016 @06:44AM (#12742637)
Or you just paste the code to the editor of choice, then past it back to the browser :P

Or you can invent the edit:// protocol, just like skype:// etc.

Re:Introducing Google Cloud Shell’s new code editor by radriaanse on Wednesday October 19, 2016 @06:49AM (#12742659)
I agree. Eclipse Che seems to be going the right direction with this one. What I've tried so far looks really good even considering it's not around for that long. I Also like there just using Docker for it, so that makes it somewhat more 'standard'
Re:Introducing Google Cloud Shell’s new code editor by moondev on Wednesday October 19, 2016 @09:26AM (#12743541)
Wow just checked it out and seems awesome so far. Are you running the server in the cloud or locally?
Re:Introducing Google Cloud Shell’s new code editor by TYPE_FASTER on Thursday October 20, 2016 @09:04PM (#12757497)
Emacs can do this: https://www.emacswiki.org/emacs/TrampMode

It's really handy.

Re:Introducing Google Cloud Shell’s new code editor by tyfon on Wednesday October 19, 2016 @06:09AM (#12742491)
You can achieve this with version control systems, I do it myself with RStudio web/Jupyter and the git integration. When i want to do something locally i just pull the repository and go at it.