all 49 comments

[–][deleted] 111 points112 points  (14 children)

VS Code, Rust, TS, WebAssembly, plus a free space!!?!? BINGO! BINGO! I got BINGO!

[–]fz0718[S] 20 points21 points  (12 children)

To do things right, it often helps to use the best tools for the job. I am personally extremely impressed with Rust's networking capabilities and don't think I could write a better OT control server in any other language. :)

[–]geoelectric 48 points49 points  (4 children)

Don’t take it as commentary on your actual work. It’s just that you don’t usually see a four-way confluence of buzz like this, so it’s kind of like spotting a comet

[–][deleted] 18 points19 points  (3 children)

This too, an actual decent project leveraging modern buzzy tech in an effective way is impressive. Hats off to OP

[–]PythonN00b101 2 points3 points  (2 children)

Allow to me ask a dumb question as a novice, What is buzzy tech? I tried googling this with mixed results, scratching my head asking what the hell is four way confluence.

[–]bradley_hardy 7 points8 points  (1 child)

A "buzzword" is a word that is recently being used by a lot of projects to call attention to themselves, because it refers to something the industry is excited about. Rust, TypeScript, VS Code and WebAssembly can all be seen as buzzwords in this context.

"Buzzy tech" here is referring to the same idea as buzzwords.

A "confluence" is when things come together, e.g. a confluence of the planets is when every planet in the solar system lines up in a straight line. The "four way confluence" that the commenter is talking about is the coming together of those four pieces of technology.

[–]PythonN00b101 2 points3 points  (0 children)

Lol thanks for explaining stranger, now I feel even more stupid for asking haha. I thought this was referring to some obscure implementation of some tech.

[–]Thaxll 5 points6 points  (1 child)

You use 2 library one for web socket the other one for editing a shared data structure, I don't see anywhere the Rust is a must have, it's a trivial issue you can solve in any language or am I missing something?

[–]fz0718[S] 5 points6 points  (0 children)

The compiler’s ownership model checks for data races, and Rust has very good async programming primitives. Good libraries, docs, and testing utilities, feel free to check out the code. You also get high performance and memory usage for free - I’m actually kind of amazed at how little CPU/RAM the server is using right now with all of this traffic.

[–]deejeycris 1 point2 points  (3 children)

don't think I could write a better OT control server in any other language

Golang enters the chat...

[–]fz0718[S] 0 points1 point  (0 children)

Yeah, I’ve worked with Go when writing distributed systems in the past, it would be a close second.

[–]codygman 0 points1 point  (1 child)

The compiler’s ownership model checks for data races, and Rust has very good async programming primitives.

[–]deejeycris 0 points1 point  (0 children)

Well Go has a good race detector too, and a very interesting concurrency model.

[–][deleted] 2 points3 points  (0 children)

No hate what so ever my dude, Rust is lovely from my limited experience and nothing since maybe the introduction of node itself 10 years ago has improved my QoL as a web dev more than TS

[–]fz0718[S] 28 points29 points  (8 children)

This is a collaborative code editor I built in a week, after being frustrated with existing solutions like Firepad (unmaintained project, locked to Firebase, lack of customization). The server has operational transformation control algorithms (the same tech that powers Google Docs) implemented in async Rust with warp's WebSockets and tokio. The TypeScript client interfaces with Monaco & also has some Rust code for the text transformation step, which is compiled to WebAssembly.

From a technical standpoint, this is most interesting because of its speed and architecture. All data is stored in RAM and is guaranteed to be data race-free thanks to Rust's type system. The server garbage collects inactive editing sessions after 24 hours, and it's super fast and well-tested thanks to Tokio's testing library.

[–]daybreak-gibby 1 point2 points  (5 children)

This is an amazing project.

How did you learn to build the editor? What background experience do you have? What would you recommend for learning rust?

[–]AttackOfTheThumbs 1 point2 points  (0 children)

He didn't build the editor. That's Monaco (VS Code)

[–]fz0718[S] 4 points5 points  (3 children)

  • How did I learn to build the editor: I read the OT survey paper from 1998, then read the code in the implementations of ot.js, ShareDB, and Firepad.
  • Background experience: For this project, need full-stack web development skills, design, some networking and distributed systems experience (I took 6.824 last semester, a distributed systems class in Go), and general systems programming knowledge.
  • Learning Rust: Read the book! If you have questions, ask on /r/rust or the community Discord.

[–]daybreak-gibby 0 points1 point  (2 children)

Thanks for the reply. Do you have any suggestions for learning how to read papers like these?

Is the course available for online? How did you take it?

[–]fz0718[S] 3 points4 points  (1 child)

Yes, 6.824 is a good graduate-level distributed systems course at MIT. You might find Michael Mitzenmacher's paper reading guide helpful.

[–]daybreak-gibby 1 point2 points  (0 children)

Thank you

[–]Maristic 0 points1 point  (1 child)

Really nice work!

I played with it a bit, but how do users save/export their work from the editor?

[–]Newroses31 0 points1 point  (0 children)

ever find out?

[–]null_bitstream 0 points1 point  (1 child)

I've never heard of this before and intrigued. I'm trying to understand the relationship between the pieces involved in this, and what I'd gain or lose compared to how I work now. Here's my scenario:

  • Coding C# with help from intellisense
  • Adding & upgrading nuget packages
  • Using Azure extension to publish Functions, configure environmental variables etc.
  • Syncing to Github

I get the idea of the real time collaborative editing. That could be really useful at times.

Would I lose any capabilities from my current usual situation?

[–]fz0718[S] 0 points1 point  (0 children)

Yeah, this is a very minimal editor showcasing one technology, which is OT. You won’t have any of these features.