X
Business

Google programming language scorecard: How C, C++, Dart, Rust, Go rate for Fuchsia

Google sets out the pros and cons of programming languages for the new Fuchsia OS: Go is out, Rust restricted.
Written by Liam Tung, Contributing Writer

Google has released a new programming language policy for Fuchsia, its under-development OS that some speculate could be its non-Linux successor to Android. 

Instead of a Linux kernel, the core of Google's Fuchsia OS is a Zircon microkernel to communicate with hardware and boot a system that runs Fuchsia. Google describes Fuchsia as specifically "not Linux" and a "modular, capability-based operating system". 

While Google hasn't yet detailed its intentions for Fuchsia, there has been plenty of speculation that it plans to replace Android and Chrome OS with it in the near future. The new OS has also piqued the interest of security researchers at the National Security Agency

A new policy document that engineers are discussing on Y Combinator's Hacker News evaluates popular programming languages C, C++, Dart, Rust, and Go that the Fuchsia project "uses and supports for production software on the target device" – essentially the key languages that Fuchsia is written in. 

SEE: How to build a successful developer career (free PDF)

The document outlines Google's thoughts about the pros and cons of each language in the context of Fuchsia. It also lists which of each language is supported and to what extent it is supported. 

C, for example, is supported for "end-developers" who write software for Fuchsia outside the Fuchsia Platform Source Tree, referring to the centrally controlled Fuchsia source code.

Being supported for end-developers means that the Fuchsia software development kit has tools and libraries developers can use to build software for Fuchsia, as well as documentation, tutorials, and developer relations support. 

C's advantages include its wide use and well-understood properties with lots of developer tools. Its disadvantages include weak support for asynchronous programming, lack of memory safety, and weak type safety. 

For these reasons, C is supported for end-developers, but new uses of C are discouraged within Fuchsia source code, where it's restricted to low-level systems programming and the kernel. 

C++ is supported both for end-developers and the Fuchsia Platform Source tree due to its extensive use across both groups. Weaknesses include asynchronous programming and memory safety. 

The Google-built Dart language is supported for end-developers targeting non-drivers and the source tree for user interfaces and programs that don't run indefinitely. Dart has become a popular language and is used in combination with Flutter to build mobile apps. 

The Mozilla-sponsored Rust programming language has attracted Microsoft engineers in part because its memory safety capabilities are useful in avoiding memory-related bugs common in Microsoft's legacy code written in C and C#. 

Google notes, "The Fuchsia Platform Source Tree has had positive implementation experience using Rust" but it has opted not to support it for end-developers because none of its current end-developers use it and it's not a widely used language.

SEE: AI: It's time to tame the algorithms and this is how we'll do it, says Europe

Google has blessed Rust for use throughout the Fuchsia Platform Source Tree but has barred it from Zircon. 

"The Zircon kernel is built using a restricted set of technologies that have established industry track records of being used in production operating systems," Google states. 

Go, another Google-hatched language for large systems that is widely used within Google is broadly not approved. The one exception is Fuchsia's netstack because it would cost too much to migrate to another language. 

"All other uses of Go in Fuchsia for production software on the target device must be migrated to an approved language," Google notes. 

More on Google and Fuchsia

Editorial standards