Live data from Hacker News

Announcing Rust 1.16

blog.rust-lang.org

11–20 of 95 posts

Re: Announcing Rust 1.16

#11
post #9

I like rust a lot, but even hello world web apps compile (and recompile) so slowly. I barely get a single step down my to do list before recompiles take more than a second, and it makes it functionally unusable compared to other tools. I know this sounds silly, but it's true. I don't want the check, I want to see the webpage changed after my code changes. I keep hearing about incremental compiles but when I used nigh…

Incremental recompilation is still underway; expect some news on it reasonably soon. Even then, it's just the start, and there's more that we can do.

Re: Announcing Rust 1.16

#12
post #9

I like rust a lot, but even hello world web apps compile (and recompile) so slowly. I barely get a single step down my to do list before recompiles take more than a second, and it makes it functionally unusable compared to other tools. I know this sounds silly, but it's true. I don't want the check, I want to see the webpage changed after my code changes. I keep hearing about incremental compiles but when I used nigh…

Incremental compilation doesn't incrementally typecheck yet. A lot of time is spent in typechecking.

The feature is designed so that incremental typechecking can happen—it just doesn't yet.

Re: Announcing Rust 1.16

#13

I might be a minority here, but can someone please update me on there state of Rust on iOS? I develop C++ cross platform iOS/Android apps and would love to use Rust if possible. The last time I checked Rust didn't support .frameworks creation, didn't support Bitcode and calling the main thread from Rust wasn't easy. I would love to hear if these issues have been resolved.

Sorry for stealing the thread, on my case is Android/UWP.

Do you have any better approach to JNI calls other than Djinni, SafeJNI, SWIG, RPC-like with bulk of work on Java side?

Re: Announcing Rust 1.16

#14

I might be a minority here, but can someone please update me on there state of Rust on iOS? I develop C++ cross platform iOS/Android apps and would love to use Rust if possible. The last time I checked Rust didn't support .frameworks creation, didn't support Bitcode and calling the main thread from Rust wasn't easy. I would love to hear if these issues have been resolved.

> The last time I checked Rust didn't support .frameworks creation

From a purely "how do I get something I can link to" perspective, you can still build a cdylib and a header for it, Xcode will let you include the header in your Objective-C code or in the Swift bridging header, and then you can link to the cdylib and copy it into the "Frameworks" subdirectory in the bundle at build time. I've been doing that in an OS X app for several months and it works out very well.

> calling the main thread from Rust wasn't easy.

If you want to schedule code to run in the main queue/thread/runloop, that's an Apple-specific thing Rust wouldn't be aware of by default, but I did find a wrapper for libdispatch/GCD, and it seems to support calling things on the main queue which should do what you want.

https://crates.io/crates/dispatch

You can also have your app provide a C callback to the Rust code (even a Swift closure with captured variables, with some clever workarounds since you can't do that by default), and then in the callback you can schedule code to run on the main queue/thread if you want.

Re: Announcing Rust 1.16

#15
post #8

I might be a minority here, but can someone please update me on there state of Rust on iOS? I develop C++ cross platform iOS/Android apps and would love to use Rust if possible. The last time I checked Rust didn't support .frameworks creation, didn't support Bitcode and calling the main thread from Rust wasn't easy. I would love to hear if these issues have been resolved.

I haven't seen much on it. Doesn't mean solutions don't exist, but I regularly read updates on reddit and what people are working on, and I haven't seen much there. I feel like Swift is more likely to fill that role by coming to android.

I imagine just like with Objective-C, it will only happen with forks of the NDK, as Google has always removed it from clang builds.

Re: Announcing Rust 1.16

#16
post #13

I might be a minority here, but can someone please update me on there state of Rust on iOS? I develop C++ cross platform iOS/Android apps and would love to use Rust if possible. The last time I checked Rust didn't support .frameworks creation, didn't support Bitcode and calling the main thread from Rust wasn't easy. I would love to hear if these issues have been resolved.

Sorry for stealing the thread, on my case is Android/UWP. Do you have any better approach to JNI calls other than Djinni, SafeJNI, SWIG, RPC-like with bulk of work on Java side?

Have you tried Loopers for Android to update main thread from NDK BG thread? I've seen people have success with that, but I personally didn't try it. AFAIK if you want to use MVVM pattern, there's no option than to use JNI.

We use Djinni extensively and it does what it advertises. We've to be careful with retain cycles and Djinni proxies create strong retain cycles if didn't configure correctly.

I'm actively looking into libdispatch for threading. I've heard of people having success with long polling of file/socket and dispatch_source to update main threads from BG on iOS/Android. I'll probably write a blog post if I succeed (and that's a big IF).

Re: Announcing Rust 1.16

#17
This releases fixes the #derived mess, right? Meaning we don't need to mess with weird build scripts to get serialization and json support?

Edit: so it was 1.15! I've been running 1.14 on my laptop and didn't realize it!

Re: Announcing Rust 1.16

#18

This releases fixes the #derived mess, right? Meaning we don't need to mess with weird build scripts to get serialization and json support? Edit: so it was 1.15! I've been running 1.14 on my laptop and didn't realize it!

That was 1.15, I believe. :-)

Re: Announcing Rust 1.16

#19

I might be a minority here, but can someone please update me on there state of Rust on iOS? I develop C++ cross platform iOS/Android apps and would love to use Rust if possible. The last time I checked Rust didn't support .frameworks creation, didn't support Bitcode and calling the main thread from Rust wasn't easy. I would love to hear if these issues have been resolved.

> The last time I checked Rust didn't support .frameworks creation From a purely "how do I get something I can link to" perspective, you can still build a cdylib and a header for it, Xcode will let you include the header in your Objective-C code or in the Swift bridging header, and then you can link to the cdylib and copy it into the "Frameworks" subdirectory in the bundle at build time. I've been doing that in an OS…

I'm aware of long polling of file/socket and libdispatch.dispatch_source to update main threads from BG on iOS/Android. I'll have to try that out and find if it works.

>You can also have your app provide a C callback to the Rust code

That's exactly what I'm doing, however callbacks become cumbersome after a while, and I don't like that pattern. I need to do MVVM where the View is a thin iOS/Android layer, and the VM is in Rust. Right now there are significant hurdles to keep references from Swift to Rust and vice versa.

Re: Announcing Rust 1.16

#20

This releases fixes the #derived mess, right? Meaning we don't need to mess with weird build scripts to get serialization and json support? Edit: so it was 1.15! I've been running 1.14 on my laptop and didn't realize it!

[deleted]
Post reply on HN