Programming Languages#

GNOME applications can be written in a range of languages, including C++, Javascript, Python, Rust and Vala. This page provides an overview of the languages that are available, with links to the relevant developer documentation.

Overview#

GNOME platform libraries are primarily written in C, and provide a machine-readable description of their API and ABI through GObject-Introspection. This means that C is the “default” platform language, and that the upstream documentation for each library typically references C, but it is possible to use multiple languages to write applications for GNOME.

GObject-Introspection allows GNOME to easily provide support for a range of high level languages. In each case, this support is provided by a separate project, which provides its own documentation and support.

Language support typically needs to be installed as part of your development environment. Packages are available for most Linux distributions. In some cases, Flatpak runtime extensions are also available.

Available languages#

The following languages can be used to write GNOME applications.

Language

Project

Documentation

Notes

C++

gtkmm

Documentation overview

JavaScript

GJS

API references

Built on Mozilla’s SpiderMonkey, featuring ES6 (ECMAScript 2015). Applications which use GJS include Polari, Maps and Sound Recorder.

Python

PyGObject

API references

Works with Python 3.5+, PyPy, and PyPy3. Applications which use PyGObject include Music, Lollypop and Pitivi.

Rust

gtk-rs

Book

Applications which use gtk-rs include Authenticator, Shortwave and Video Trimmer.

Vala

Vala

API References

Vala is a programming language which wraps GNOME libraries and outputs C code. Applications which use Vala include Games, Boxes, Clocks and Gitg.