Idea: etherpad + play.integer32.com


#1

While trying to mentor a student recently, I wanted a way to collaboratively work through an example, but didn’t have a way on-hand to do so.

An obvious solution is to use play.rust-lang.org (or play.integer32.com), but that doesn’t have a collaborative editor, like etherpad.

It seems like it must be pretty easy to combine the two. Etherpad can be embedded, and play also has an API.

Does anybody have the chops to create a simple page that embeds the etherpad.mozilla.org editor and evaluates with play.integer32.com?

Is there some other general solution for this that would require less effort?


#2

That sounds like an awesome tool! At some point I was back-and-forthing with my colleagues, via email, to work something out, we must’ve created a dozen gists, in the period of an hour.

I had a ten-second look at the etherpad embedding link, and it uses an iframe for it. Wouldn’t that prevent styling for the syntax highlighting? I’m not sure how that would play over iframe boundaries, since it wouldn’t be same-origin.

And to contribute: Last week I discovered that etherpad also has an export API.
If you append the pad URL with /export/txt you’ll get the raw version (also works for other formats, e.g. html, pdf, latex)

From the etherpad-lite backup docs:
curl -o mypad.txt https://beta.etherpad.org/p/progress/export/txt


#3

The iframe embedding may cause that kind of problem yeah. I don’t have any experience with it. Even without syntax highlighting it could still be useful, or maybe we could modify etherpad to do rust syntax highlighting and host it somewhere.


#4

This idea didn’t let go of me, so I did some more research. Found nothing specific to EtherPad, but how about this?

https://coderpad.io/

They market it as a tool for interviewing programmers by phone, but it has exactly what we want:

  • Supports Rust
  • Syntax Highlighting
  • Real-time Collaborative editing
  • Ability to hit Ctrl+Enter to run the program side-by-side
  • Bonus: history/playback

I just tried their demo-instance here, feel free to toy around! (Demo Pad expires in 21 minutes from now…)
https://coderpad.io/JNRNPCY4


#5

Oh neat. That is exactly the type of tool I wanted. Thanks @juleskers. Too bad it’s a paid service.


#6

More Research!

Can’t believe I missed this originally:

This succeeds the outdated ep_syntaxhighlighting

And our very own pcwalton wrote a spec for [javascript syntax highlighters to share language definition files]((https://pcwalton.blogspot.de/2010/11/syntax-highlighting-specification.html).
It seems this spec was used for Mozilla Skywriter (defunct) and the Cloud9 cloud IDE.
Cloud9 doesn’t list Rust as a supported language, but does have “see each other type” as a feature. I guess Rust support could be added?
Cloud9 seems way-overkill for a playground application though, they basically want to be your IDE, VCS and CI all in one…


#7

What about https://togetherjs.com/?


#8

Hmm, the website looks promising, considering that it’s apparently already working for jsFiddle and .net-fiddle!
Cool suggestion!


#9

ep_codepad looks promising!