|
|
@@ -124,6 +124,11 @@ realities. Having the specification will enable better analysis of the language
|
|
|
as a whole and the production of other partial or full implementations which
|
|
|
match the behavior of the reference implementation.
|
|
|
|
|
|
+**Approachable, developer-facing documentation.** Developers shouldn't be
|
|
|
+expected to read through the specification to ramp up with Carbon. User guides
|
|
|
+and other documentation will be provided to make it easy to learn how to use
|
|
|
+Carbon.
|
|
|
+
|
|
|
**Compelling adoption tooling.** We want to provide a compelling suite of tools
|
|
|
out-of-the-box in order to encourage adoption of Carbon at scale where it can
|
|
|
augment existing C++ codebases. For example, we expect a C++ -> Carbon code
|
|
|
@@ -200,6 +205,11 @@ concerned with ultimate performance at every moment, but in the most constrained
|
|
|
scenarios they must be able to "open up the hood" without switching to another
|
|
|
language.
|
|
|
|
|
|
+**Idiomatic code should be fast.** Developers should not regularly be required
|
|
|
+to choose between performance and readability. Although performance tuning may
|
|
|
+in rare cases require complex or surprising code, Carbon's design should ensure
|
|
|
+regular, idiomatic code usually results in high performance.
|
|
|
+
|
|
|
**Code should perform predictably.** The reader and writer of code should be
|
|
|
able to easily understand its expected performance, given sufficient background
|
|
|
knowledge of the environment in which it will run. This need not be precise, but
|
|
|
@@ -208,7 +218,7 @@ that performance, whether good or bad, is unsurprising to developers. Even
|
|
|
pleasant surprises, when too frequent, can become a problem due to establishing
|
|
|
brittle baseline performance that cannot be reliably sustained.
|
|
|
|
|
|
-**Leave no room for a lower level language.** Programmers should not need to
|
|
|
+**Leave no room for a lower level language.** Developers should not need to
|
|
|
leave the rules and structure of Carbon, whether to gain control over
|
|
|
performance problems or to gain access to hardware facilities.
|
|
|
|
|
|
@@ -325,8 +335,9 @@ primary goal is to support performance-critical software, other kinds of
|
|
|
software should not be penalized unnecessarily.
|
|
|
|
|
|
> "The right tool for the job is often the tool you are already using -- adding
|
|
|
-> new tools has a higher cost than many people appreciate." --
|
|
|
-> [John Carmack](https://twitter.com/id_aa_carmack/status/989951283900514304)
|
|
|
+> new tools has a higher cost than many people appreciate."
|
|
|
+>
|
|
|
+> -- [John Carmack](https://twitter.com/id_aa_carmack/status/989951283900514304)
|
|
|
|
|
|
**Focus on encouraging appropriate usage of features rather than restricting
|
|
|
misuse.** Adding arbitrary restrictions to prevent misuse of otherwise general
|
|
|
@@ -359,9 +370,11 @@ well articulated in
|
|
|
although we may come to different conclusions regarding the principles.
|
|
|
|
|
|
**Design features to be simple to implement.** Syntax, structure, and language
|
|
|
-features should be chosen while keeping the complexity of the implementation
|
|
|
-manageable. This reduces bugs, and will in most cases make the features easier
|
|
|
-to understand.
|
|
|
+features should be chosen while keeping the implementation complexity
|
|
|
+manageable. Simplicity of implementation reduces bugs, and will in most cases
|
|
|
+make the features easier to understand. It's also often the best way to ensure
|
|
|
+predictable performance, although supporting peak performance may require
|
|
|
+options for more complex implementation behavior.
|
|
|
|
|
|
#### Practical safety guarantees and testing mechanisms
|
|
|
|
|
|
@@ -420,8 +433,12 @@ distributed build graph options. Without these options, we will again be unable
|
|
|
to provide fast developer iteration as the codebase scales up.
|
|
|
|
|
|
**Support separate compilation, including parallel and distributed strategies.**
|
|
|
-We cannot assume coarse-grained compilation without blocking fundamental
|
|
|
-scalability options for build systems of large software.
|
|
|
+Iteration requires frequent rebuilds of software as part of the edit/test/debug
|
|
|
+cycle of development. The language design should enable low-latency build
|
|
|
+strategies, particularly when relatively little has changed. This minimally
|
|
|
+requires separate compilation of source files, and potentially other incremental
|
|
|
+build strategies. Separate compilation also enables better scalability options
|
|
|
+for build systems of large software.
|
|
|
|
|
|
#### Modern OS platforms, hardware architectures, and environments
|
|
|
|
|
|
@@ -435,11 +452,11 @@ environments.** This goes beyond enabling compile-time translations from one
|
|
|
abstraction to several implementations. While enabling high-level
|
|
|
synchronization primitives like mutexes and futures is good, the underlying
|
|
|
atomic operations provided by the hardware must also be directly available.
|
|
|
-Similarly, lowering parallel constructs into either SIMD or SPMD implementations
|
|
|
-is good but insufficient. Both SIMD and SPMD must be directly addressable in
|
|
|
-Carbon. This pattern repeats across the landscape of hardware, platform, and
|
|
|
-environment, including concurrency versus parallelism more generally, and more
|
|
|
-OS/environment distinctions such as desktop versus mobile versus bare metal.
|
|
|
+Similarly, lowering parallel constructs into a specific implementation, such as
|
|
|
+SIMD or SPMD, is good but insufficient. Multiple parallel implementations must
|
|
|
+be directly addressable in Carbon. The need for native support repeats across
|
|
|
+the landscape of OS platform, hardware, and environment distinctions; for
|
|
|
+example, concurrency versus parallelism, and desktop versus mobile.
|
|
|
|
|
|
**Conversely, Carbon cannot prioritize support for historical platforms.** To
|
|
|
use a hockey metaphor, we should not skate to where the puck is, much less where
|
|
|
@@ -579,7 +596,7 @@ provide a minimally "correct" migration to very unfriendly code, mechanically
|
|
|
reproducing exact C++ semantics even if bizarre, even this is not guaranteed and
|
|
|
improving on it is not a goal. Migration support will prioritize code that
|
|
|
adheres to reasonable C++ best practices, such as avoiding undefined behavior,
|
|
|
-and having reasonable test coverage that passes under sanitizers.
|
|
|
+maintaining good test coverage, and validating tests with sanitizers.
|
|
|
|
|
|
### Principles
|
|
|
|