Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a native Mac OS X GUI with Rust?

Tags:

macos

rust

I'm going to write a software using Rust:

  • core written in Rust
  • native Mac OS GUI written in Rust (preferably) or other language

Which setup allows that? Is it possible at all?

P.S. I never programmed nor with Rust nor with Cocoa/etc before.

like image 835
Pavel Vlasov Avatar asked Jan 12 '15 00:01

Pavel Vlasov


People also ask

Does Mac Have GUI?

Aqua is the graphical user interface, design language and visual theme of Apple's macOS operating system.


Video Answer


1 Answers

GUIs designed in Interface Builder work best if you use bindings, but bindings assume Objective-C. For this reason I'm writing GUI part in Objective-C and core part in Rust.

The two can communicate via an obj-c library (article about this), but the languages are quite different, so it's a bit awkward.

Rust can easily generate C-compatible static library which can be linked to an Objective-C program. You can even add Makefile target in Xcode to build the whole thing without leaving Xcode.

like image 169
Kornel Avatar answered Sep 21 '22 17:09

Kornel