Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

Carbon

< >

Carbon is a programming language created in 2020 by Chandler Carruth and Jon Ross-Perkins.

#292on PLDB 4Years Old
Download source code:
git clone https://github.com/carbon-language/carbon-lang
Source CodeWikipedia

Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)


Example from the web:
package Sorting api; fn Partition[T:! Comparable & Movable](s: Slice(T)) -> i64 { var i: i64 = -1; for (e: T in s) { if (e <= s.Last()) { ++i; Swap(&s[i], &e); } } return i; } fn QuickSort[T:! Comparable & Movable](s: Slice(T)) { if (s.Size() <= 1) { return; } let p: i64 = Partition(s); QuickSort(s[:p - 1])); QuickSort(s[p + 1:])); }
Example from Compiler Explorer:
package sample api; fn Square(x: i32) -> i32 { return x * x; } fn Main() -> i32 { return Square(12); }

- Build the next great programming language Add Issues About Search Keywords Livestreams Labs Resources Acknowledgements

Built with Scroll v154.3.0