
Code together in real time with Teletype for Atom - hswolff
https://blog.atom.io/2017/11/15/code-together-in-real-time-with-teletype-for-atom.html
======
holman
Lovely seeing Nathan and co ship this.

Interestingly enough, this feature is the primary reason behind Atom itself
existing. We saw the first internal demo of "Atom" (I believe it was
"Thunderhorse" at the time) 6-7 years ago, and the main idea was real-time
collaboration on code. That sorta took a backseat for awhile as GitHub started
to recognize that a collaborative editor was pretty swell in its own right,
but glad to see that it's finally all come full circle.

~~~
indescions_2017
This one single feature could potentially have the largest impact on my
workflow in 2018. As much as I love async task management. Real-time
collaboration with remote team members should be fascinating ;)

~~~
chiefalchemist
I guess the next step would be something along the lines of Google Wave where
you could playback the "conversations" and see the learning process develop.

~~~
mandelliant
Damn I miss Google Wave

~~~
mnx
It was opensourced, but apparently nobody wanted to maintain it for free.
[https://incubator.apache.org/wave](https://incubator.apache.org/wave)

------
AriaMinaei
Is it only a coincidence that real-time collaboration is being announced both
for Atom and VS Code
([https://news.ycombinator.com/item?id=15704376](https://news.ycombinator.com/item?id=15704376))
at the same time?

~~~
api
Why is there breakneck competition here to offer the best free code editor?

~~~
alfonsodev
I guess that when users make the habit of using the free tool, then the
company that provides it can easily embed other convenience habits that could
potentially lead to a future sale.

Both Microsoft and Github have commercial products to sell at a later stage,
VSCode has now integrations with Azure, I don't know about Github integrations
on Atom but the potential is there.

When the user is using your free tool you are one step closer to provide
something additional that is so convenient that is hard to say no, even if is
paid.

~~~
bruno207
They're working on making Atom + Github to be a 1-1 association in your Git
workflow. See [https://github.atom.io/](https://github.atom.io/)

------
stephenr
Every time I see one of these "code together in real time" announcements I
remember SubEthaEdit, which did this flawlessly 14 years ago, _and_ released
the collab part as a library that other apps can use: Coda uses (or at least
used, I haven't used Coda in years) it and is/was compatible for sharing.

[https://subethaedit.net](https://subethaedit.net)

~~~
spronkey
Too bad it had a terrible name...

~~~
sedatk
Why do you think it’s bad?

------
mrspeaker
Not sure this is wise, but I started a test portal
252510f8-e474-45e0-bec1-5714435fa305 if you want to give it a whirl.

Edit: it's still working great even with 15+ people - very slick!

Also, here's the madness in repo form -
[https://github.com/mrspeaker/teletest](https://github.com/mrspeaker/teletest)

~~~
Klathmon
I'm curious, how was the performance with all of that happening? (i'm assuming
at some points you had 10+ people in there at once?)

~~~
mrspeaker
I just stopped sharing the document. I was just running it over crappy cafe
wife for 2.5 hours, max ~20 people, always 5 to 10... performance seemed
fantastic - didn't tax my lappy at all. Very impressed!

[Re-shared it at 28e6c3b4-754c-44ef-9406-869604db9db5 - it would be good if
you could keep a UUID somehow, but I guess that's unfeasible]

~~~
sillysaurus3
Someone please build a game around this premise. 15+ people having fun in a
shared simulation is prime territory for game ideas.

~~~
photojosh
Which premise? Isn't that just re-inventing multiplayer gaming?

Or do you mean targeting web games, much like was discussed in this HN post:
[https://news.ycombinator.com/item?id=13264952](https://news.ycombinator.com/item?id=13264952)

------
jitl
See also Floobits, which is a fully-realized, production ready service that
allows collaborative real-time editing of your editors entire workspace.

Floobits has plugins for all major editors, including Vim and IntelliJ, as
well as Google Hangouts.

[https://floobits.com/](https://floobits.com/)

Disclosure: I used Floobits a few times and think it’s awesome 10/10

~~~
elliotec
Floobits does not work. I've tried it several times hopefully. It simply
doesn't do anything.

Please enlighten us to how you got it to work at all. I use neovim.

~~~
jitl
It's worked great for me in Sublime and Intellij. I've never tried it with
Neovim :(

------
twitchard
My team at the Node Knockout hackathon implemented an editor-agnostic version
of this feature last weekend. I guess it is an idea whose time is come.

[https://www.nodeknockout.com/entries/35-nodeist-
colony](https://www.nodeknockout.com/entries/35-nodeist-colony)

For me, the editor-agnosticism is the most important feature I would want my
live coding experience to have. My team uses a mixture of Vim, Sublime, Emacs,
VS Code, and Atom, and we have configurations we are comfortable with. It's
too bad that this seems to be happening well within the confines of each
editor's ecosystem, and not by some common protocol that all editors could
share.

~~~
cbcoutinho
The team behind this feature think that editor-agnosticism is also really
important, that's why they split up this project into atom-teletype and
teletype-core. AFAICT the 'core' library could be used to implement a package
in any of the electron based editors.

~~~
derefr
Could the protocol implemented by teletype-core be (easily) spoken by a non-
electron editor, or is there an inherent impedance mismatch where e.g. the
protocol structures its data in ways amenable to DOM manipulations of text but
not to other text buffer formats?

~~~
maxbrunsfeld
The protocol isn't coupled to the DOM or Electron in any way. The one thing
that makes it easier to implement in electron is that it uses the WebRTC
standard for peer to peer connections.

~~~
Karrot_Kream
WebRTC is a beast of a protocol to implement, and so far browsers have had the
canonical implementation. There's a few C++ libraries out there, but even then
it's a lacking ecosystem.

------
juretriglav
So glad to see that they've implemented this algorithm in JS!
[https://github.com/atom/teletype-crdt](https://github.com/atom/teletype-crdt)

I've tried implementing a very similar algorithm (one could say it's the same
approach) in the beginning of this year, but had one remaining issue with
concurrent overlapping deletions that I couldn't figure out (and the paper I
was basing the algorithm on didn't account for it:
[http://www.sciencedirect.com/science/article/pii/S1474034616...](http://www.sciencedirect.com/science/article/pii/S1474034616301811)):
[https://github.com/jure/rgass](https://github.com/jure/rgass)

Weihai Yu's implementation does account for it, however:
[https://dl.acm.org/citation.cfm?doid=2660398.2660401](https://dl.acm.org/citation.cfm?doid=2660398.2660401)
, but his implementation is in Lisp, and I've never had the stamina to work
through it for that one edge case.

Kudos to the team at GitHub, I'll be studying this implementation closely.

~~~
AriaMinaei
I found this blog post on this subject very approachable:
[http://digitalfreepen.com/2017/10/06/simple-real-time-
collab...](http://digitalfreepen.com/2017/10/06/simple-real-time-
collaborative-text-editor.html)

~~~
juretriglav
That's a nice blogpost! It does describe char-based CRDTs nicely, but the
RGASS/teletype-crdt algorithms are string-based, which brings a lot of
headaches, as you can have insertions that split existing nodes, etc.

~~~
AriaMinaei
Would love to learn how the two approaches differ from each other. The string-
based one _sounds_ more space efficient.

------
reaperducer
This reminds me of that rant from last week about how computers are less
functional these days than they were in the 80's. The reason is that the Amiga
had cooperative document editing way back when. (Sorry, can't remember the
programs that supported it.)

/Some version of AmigaDOS also had truly relative timestamps. So you might see
a file last accessed "Christmas, 1991."

------
learningcn
I have the same idea on Sublime Text about 4 years ago, but due to the Sublime
API restriction at that time, it's dead on 2014. I have no idea is the Sublime
API now well enough to implement this feature? My project:
[https://github.com/learning/SublimeTogether](https://github.com/learning/SublimeTogether)
And a screencast: [https://vimeo.com/96316581](https://vimeo.com/96316581)

~~~
halfnibble
I'd pay for that if you ever make it.

------
kleiba
"Sharing the same physical machine is impossible for remote teams" \-- if only
there was some kind of network that would allow people to log into a machine
remotely...

More seriously, though, in the mid-90s, I worked at a place where most work
stations were Sun Sparcs. One way of "coding together" was that one person did
an xhost+ to allow a second frame of an Emacs running on a second person's
machine to be opened on the first person's display. It was used only very
rarely, though.

~~~
jhoechtl
Wayland destroyed that 20+ year old X feature though

------
_pferreir_
This looks really neat. As a side note, it bothers me a bit that they haven't
used an actual URI, e.g. tty:xxxxxxxx-xxxx-... That would allow for nice
hyperlinks from web pages and chat rooms.

------
rahilsondhi
If you wish this existed in a SQL editor, we have it in PopSQL
([https://popsql.io](https://popsql.io))

------
liamdanielduffy
“participants all keep their own custom key bindings, packages, and themes.”

what happens when two different people editing the same document have two
different settings for # spaces per tab character? whose takes precedence? (Or
would there be a possibility of inconsistent spacing depending on who is
adding a tab?)

~~~
llimllib
I would guess that tab -> spaces happens locally, and then the spaces are
what's sent over the wire. So it would be whoever inserted the tab. (What
other possibility could there be?)

~~~
MsMowz
Why would spaces be sent over the wire?

~~~
RussianCow
Why wouldn't they be? How else would you envision indentation working?

~~~
thedaniel
Well, one of the people in the scenario uses tab characters, not spaces.

~~~
hobofan
Why would someone do that? _ducks_

~~~
spinningarrow
Because indentation is subjective (and is different from alignment)

------
kakuri
For VS Code there's sockscode, it's a little bare, but works well!
[https://marketplace.visualstudio.com/items?itemName=shyykose...](https://marketplace.visualstudio.com/items?itemName=shyykoserhiy.sockscode-
vscode)

------
habi
Yet I'm still not able to save a file when it's on a network drive:
[https://github.com/atom/atom/issues/11911](https://github.com/atom/atom/issues/11911)

------
bousaid
Atom’s detriment with this post is that there’s 4 paragraphs of text before I
can even see what this feature looks like, and even then it’s gifs on how to
install the feature.

~~~
level
The marketing site does it better [1].

[1] [https://teletype.atom.io/](https://teletype.atom.io/)

------
eecks
How does this work? Does the code that is typed go through a cloud service? I
guess that would stop a lot of people using it in work.

~~~
dflock
In the case of Atom, no - it's peer-to-peer - github servers are only involved
with initial connection. Probably the same for VS code, but not looked.

~~~
eecks
Ok, that's pretty cool. Thanks - had a quick scan of the page but didn't see
that.

------
Animats
It's amusing to see this while building in Second Life. The Second Life build
tools are a 3D CAD system with real-time collaboration in virtual reality.
Several people can be editing the same set of 3D objects simultaneously.
Others can stand around and watch, from different viewpoints.

Doing this for text is trivial by comparison.

~~~
freeall
Your comment led me to figuring out if Second Life is still really a thing.
And I can't really figure it out. Apparently Linden Lab has over 200 employees
so there must be some revenue on it. But is the user base growing, and how big
is it?

~~~
Animats
The user base is flat, but the revenue keeps coming in. About 250 employees,
down from a peak of 350, and about $66M in revenue.

Linden Labs is developing something new, called "Sansar", for virtual reality
users. It's closer to a video game than a simulated world; it's a platform for
"experiences", which are essentially third party games. Whether that works out
depends on whether VR gets any traction. Second Life also might get a boost
when the new Amazon "Snow Crash" series airs. Second Life is the closest thing
to the "metaverse" of Snow Crash.

Second Life is interesting because it is an Internet system that isn't the
World Wide Web. It's not HTTP based. It doesn't use HTML or Javascript. It's a
huge system of its own. It has a social network, with members, groups, and
text and voice chat. Strangely, about 40% of avatars never move; they just use
the chat functions.

There's a whole world in there that is totally independent of Google and
Facebook.

------
fjabre
I can appreciate your efforts here. It isn't trivial to put something like
this together but I'm going to go ahead and state the obvious: Face to face is
far superior to a solution such as this one for what I think are self evident
reasons. You're better off, by orders of magnitude, getting on a plane or
train and going to see your code buddies.

When I'm coding with someone we're not usually on the same files or piece of
code anyway. And I don't get any value from seeing them type away at the code
file that they are focused in, or knowing which file they're in beyond the
name. It's a simple "hey mate what line are you on?" question.

I get excellent value from talking to and seeing the other devs face to face
figuring out where their head's at and what 'page' they're on. That's the
stuff of a proper realtime and face to face code sesh IMHO.

~~~
seveneightn9ne
Being together in person doesn't solve the problem of wanting to edit the same
code simultaneously. For some projects, git is enough, but for something
really small this seems like it would really help.

~~~
fjabre
I'm not saying it isn't a legitimate problem but I've never had it.

For me, if we're not using git I could get the other dev's latest changes by
simply doing a file copy of whatever I needed and then get it into my own
environment. I work offline with most of my dev mates. We are rarely ever
coding at the same time of day given time zone differences and sleeping
patterns.

If we're a small team we're probably quite aware of where the other one is in
the code and what they're working on. I don't need real time for that.

I think being able to see the other dev type in real time in the same file
doesn't solve anything for me and may in fact be distracting and counter
productive. I'm not sure 'real time' fits here.

~~~
brandall10
"We are rarely ever coding at the same time of day given time zone differences
and sleeping patterns."

This is to aid pair programming. I work on a remote team as well, but there
are times we pair when hashing out of a particular issue that either myself or
one of my teammates is having. It's far quicker to do this than to work
disconnected and go back and forth, esp. if it may impact the schedule/sprint.
In the past I've worked with devs that had as much as a 10 hour time
difference and we literally scheduled times where our schedules crossed so we
could pair on a specific issue. One person drives at a time but it's common to
switch back and forth so tools like this are helpful.

------
120bits
I have never tried real time collaboration. What scenarios are there when you
need real time collab. I know technical interviewers prefer this. Do you think
it causes distraction when you have 2 people writing code on a same file. I
would rather one finish and then do my stuff.

~~~
Antrikshy
Ever been to a hackathon? It's hard to coordinate over Git when you're just
getting started on a codebase and there's barely anything for the 3 other
people to work on. I've used Cloud9 for this very successfully in the past.

------
Tomis02
A lot of effort put into "dumb" text editors, but we still don't have (to my
knowledge at least) a truly cross-platform / cross-backend IDE that will allow
you, for example, to open .sln/.cmake/.make/whatever projects/solutions and
provide you with a nice interface to change project settings or even compiler
used. This could save a lot of development time and improve productivity, and
I'm sure it's a much more useful and common use case than collaborative
editing.

~~~
OOPMan
IntelliJ is pretty close to what you want...

------
killnine
Really gave atom a hard try. Back to notepad after a few months. The add-ons
are the only advantage, but are grossly overshadowed by the resource
consumption this behemoth requires.

~~~
melling
Yeah, someone complains about the resource usage in every Atom post.

I feel likes it's a rehash of emacs vs vi debate from 30 years ago. Emacs
needed many megabytes more than vi so people wouldn't use it.

As time goes on the resource usage becomes less of a problem. My 4 year old
laptop has 16GB of RAM and I don't really worry about it. I'll get 32GB or
64GB in my next computer. I never liked quibbling over memory. My time is much
more important to me and I want the best tools. I also want them to swim in
RAM.

~~~
outworlder
Yes, Emacs stands for "eight megabytes and constantly swapping". How silly
this sounds today.

I wonder why do those people even care.

The only time I look at my resource usage is when apps start to behave funny.
Or when it's an app that I am developing. Other than that, why should one
care?

One argument could be made that they are using memory wastefully. Not sure
that's the case. The baseline memory consumption is higher, so what? It's a
tradeoff. It's easier to build a better editor using browser-based tools, as
much as I like Elisp. Over time Atom and VSCode will close the gap.

Now, if there is a memory leak, or memory increases non-linearly with the
workload, than it could be a problem. VI and Emacs are pretty great with large
files (Emacs not so great with long lines), browser-based editors usually do
not work as well. But there is no reason they shouldn't, it just takes
engineering effort.

~~~
YaLTeR
A text editor using 600 MB of RAM to open a file is ridiculous. That with a
couple of Chrome tabs grinds my laptop to a halt.

~~~
outworlder
Why? Unless that pushes you to swap, that is not the cause for your slowness.

------
sleepybrett
I miss subethaedit

------
fro0116
Curious if this supports multiple-cursors (as in multiple cursors per user
through ctrl/cmd+d, etc)? If so that'd be awesome!

~~~
jasonrudolph
It does indeed.

~~~
fro0116
Beautiful!

------
d--b
Am I really the only one on this forum to think that live shared coding is a
terrible idea?

The only pro for this is there are no conflicts, so merging is easier.
However, live conflicts are still bound to happen if 2 people want to work on
the same section of the code, right?

And the cost of this is the total unability to debug...

I don't get it...

~~~
djsumdog
I've only done direct pairing twice. It can help come up with a game plan and
get new people in the company up to speed, but it is terribly terrible
stressful.

I don't like it. I think small services, incremental changes, strong tests and
solid code reviews all work much better. Especially the tests and code
reviews. At my last shop the company had an internal Gitlab and we used the
Gitlab CI. Reviews + CI really helped keep the coding standards pretty high
and helped younger devs not make beginner Scala mistakes coming from a Java
background.

------
serg_chernata
Is there anything like this for sublime?

~~~
SCdF
Apparently the protocol can be implemented by any editor, so hopefully we'll
end up in a glorious future where this works in lots of browsers (including
VSCode, who just announced their own version of this)

Edit: can _in the future_ , not now. So we'll see

------
zhughes3
What would a git commit look like when two distinct programmers have inputted
characters into the file?

~~~
brianmario
One common way to attribute multiple authors in a commit is to add a `Co-
authored-by` commit message trailer. You can read more about git commit
trailers at [https://git-scm.com/docs/git-interpret-trailers](https://git-
scm.com/docs/git-interpret-trailers).

As an example, if this was a commit message, the trailer adding my attribution
would be like this:

`Co-authored-by: FirstName LastName <myemail@domain.com>`

------
ncfausti
If you haven't seen Colaboratory from Google check it out. This, but for
jupyter notebooks.

[https://research.google.com/colaboratory/faq.html](https://research.google.com/colaboratory/faq.html)

------
BoiledCabbage
I don't use it at all, but hasn't emacs supported this since the 80s or 90s?

~~~
scbrg
Not sure if there's been a way to integrate separate emacs processes, but it
has always been possible to launch a new frame (emacs speak for window)
displaying the same buffer, and given network transparency in X, have it
displayed on any remote computer running X.

~~~
dleslie
You can run an emacs server and operate out over ssh, if you want, sharing the
buffers across many remote clients.

[https://www.gnu.org/software/emacs/manual/html_node/emacs/Em...](https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-
Server.html)

Although if you're doing remote editing you probably want to use Tramp.

[https://www.gnu.org/software/tramp/](https://www.gnu.org/software/tramp/)

------
tomaskafka
The use cases don't need to be remote. Really looking forward to a
chrome/firefox plugin that would sync a textarea with a new Arom/VS code
buffer!

(Why? How many of you have edited some config/sql query/... in past week?)

------
oldpond
Google brought out something similar in 2012
[https://code.google.com/archive/p/collide/](https://code.google.com/archive/p/collide/)

------
dunham
Back in college (late 90's) I did collaborative class project (in Z notation)
with XEmacs and a partner on a remote X server. It actually worked as long as
one of us wasn't in the minibuffer.

------
LukeB42
If you wish this existed for web pages:
[https://github.com/psybernetics/synchrony](https://github.com/psybernetics/synchrony)

------
tangus
Does anybody know how does undo work with this feature?

------
nkkollaw
I can't make Atom work without freezing for myself, I can't imaging using it
with more than one person at the same time.

------
idontknowman
This looks like a cool feature to use to teach.

------
cirowrc
That's pretty nice, kudos! By the way, I'm impressed no one mentioned tmux'
remote session in this thread.

~~~
ospider
yeah, tmux and vim could do the same thing.

------
xrd
Anyone using this to edit Android source files? I need to look and see if
Android Studio has anything similar.

------
Dowwie
What software would you use to provide group voice chat for a screen share
session? Discord?

~~~
gh02t
I've used Riot ([https://riot.im](https://riot.im) , built on Matrix) and it
worked very well. Voice chat is still in beta but I haven't had any trouble
with it.

------
ovrdrv3
Awesome! It worked with the same github account over two computers as well!
This is exciting.

------
mundanevoice
This is super neat. Would be awesome debugging with my teammate when I am
working remotely.

------
jimnotgym
Were Microsoft and Github using some kind of collaboration tool? Calendar
syncing perhaps?

------
peterkelly
Am I the only one who finds it ironic that the development teams behind the
top two open source editors introduce support for collaborative editing on the
dame day, apparently unaware that they were both working on the same thing,
and there being no evidence of collaboration between the two?

~~~
krallja
> top two open source editors

I must have missed the announcements for vim and Notepad++.

~~~
pvdebbe
Interesting way to spell Emacs

~~~
rhabarba
Because Emacs could do that before Atom's devs were even born.

------
obilgic
Can Atom be the twitch for coding with view only teletype?

------
buryat
I wish there was something like this for Intellij.

~~~
sscotth
Floobits works with Intellij as well as Neovim, Emacs, Sublime, and Atom.

I'd like to explore whether Teletype can be used across editors in a similar
manner.

~~~
fro0116
It's almost certainly _possible_. See under "Editor-agnostic client library",
and [https://github.com/atom/teletype-
client](https://github.com/atom/teletype-client)

------
Dryken
I so want this for visual studio code now :)

Really cool stuff !

~~~
GilbertErik
You mean something like this?

[https://code.visualstudio.com/blogs/2017/11/15/live-
share](https://code.visualstudio.com/blogs/2017/11/15/live-share)

------
hrkucuk
What had to be done, is done. Thanks.

------
shmerl
Why is Atom still missing in Debian?

------
tbodt
I just want this in vim.

------
LesZedCB
i prefer this over floobits in that i don't need a floobits account, just a
github account, which pretty much all devs will already have. it would be nice
if there was a way to do this without needing the github account though.

~~~
sleepybrett
With floobits though you can go ahead and use atom while I chill in vim or
sublime. It doesn't demand that you both use the same editor.

~~~
LesZedCB
for now. since this is the framework, I think we'll see plugins for other
editors soon enough.

------
AbenezerMamo
Amazing! Love it :)

------
s09dfhks
any way to use this WITHOUT a github account?

~~~
neilparikh
You can run the server yourself I think: [https://github.com/atom/teletype-
server](https://github.com/atom/teletype-server)

------
Layuso
code in real time with atom?

------
faaq
Amazing!

------
minicoolva
I'm using vs code now

------
jnordwick
[A] [T]on [O]f [M]emory

------
kimjongman
How safe is this?

