What is OCaml written in?
The OCaml compiler is written in OCaml (well-documented). Its runtime is implemented in C and Assembly (documented). OCaml is self-hosting.
Relationship Graph
All directly connected languages. Click any node to navigate to its page.
Compiler Implementation
| Language | Confidence | Notes | Source |
|---|---|---|---|
| OCaml | 98% | OCaml compiler is self-hosting | Source |
Runtime Implementation
| Language | Confidence | Notes | Source |
|---|---|---|---|
| C | 95% | OCaml runtime/GC written in C | Source |
| Assembly | 85% | OCaml runtime has assembly components | Source |
Influenced By
- ML — OCaml is an ML dialect with objects added
- Standard ML — OCaml shares SML heritage
Languages OCaml Influenced
Frequently Asked Questions
What language is OCaml written in?
OCaml is primarily implemented in C and OCaml and Assembly. See the implementation section above for details and source references.
What languages influenced OCaml?
OCaml was influenced by ML, Standard ML among others. See the influence section above for the full list.
Which languages did OCaml influence?
OCaml influenced ReasonML, F# among others.
Is OCaml self-hosting?
Yes, OCaml is self-hosting — its compiler can compile itself.
Evidence Sources
- https://en.wikipedia.org/wiki/OCaml
- https://github.com/ocaml/ocaml
- https://github.com/iohub/rustboot
- https://reasonml.github.io/
- https://fsharp.org/history/hopl-final/hopl-fsharp.pdf