Files
carbon-lang/docs/project/principles/README.md
T
a9cc7bf490 File concatenation principle (#6031)
We propose a principle that it's always possible to inline the import of
a library from within the same package without changing the meaning of
or diagnostics applied to the code. This is similar to the textual
inlining of an `#include` statement in C++, but is slightly less
general. Cross-package imports place the imported names inside the name
scope of the package, so inlining those necessarily changes the paths
for name lookup.

---------

Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
2026-08-03 17:20:59 +00:00

31 lines
1.4 KiB
Markdown

# Principles
<!--
Part of the Carbon Language project, under the Apache License v2.0 with LLVM
Exceptions. See /LICENSE for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-->
Some language [goals](../goals.md) will have widely-applicable, high-impact, and
sometimes non-obvious corollaries. We collect concrete language design
principles in this directory as a way to document and clarify these. Principles
clarify, but do not supersede, goals and priorities. Principles should be used
as a tool in making decisions, and to clarify to contributors how decisions are
expected to be made.
A key difference between a principle and the design of a language feature is
that a principle should inform multiple designs, whereas a feature's design is
typically more focused on achieving a specific goal or set of goals. The
principle can help achieve consistency across those multiple designs.
Note that these principles seek to establish both the approaches the project
wants to pursue, as well as those we want to exclude.
- [Errors are values](error_handling.md)
- [Information accumulation](information_accumulation.md)
- [Low context-sensitivity](low_context_sensitivity.md)
- [Prefer providing only one way to do a given thing](one_way.md)
- [One static open extension mechanism](static_open_extension.md)
- [Success criteria](success_criteria.md)
- [File concatenation](file_concatenation.md)