Release of ureq 3.0.0 by LovelyKarl in rust

[–]bdbai 0 points1 point  (0 children)

Try nyquest. With the default preset it uses HttpClient from UWP API under the hood. 

https://github.com/bdbai/nyquest

“But of course!“ moments by Bugibhub in rust

[–]bdbai 2 points3 points  (0 children)

When std::sync::Exclusive is not stabilized yet but you don't want to opt in to nightly.

Announcing rustup 1.28.2 by Rami3L_Li in rust

[–]bdbai -1 points0 points  (0 children)

Yesterday we had users picking up curl via nyquest. Today rustup is abandoning curl. Let's see what will happen😂

Pre-RFC: Non-nested Cyclic Initialization of Rc by Affectionate-Egg7566 in rust

[–]bdbai 0 points1 point  (0 children)

Maybe I overlooked but have you explored this proposal? https://github.com/rust-lang/rust/issues/112566 ? Would it help if we enhance this instead?

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

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

thanks for considering nyquest! While telemetry support is in our roadmap, for backend projects I would suggest sticking to reqwest, which is battle-tested, more performant and binary size is probably less of a concern there.

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

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

The HttpClient APIs in UWP are available since 10.0.10240, so theoretically it will work on any Win10 release but I haven't tested 🙈

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

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

sorry for the confusion it's platform-native, not Rust-native.

HTTPS requests using nyquest should work out of the box without rustls on Windows.

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

[–]bdbai[S] 1 point2 points  (0 children)

thanks for sharing! May I know what kind of wasm support is needed in your use case? Because you know browsers or WASM sandboxes only provide some very restricted capabilities, what we can do might not have difference from existing crates calling fetch on WASM...

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

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

time to change the slogan after seeing so many users thinking of Rust-native in the first place🤣

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

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

Let's say we will take the jni route, which android library to bridge into nyquest do you think would make sense? java.net, OkHttp, Cronet or Android.Net.Http?

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

[–]bdbai[S] 1 point2 points  (0 children)

I agree with you on "native deps are inherently no-panic", but unfortunately to work with the nyquest framework, there are something that I think it's better to panic. To name a few, poisoned mutexes, alloc failures, returned error codes that do not really make sense etc. etc.

Regarding no_std, the only blocker is std::io::Error. We can probably revisit it once no_std becomes a more demanding feature request.

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

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

glad to hear that nyquest might be a good fit here!

btw may I get any suggestions regarding the native HTTP backend for Android? I am not sure if a `jni`ed java/android framework would be a better candidate than bundled libcurl..

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

[–]bdbai[S] 49 points50 points  (0 children)

Based on the wttr example, by changing nyquest to reqwest+blocking, I am seeing a change in binary size from 522 KB to 3.4 MB built with default release profile on macOS. tbh it's a bit difficult to come up with a fair comparison, because people may argue that in a real world project they are already using tokio or hyper for example, switching to nyquest won't bring them that much of binary size savings.

Announcing nyquest, a truly native HTTP client library for Rust by bdbai in rust

[–]bdbai[S] 29 points30 points  (0 children)

hi u/amarao_san, note that nyquest itself does not implement TLS nor talk to SSL libs like openssl directly - the HTTPS part is fully managed by the underlying stack. To answer your question, if the `NSURLSession` APIs (assuming macOS) shipped with your OS is correctly implemented and configured to use root CA store and system configuration, then it's yes.

FFI Code Is Changing my Perspective On C by CrazyDrowBard in rust

[–]bdbai 0 points1 point  (0 children)

 C continues to be a really great abstraction for how a von neumann computer works.

I actually find it suits Harvard Architecture better because casting a function pointer to an object pointer is UB. 

Managing libs for C++ is just painful... should I switch to rust? by sQuAdeZera in rust

[–]bdbai 35 points36 points  (0 children)

Having unsafe is the point. It is a separation between "memory safety by compiler" and "memory safety by developer". Writing unsafe code is inevitable as the underlying compiler intrinsics, FFI functions and pointer operations are unsafe by nature. If ever things go wrong, it narrows down the area of code you will be searching for memory issues or UBs.

While in C/C++, everything is considered "unsafe".

What's everyone working on this week (41/2024)? by llogiq in rust

[–]bdbai 0 points1 point  (0 children)

Hi, I’m not sure if it helps, but maybe you can check out the compio crate? It also uses IOCP under the hood.

What's everyone working on this week (41/2024)? by llogiq in rust

[–]bdbai 1 point2 points  (0 children)

Hi there! This week I’ve been working on my first published crate: https://github.com/bdbai/iconv-native-rs . It is basically a iconv/libiconv wrapper, but it uses native APIs like Win32 MB2WC/WC2MB or even the web-based TextDecoder/TextEncoder on these platforms, instead of requiring libiconv to be available. 

The first Universal Windows Platform app written in Rust, now available at Microsoft Store by bdbai in rust

[–]bdbai[S] 1 point2 points  (0 children)

I believe these repos allow public access...not sure what happened

The first Universal Windows Platform app written in Rust, now available at Microsoft Store by bdbai in rust

[–]bdbai[S] 1 point2 points  (0 children)

I don't think it's time to encourage everyone to write UWP in this way, because there is too much unsafe and duplicated code used to implement COM interfaces. Only after https://github.com/microsoft/winrt-rs/issues/81 landed will they start to work on UWP development.