carbon-lang
carbon-lang copied to clipboard
Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
In https://github.com/carbon-language/carbon-lang/issues/498, we had a question of whether you can call unannotated functions in a type context: ``` fn g() -> Type { return Int; } fn f(x: g()) ->...
Proposal #143 suggests that we require a period in all real number literals. This means that constants such as `1e6` are invalid -- they're neither real number literals nor integer...
https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/README.md#choice-types has example code: ``` choice IntResult { Success(value: i32), Failure(error: String), Cancelled } ... case .Cancelled => { Terminate(); } ``` Right now, it would be `Cancelled()` with parentheses:...
Proposal #144 was accepted but the design docs in https://github.com/carbon-language/carbon-lang/tree/trunk/docs/design have not been updated to reflect its acceptance.
Modifying the init_and_read.carbon test case as follows triggers an internal cast error. ``` package ExecutableSemanticsTest api; // Test global variable initialization and read. var zero: auto = 0; fn Main()...
In ECMAScript, the `import.meta` expression (`meta` is a context keyword) returns `{url}`, where `url` indicates the URL of the current script. Carbon scripts could have such ability. For example: **file:///C:/Users/anonymous/Documents/foo.carbon**...
In order to facilitate tool assisted migration when defaults or behaviours change, it would be sensible to have a mandatory reference to the language definition version that a source file...
Rust has `include_str!("./data.txt")` and `include_bytes!("./data.bin")` macros. So I propose the same for Carbon. In my language I use `embed './data.txt':String` and `embed './data.bin':ByteArray`. I think C++ doesn't have that feature,...
The [design doc]("https://github.com/carbon-language/carbon-lang/blob/trunk/docs/design/primitive_types.md#string-view-vs-owning-string") currently states "The right model of a string view versus an owning string is still very much unsettled." Other issues, such as string-interpolation will need some clarity...
C++20 formatting functions take a localization context [std::locale](https://en.cppreference.com/w/cpp/locale/locale). Evaluate whether Carbon should provide its own localization context or use the one provided by C++. If Carbon provides a Carbon specific...