Earlier quoted context omitted.
We're fans of webrtc-rs, but interop considerations pretty much mean that building on top of libwebrtc is necessary for our client libraries for now. `daily-core` is signaling, the (always evolving) low-level trickery needed to scale calls to 10,000+ participants, state management, and an opinionated internal API that lets us efficiently maintain public-facing API features like track management, and device selection.
Are there use cases for calls with so many participants?
How and why Daily is using Rust for our WebRTC APIs
11–20 of 30 posts
Re: How and why Daily is using Rust for our WebRTC APIs
#12What is `daily-core` actually doing? It is signaling code? Have you evaluated webrtc-rs yet? I haven't keep up to date with mediasoup, but I saw they have a rust effort. Have you evaluated that yet? Seems possible to drop lots of C++ dependencies :)
Regarding mediasoup, their Rust effort so far has focused mostly on the server side of things, whereas for this particular project we would be looking more towards the client side.
That would definitely be something we are considering contributing to, as it would, as you say, drop quite a significant amount of C++ (with additional benefits on the web side, too).
Re: How and why Daily is using Rust for our WebRTC APIs
#13Earlier quoted context omitted.
We're fans of webrtc-rs, but interop considerations pretty much mean that building on top of libwebrtc is necessary for our client libraries for now. `daily-core` is signaling, the (always evolving) low-level trickery needed to scale calls to 10,000+ participants, state management, and an opinionated internal API that lets us efficiently maintain public-facing API features like track management, and device selection.
Are there use cases for calls with so many participants?
Re: How and why Daily is using Rust for our WebRTC APIs
#14> This means that whenever we decide to throw the switch to multi-threaded WebAssembly, essentially no code needs to change as all of our logic is already written in a concurrent-friendly manner. We simply reap the benefits of a multi-threaded runtime on the Web. In a multithreaded wasm app, do all threads have equal access to the DOM, or is it more like JS where there is a UI thread which can access all APIs and a b…
Re: How and why Daily is using Rust for our WebRTC APIs
#15> This means that whenever we decide to throw the switch to multi-threaded WebAssembly, essentially no code needs to change as all of our logic is already written in a concurrent-friendly manner. We simply reap the benefits of a multi-threaded runtime on the Web. In a multithreaded wasm app, do all threads have equal access to the DOM, or is it more like JS where there is a UI thread which can access all APIs and a b…
Last I checked, no WASM has direct DOM access, but instead it all has to go through a bridge to JS.
Re: How and why Daily is using Rust for our WebRTC APIs
#16Earlier quoted context omitted.
Last I checked, no WASM has direct DOM access, but instead it all has to go through a bridge to JS.
The question still stands though. Does each individual worker have its own bridge to JS? If so it’s just a constant race condition between them.
Re: How and why Daily is using Rust for our WebRTC APIs
#17Earlier quoted context omitted.
We're fans of webrtc-rs, but interop considerations pretty much mean that building on top of libwebrtc is necessary for our client libraries for now. `daily-core` is signaling, the (always evolving) low-level trickery needed to scale calls to 10,000+ participants, state management, and an opinionated internal API that lets us efficiently maintain public-facing API features like track management, and device selection.
Are there use cases for calls with so many participants?
There are some use-cases in every industry. * Finance/Company: earnings calls as mentioned before, all-hands meetings at companies (with several people queuing for questions and answers) * Live Events (music or talkshows) * Tutoring or education in general. * Healthcare and education -- Surgeries which are broadcast to several schools and have active collaboration from some doctors. The large-scale interaction can begin much earlier before the surgery.
Re: How and why Daily is using Rust for our WebRTC APIs
#18What is `daily-core` actually doing? It is signaling code? Have you evaluated webrtc-rs yet? I haven't keep up to date with mediasoup, but I saw they have a rust effort. Have you evaluated that yet? Seems possible to drop lots of C++ dependencies :)
Hi, I'm João, one of the co-authors of this post! Regarding mediasoup, their Rust effort so far has focused mostly on the server side of things, whereas for this particular project we would be looking more towards the client side. That would definitely be something we are considering contributing to, as it would, as you say, drop quite a significant amount of C++ (with additional benefits on the web side, too).
The server side is the hard part to work on. Also, one of the downsides of wasm is that it can be a pain to communicate out to the JS APIs, especially for doing lots of DOM manipulation. I'm not sure how sound this approach is really. It seems like you're going to do a lot of extra work in order to solve a problem that isn't much of a problem in the first place.
Re: How and why Daily is using Rust for our WebRTC APIs
#19Even if it sounds like it makes sense, something tells me that these (not just this one, all of these kinds of 'why x and y is happening') are really after-the-fact rationalizations after some dev or devs decided to engage in a pet project that would have happened even if it had no sensible justifications at all.
I don't think it matters what the Daily team originally intended. It is exciting/inspiring to me that they are trying to solve things differently. I think security for RTC is really important, so seeing more memory safe language usage makes me hopeful for the future.
All this new code also means people are really learning what goes into these problems. A whole new generation of coders are getting into the space and rethinking things. It is great.
Re: How and why Daily is using Rust for our WebRTC APIs
#20Earlier quoted context omitted.
Hi, I'm João, one of the co-authors of this post! Regarding mediasoup, their Rust effort so far has focused mostly on the server side of things, whereas for this particular project we would be looking more towards the client side. That would definitely be something we are considering contributing to, as it would, as you say, drop quite a significant amount of C++ (with additional benefits on the web side, too).
I'm curious about the approach you guys are taking here. The client side of doing WebRTC is by far the easiest part. Maintaining separate client side implementations for mobile and web is... no harder then maintaining a web and mobile app separately anyways. The server side is the hard part to work on. Also, one of the downsides of wasm is that it can be a pain to communicate out to the JS APIs, especially for doing…
The client-side and server-side code end up being tightly coupled and you end up having a lot more client-side code than maybe is obvious if you're building an application that uses WebRTC in one specific way. For example, handling fast subscription to and un-subscription from batches of tracks is non-trivial, but important if you're implementing "grid mode" client views.
The goal of the approach we're taking here is to be able to support a bunch of different platforms at the same level of performance, stability, and feature parity. Web, iOS, and Android are the three most important platforms. But people are also using WebRTC on Flutter, native Linux, macOS, Windows, Unreal, Unity, and various embedded platforms.