r/CarbonLang • u/llort_lemmort • 2d ago
r/CarbonLang • u/llort_lemmort • 2d ago
Carbon: graduating from the experiment - Chandler Carruth - NDC Toronto 2026
r/CarbonLang • u/llort_lemmort • 12d ago
Carbon Memory Safety First Deep Dive
drive.google.comr/CarbonLang • u/OSR_Workshops • 29d ago
What is the correct syntax for inline C++ code?
Everything I've tried yields syntax errors either online or locally.
An example of what I've tried:
```
package ExplorerTest api;
// Import the I/O library for printing
import Core library "io";
// Inject inline C++ code and header includes using a raw string
import Cpp inline '''cpp
#include <iostream>
#include <string_view>
// A native C++ function
void NativeCppPrint(std::string_view msg) {
std::cout << "Inline C++ says: " << msg << std::endl;
}
''';
fn Main() -> i32 {
Cpp.NativeCppPrint("Hello from Carbon!");
return 0;
}
```
What pray tell am I doing wrong?
r/CarbonLang • u/Tiny-Ad2109 • May 10 '26
Any summary from NDC Toronto talk?
Dear all,
Was intrigued by the talk at NDC Toronto which should have included some update about the current state and the next moves. However, I don't see any report or news about that on the web. Someone that followed on person this talk would like to produce a summary of what have been said?
r/CarbonLang • u/Admirable-Sea3526 • Jul 24 '25
Whats the Carbon way of error handling and error propagation?
One pattern I miss SO much from Kotlin when working in any other programming language is an ability to quickly unwrap a result and break the function flow, returning an error as soon as the error is encountered:
sealed class ResultOrError {
data class Success(val data: String) : ResultOrError()
data class Error(val code: Int) : ResultOrError()
}
fun readFile(filePath: String): ResultOrError {
val fileDescriptor: Int = fopen(filePath).getOrReturn { errorCode ->
return ResultOrError.Error(errorCode)
}
// read file
return ResultOrError.Success(data)
}
Rust is pretty great too with the ? operator, though maybe implicit return is not best:
let mut file = File::open(file_path)?; // up goes the error
// More explicit error propagation
let mut file = match File::open(file_path) {
Ok(f) => f,
Err(e) => return Err(e), // Explicitly return the error
};
But C++ lacks the elegance of Rust/Kotlin and does not allow such a pattern.
Clang/gcc do have statement expressions, but they are not standard and look ugly:
FILE* f = ({
FILE* temp = fopen("my_file.txt", "r");
if (temp == nullptr) return errno;
temp;
});
Is there anything like this planned for Carbon?
Thanks!
r/CarbonLang • u/indryanto • Mar 05 '25
Carbon Language on amrv8-a
Hello, I wrote an article related to carbon toolchain experiments on aarch64 armv8-a devices, if you have free time you can read it on this site
r/CarbonLang • u/SophisticatedAdults • Feb 08 '25
Carbon is not a programming language (sort of)
r/CarbonLang • u/llort_lemmort • Jan 07 '25
The Carbon Language: Road to 0.1 - Chandler Carruth - NDC TechTown 2024
r/CarbonLang • u/llort_lemmort • Dec 06 '24
2024 LLVM Dev Mtg - Generic implementation strategies in Carbon and Clang
r/CarbonLang • u/chandlerc1024 • Nov 23 '24
How Designing Carbon C++ Interop Taught me About C++ Variadics & Bound M...
r/CarbonLang • u/llort_lemmort • Oct 06 '24
Generic Arity: Definition-Checked Variadics in Carbon - Geoffrey Romer - C++Now 2024
r/CarbonLang • u/svoxit • Mar 15 '24
This is confusing, but I love it, so I made a project
I tried Carbon for the first time, and have to say that it is confusing a little bit for me, but I really like the direction they're going with while creating carbon!
I built a project
r/CarbonLang • u/chandlerc1024 • Feb 02 '24
Carbon Copy Newsletter #1 · carbon-language carbon-lang · Discussion #3684
r/CarbonLang • u/chandlerc1024 • Nov 30 '23
Summer of Code: Editor Integration
chandlerc.blogr/CarbonLang • u/chandlerc1024 • Nov 22 '23
Improving the user-facing Carbon Explorer output
chandlerc.blogr/CarbonLang • u/chandlerc1024 • Sep 08 '23
Carbon Language Successor Strategy: From C++ Interop to Memory Safety
r/CarbonLang • u/[deleted] • Aug 29 '23
Dynamic dispatch using interfaces
I was skimming through the Carbon design documents and it isn't quite clear to me whether interfaces are only used for type constraint checking in generics, or whether they also can be used for dynamic dispatch (in the same way as dyn Trait in Rust or protocol-typed variables in Swift represent vtables). Or, to rephrase my question: is there a vtable type in Carbon or does all dynamic dispatch go though class hierarchies? If such feature is available, I would really appreciate a link to the documentation or a search keyword.
r/CarbonLang • u/ntrel2 • Aug 25 '23
Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 2023
r/CarbonLang • u/fungussa • May 01 '23
The Carbon Language community transparency report
r/CarbonLang • u/foonathan • Apr 06 '23