News for hackers. Stuff that matters.
Re:Using Rust in Non-Rust Servers to Improve Performance by mplanchard on Monday October 28, 2024 @10:53AM (#41971605)
Is there an equivalently easy way to expose a native interface from C to JS as the example in the post? Relatedly, is it as easy to generate a QR code in C as it is in Rust (11 LoC)?
Re:Using Rust in Non-Rust Servers to Improve Performance by ports543u on Monday October 28, 2024 @11:00AM (#41971689)
> Is there an equivalently easy way to expose a native interface from C to JS as the example in the post?

Yes, for most languages. For example, in Zig (https://ziglang.org/documentation/master/#WebAssembly) or in C (https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_Wa...)

> Relatedly, is it as easy to generate a QR code in C as it is in Rust (11 LoC)?

Yes, there are plenty of easy to use QR-code libraries available, for pretty much every relevant language. Buffer in, buffer out.

Re:Using Rust in Non-Rust Servers to Improve Performance by AndrewDucker on Monday October 28, 2024 @11:06AM (#41971783)
It's that simple in Rust because it's using a library. C also has libraries for generating QR codes: https://github.com/ricmoo/QRCode

(Obviously there are other advantages to Rust)

Re:Using Rust in Non-Rust Servers to Improve Performance by mplanchard on Monday October 28, 2024 @01:50PM (#41973987)
nice, thanks for the link!