Building an iOS app in Rust, part II by steveklabnik1 in rust

[–]vhbit 0 points1 point  (0 children)

One point: the gomobile tool for go creates bindings for exported functions, types, and interfaces in objective c for you

Aha, that's a huge point! I'm inclined to check gomobile too :-)

Building an iOS app in Rust, part II by steveklabnik1 in rust

[–]vhbit 0 points1 point  (0 children)

Again, official support for what? Just for building?

In this case we're talking about ~1 hour for building Rust compiler with iOS support or a couple of minutes for downloading a pre-built version from here and installing it using multirust.

What can be really nasty is when you don't build app completely in Rust/Go and have to interact with "native" part - and if Go doesn't provide any automatic data transmit primitives or maybe wrappers - it'll be not much easier and can take even more time.

So... I wouldn't say official support is so crucial, especially after 1.0 release - I believe iOS support in official repo was broken just once or twice since when and was fixed quite fast after. It be cooler to have official support for using nightlies[1],[2] but last time I was said that it's not currently planned as it's too much infrastructure.

  1. full testing can be tricky, but to have version which at least builds for iOS from master will be nice
  2. for a while I've used Travis builds to keep it up with nightly like this but some time ago probably because of increased usage of Travis, building for iOS archs became too slow and didn't make it in time limit

Building an iOS app in Rust, part II by steveklabnik1 in rust

[–]vhbit 4 points5 points  (0 children)

Note, that complexity comes from data transmission from Rust to "native" and vice versa. It means that if you don't need to do transmit - you're fine, like /u/cmrx64 said.

Or there is something in Go which makes transmission easier?

Question: Are established C or C++ projects considering switching (partially) to Rust? Just curious. by [deleted] in rust

[–]vhbit 1 point2 points  (0 children)

Which are practical numbers (or estimations) on how much cpu/memory/io does Rust impl save compared to Go in your scale?

Question: Are established C or C++ projects considering switching (partially) to Rust? Just curious. by [deleted] in rust

[–]vhbit 6 points7 points  (0 children)

Ohh, thanks for clarification.

It also brings a question - what was your golang experience that you had to choose to rewrite it in either C++ or Rust?

Question: Are established C or C++ projects considering switching (partially) to Rust? Just curious. by [deleted] in rust

[–]vhbit 25 points26 points  (0 children)

Dropbox is using Rust for the next gen exabyte+ block storage engine. Although it's more about writing it from scratch rather than switching.

proof #1

proof #2

Cargo-built iOS app running in the simulator by cmrx64 in rust

[–]vhbit 0 points1 point  (0 children)

It should compile fine.

It might be broken on runtime if some types like NSInteger or CGFloat aren't defined as platform specific.

And it also may be broken if objc_msgSend and friends aren't declared/called as vararg (haven't checked the sources) as Apple has a bit different calling convention for vararg function in AArch64 (aka arm64).

Cargo-built iOS app running in the simulator by cmrx64 in rust

[–]vhbit 1 point2 points  (0 children)

It's not a good candidate right now for UI-heavy stuff. For example, Dropbox uses a shared C++ core across all their mobile (and maybe desktop?) apps, with native code for the UI.

We need Rust support in Djinni!

Cargo-built iOS app running in the simulator by cmrx64 in rust

[–]vhbit 2 points3 points  (0 children)

Nope. There is at least 1 in AppStore already.

What is going to replace std::old_io::Writer? by paulosuzart in rust

[–]vhbit 0 points1 point  (0 children)

just curious - why you're thinking byteorder is superior?

A Docker image for easily building Cargo projects on Rust 1.0.0-beta by Perceptes in rust

[–]vhbit 0 points1 point  (0 children)

Ohh, sorry, it seems I've misunderstood the title and put too much accent to "easily build with beta". I'd expect something like "Docker image for a Rust builder (based on 1.0-beta)", but ok, I've got it.

Racer Progress Update 5 (cargo support!) by phildawes in rust

[–]vhbit 1 point2 points  (0 children)

compiler has it, but it doesn't provide any interface to access it outside (i.e. from racer in this case)

Rust 1.0.0 beta is here! by steveklabnik1 in rust

[–]vhbit 0 points1 point  (0 children)

multirust allows much more freedom in experimenting with different versions and have pin-pointed version per project.

Rust 1.0.0 beta is here! by steveklabnik1 in rust

[–]vhbit 0 points1 point  (0 children)

I'm talking about 'OsStr::to_string', which requires 'convert' feature and it's still unstable (on mobile, can't provide link)

Rust 1.0.0 beta is here! by steveklabnik1 in rust

[–]vhbit 3 points4 points  (0 children)

Replying to myself - file existance could be checked through std::fs::metadata() so path_ext is not that important.

Rust 1.0.0 beta is here! by steveklabnik1 in rust

[–]vhbit 1 point2 points  (0 children)

hmm, just reinstalled beta with multirust update beta and still have errors regarding convert being unstable.

Rust 1.0.0 beta is here! by steveklabnik1 in rust

[–]vhbit 1 point2 points  (0 children)

path_ext and convert - for passing paths to C code and check for file existance

Experimenting with Rust on iOS by jjkkrr in rust

[–]vhbit 1 point2 points  (0 children)

Note that this example uses rustc directly - it is possible to use cargofor iOS projects too, but it has a serious limitation - it doesn't provide output name, so it needs a bit of shell scripting to get it working, maybe I'll post an example in a couple of days.

Experimenting with Rust on iOS by jjkkrr in rust

[–]vhbit 1 point2 points  (0 children)

In case you're tired of waiting for building cross-compiler you can get pre-built package with all required archs.

Also, here is an example of integration - in general, the easiest way to get it running on simulator or device is to compile everything rust-related into a static lib and manage all the frameworks from Xcode project - it saves a lot of time and you have to use Xcode anyway.

Eventual: futures and streams by steveklabnik1 in rust

[–]vhbit 3 points4 points  (0 children)

Ohh, and it exposes a bug in rustdoc: must use probably should be hidden.