GPUI: Getting Started

GPUI: Getting Started
hello_world.rs
A series of me learning how to write Rust & build GUI application using GPUI

Prerequisite

  1. You are on macOS, cause GPUI only works on macOS at the moment.
  2. You have Rust installed

Step 1: Create new project

For those not familiar, cargo is the package manager for Rust, and it also has a simple cargo init function that initialise a full folder for you.

Once it's created, open that folder with your choice of IDE/Text Editor.

Step 2: Add GPUI as dependency

And in Rust, you add dependencies in the Cargo.toml file. As stated in their README, as it's not stable yet, there is no versioning (and promise of and forward/backward compatibility that implied from versioning), so you need to tell cargo to just get the whole thing (the nomenclature is a "crate") using git.

# [package] and everything else above

[dependencies]
gpui = { git = "https://github.com/zed-industries/zed" }

Once you are done, you can run cargo install to be sure package manager fetch everything it needs.

Step 3: Run some example

Again in the repository, they have some examples you can get started with. Once you copied something, just run cargo run.