Files
compiler-explorer/examples/carbon/default.carbon
Matt Godbolt 9f3d43b271 Add carbon native compiler (#7389)
- Renames existing carbon stuff to carbon-explorer. Will need a quick
infra install and will temporarily (like, for 2m) break things during
deploy.
- Adds carbon binary support
- Supports binary, execute, and binary objects
- Updates the default carbon file as best I can
 
Closes #5402
2025-02-12 13:41:08 -06:00

12 lines
261 B
Plaintext

// To run this in Carbon Explorer you'll need to uncomment the following line:
// package sample api;
fn Square(x: i32) -> i32 {
return x * x;
}
// To run this in Carbon Explorer you'll need to rename this "Main()".
fn Run() -> i32 {
return Square(12);
}