Rust for Cocoa/XCode


Dave
 

Hi All,

Does anyone know if there is a version of Rust that works with XCode and/or Cocoa?

All the Best
Dave


 



On Jan 17, 2023, at 2:43 AM, Dave <dave@...> wrote:

Does anyone know if there is a version of Rust that works with XCode and/or Cocoa?

There’s only one ‘version’ of Rust I know of, i.e. the official one.
By “works with Xcode” do you mean “does Xcode have a Rust compiler?” ⟶ No. If you want to work with Rust on a Mac, you’ll need to install the Rust dev tools from the official site, then either use them from the command line or via an IDE that does have support for Rust, like VS Code.
By “works with Cocoa” do you mean “is there a Rust library that binds the Cocoa APIs?” ⟶ No idea, but you’d need to look for a library, not something built into Rust.

—Jens


Chris Ridd
 



On 19 Jan 2023, at 02:03, Jens Alfke <jens@...> wrote:



On Jan 17, 2023, at 2:43 AM, Dave <dave@...> wrote:

Does anyone know if there is a version of Rust that works with XCode and/or Cocoa?

There’s only one ‘version’ of Rust I know of, i.e. the official one.
By “works with Xcode” do you mean “does Xcode have a Rust compiler?” ⟶ No. If you want to work with Rust on a Mac, you’ll need to install the Rust dev tools from the official site, then either use them from the command line or via an IDE that does have support for Rust, like VS Code.
By “works with Cocoa” do you mean “is there a Rust library that binds the Cocoa APIs?” ⟶ No idea, but you’d need to look for a library, not something built into Rust.

There is a rust crate which adds Cocoa bindings. See https://crates.io/crates/cocoa

I’ve never tried it, but I’m sure they’d welcome fixes if you found anything wrong. https://github.com/servo/core-foundation-rs

Chris