Scope
This document describes which programming languages the Fuchsia project uses and supports for production software on the target device, both within the Fuchsia Platform Source Tree and for end-developers building for Fuchsia outside the Fuchsia Source Platform Tree. The policy does not apply to (a) developer tooling, either on target or host devices, or (b) software on the target device that is not executed in normal, end-user operation of the device. For example, this policy does not apply to zxdb (a debugger) because zxdb is a developer tool; the policy does apply to pkgfs because pkgfs (a file system) executes in the normal, end-user operation of the device.
Definitions
Supported for end-developers means that the Fuchsia SDK contains tools and libraries that help people use the language to develop software for Fuchsia, including a language-specific backend (and supporting libraries) for FIDL. Support also implies some level of documentation, including tutorials and examples, as well as investment from developer relations.
Strong support for asynchronous programming means asynchronous programs can be written using straight-line code (eg, using async / await in languages like Rust and Dart).
Languages C . Analysis Pro: C is a widely used language. The language has properties that are well-understood, have been stable over a long period of time, and have been used to build similar systems in the past. The language has a mature toolchain and associated developer tools.
Pro: C has a stable ABI, which lets the Fuchsia SDK contain prebuilt binaries that end-developers can re-use. Pro: Many languages can interoperate with C using a foreign function interface. Supporting C makes it easier for end-developers to integrate these languages with Fuchsia. : Pro: Our current end-developers already use the language. (Con Con: Support for asynchronous programming is weak . Con: Programs written in the language often have security bugs arising from the language’s lack of memory safety. Con: Programs written in the language often contain resource leaks because the language does not provide a facility for automatically releasing resources. Con: Type safety is weak compared to C . Simply recompiling some of our C code as C often results in compiler errors that surface latent bugs in the code.
Decision (C is supported for end-developers. (See the list of supported versions of C .)
Con: Support for asynchronous programming is weak.
- Pro: The language provides memory safety guarantees, which reduces the risk of software developed in the language having security bugs. Con: The language uses garbage collection to manage memory, which is more resource intensive than other techniques for managing memory. Con: The language has a substantial runtime environment.
- Con: The toolchain forces a trade-off between binary size, performance, and startup latency that is worse than the tradeoff provided by toolchains for other languages.
- Decision
(Dart is supported for end-developers targeting non-drivers.) Dart is approved for use in the Fuchsia Platform Source. Tree for user interfaces and for programs that do not run indefinitely. Rust
- Pro: The language provides memory safety guarantees, which reduces the risk of software developed in the language having security bugs. Pro: Asynchronous programs can be written using straight-line code.
: Pro: The Fuchsia project has the opportunity to influence the evolution of the language.
- Con: Rust is not a widely used language. The properties of the language are not yet well-understood, having selected an unusual language design point (eg, borrow checker) and having existed only for a relatively short period of time. Con: None of our current end-developers use Rust. ) Decision (Rust is not supported for end-developers.) Rust is approved for use throughout the Fuchsia Platform Source Tree, with the following exceptions: kernel . The Zircon kernel is built using a restricted set of technologies that have established industry track records of being used in production operating systems.
Go
- Pro: gVisor has implemented a network stack using the language and that network stack has been integrated with Fuchsia.
- Pro: People using the language are highly productive.
- Pro: The Fuchsia project has the opportunity to influence the evolution of the language.
- Pro : The language provides memory safety guarantees, which reduces the risk of software developed in the language having security bugs.
- Pro: The language has an extensive ecosystem of libraries that are likely to be useful on Fuchsia.
- Con: The language uses garbage collection to manage memory, which is more resource intensive than other techniques for managing memory.
- Con: The language has a substantial runtime environment.
- Con: The Fuchsia Platform Source Tree has had negative implementation experience usi ng Go. The system components the Fuchsia project has built in Go have used more memory and kernel resources than their counterparts (or replacements) the Fuchsia project has built using C or Rust. (Con: The toolchain produces large binaries)

GIPHY App Key not set. Please check settings