4 ms·
That doesn't clear up any of my confusion, although that may well be because your experience is mostly with managed languages where the distinction between comp
by jcranmer 6y ago
That doesn't clear up any of my confusion, although that may well be because your experience is mostly with managed languages where the distinction between compiler and runtime is less obvious.
Even looking at major languages [1], what do we have:
* Self-hosting languages: C#, Go, Haskell, Java, most LISP implementations, OCaml, Pascal, Rust, Swift
* C++ implementation: C/C++/Objective-C compilers, Fortran compilers (using the same toolchains as the former), JavaScript, probably Visual BASIC (although that may be C# instead)
* C implementation: Perl, PHP, Prolog, Python, R, Ruby, Shell (although note that many of these languages have their libraries largely written in their own language).
* Not sure: ALGOL, APL, Cobol, Erlang, Forth, Kotlin, SQL, Simula, Smalltalk. Although I suspect that many of these are self-hosted.
7 of 32 is a far cry from "most languages".
[1] Using the list of programming languages in Wikipedia's category box at the bottom here.
- deleted 6y ago[deleted]
- dnautics 6y agoerlang is written in c. somewhat controversially, the new JIT has C++ in it.
- int_19h 6y ago"Self-hosting" can be a bit tricky to define for Forth. A typical implementation would start with a few words defined manually in assembly, and build the rest up from there. That aside, you need to account for multiple implementations. E.g. for Python, CPython is written in C, but PyPy is self-hosted (kinda; it's complicated: https://doc.pypy.org/en/latest/architecture.html#layers https://doc.pypy.org/en/latest/architecture.html#layers).