# Carbon

> application programming interface (API)

**Wikidata**: [Q1035519](https://www.wikidata.org/wiki/Q1035519)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/Carbon_(API))  
**Source**: https://4ort.xyz/entity/carbon-q1035519

## Summary
Carbon is a C/C++ application programming interface (API) created by Apple Inc. that let developers write native Mac OS software before it was superseded by the modern Cocoa frameworks. It acted as a bridge between the classic Mac OS toolbox and macOS, allowing legacy code to run on newer systems.

## Key Facts
- **Developer**: Apple Inc. (American technology company, founded 1 April 1976, Cupertino, California)
- **Type**: Application programming interface (API) / software component
- **Operating-system support**: Mac OS operating systems and macOS (inception 24 March 2001)
- **Successor**: Replaced by Cocoa
- **Official documentation site**: http://developer.apple.com/carbon/
- **Freebase ID**: /m/0fp7v
- **Quora topic tag**: Carbon-API
- **Wikipedia page**: 13 sitelinks across 10 languages (da, de, en, es, fi, fr, it, ja, ko, no)

## FAQs
### Q: What was Carbon used for?
A: Carbon provided a set of C/C++ functions and tools that let developers port classic Mac OS applications to macOS without rewriting them in Objective-C. It handled windows, menus, events, memory and file management in a way that was source-compatible with earlier Mac toolboxes.

### Q: Is Carbon still supported today?
A: No. Apple deprecated Carbon and officially replaced it with Cocoa; modern macOS releases no longer receive Carbon updates or documentation.

### Q: How did Carbon relate to Cocoa?
A: Carbon and Cocoa co-existed for a transition period, but Cocoa (Apple’s Objective-C frameworks) became the preferred native API; Carbon’s role was to ease migration until Cocoa adoption was complete.

## Why It Matters
Carbon was Apple’s pragmatic answer to a critical problem: how to move thousands of existing Mac applications from the classic Mac OS toolbox to the radically different macOS (originally Mac OS X) without forcing developers into an immediate rewrite. By offering a C-based API that mirrored many legacy calls, Carbon shortened porting time and preserved expensive business and creative software for the new platform. Its existence reassured enterprises and consumers that their essential apps would survive the OS transition, smoothing adoption of macOS in the early 2000s. Once Cocoa matured and most key apps were migrated, Apple phased Carbon out, but its bridging role was pivotal in preserving the Mac software ecosystem and setting the stage for today’s unified Apple platforms.

## Notable For
- **Bridge API**: One of the few OS-level bridges explicitly designed to let identical source code compile for both classic Mac OS and macOS.
- **Deprecation path**: Apple publicly deprecated Carbon yet kept parts functional long enough for major third-party apps (Adobe, Microsoft, etc.) to ship native versions.
- **C/C++ only**: Unlike Cocoa, Carbon never required Objective-C, making it attractive to cross-platform codebases written in C or C++.
- **Dual-era support**: Simultaneously supported inside the Carbon and Cocoa event loops, enabling hybrid applications during the transition decade.

## Body
### Purpose and Design
Carbon delivered a library of procedural C interfaces that mapped classic Mac OS toolbox services—graphics, text, memory, files, and user-interface objects—onto the modern Mach-based kernel and Quartz rendering layer of macOS. Developers recompiled rather than rewrote, gaining preemptive multitasking, protected memory, and other Unix-style benefits without learning Objective-C.

### Lifecycle
Apple introduced Carbon alongside the first Mac OS X developer preview in 2000. Public documentation appeared on developer.apple.com/carbon, and the API shipped in every Mac OS X final release from 10.0 (2001) onward. Deprecation notices began with the 64-bit transition; by macOS 10.15 (2019) Carbon headers were removed from the default SDK, and Apple Silicon Macs launch only 64-bit Cocoa binaries.

### Technical Scope
Carbon encompassed:
- Core Services (file system, text encoding, memory management)
- Carbon UI (windows, controls, event managers)
- QuickDraw compatibility layer for 2-D drawing
- Resource manager and bundle services for application packaging

All functionality was accessible via straight C calls, so compilers other than Xcode (Metrowerks CodeWarrior, gcc) could target it.

### Relationship to Cocoa
Although both APIs could be used in the same process, they used separate event dispatch models. A “Carbon-Cocoa integration” guide documented how to embed Carbon windows inside Cocoa apps and vice-versa, but Apple eventually recommended full Cocoa adoption for new features like 64-bit addressing, Objective-C automatic reference counting, and later Swift interoperability.

### Legacy
Carbon’s source-compatiblity promise kept major creative suites and enterprise tools on the Mac during a fragile transition period. Once those vendors completed Cocoa rewrites, Carbon’s maintenance burden outweighed its utility, leading to its retirement and cementing Cocoa as the sole first-class API for modern macOS development.

## References

1. Freebase Data Dumps. 2013
2. Quora