Skip to content

Hello Cranberry

We’ll be using Visual Studio Code (VSCode) for this tutorial so please install that.

Open VSCode and open a new folder:

Open Folder

We’ll create a folder in Desktop called "MyProject" as an example. Select it and use it.

MyProject folder

VSCode will open that folder and you should see an empty project. Go to the top of the screen and select Terminal > New Terminal.

New Terminal

Inside the terminal write the following command:

Terminal window
cranberry init

That will initialize a new cranberry project in the current working directory. You should see this file structure:

Terminal window
MyProject/
├─ src/ # Contains all source cranberry files
├─ main.cb # Main entry point of cranberry
└─ cranberry.toml # Edit cranberry project settings

Open up the main.cb file inside of src/ and see its contents:

main.cb

Go back to the Terminal and write the following command:

Terminal window
cranberry run

This will run the project and you’ll see this in the output:

Hello World