8 ms·
> Do we not want the next generation to exclusively use safe languages? Someone has to write (and maintain) the safe languages.
by toast0 10y ago
> Do we not want the next generation to exclusively use safe languages?
Someone has to write (and maintain) the safe languages.
- nv-vn 10y agoNot like it requires C to implement a new language.
- Jtsummers 10y agoThis is a remarkably common belief and it bugs me to no end. I don't know why, but many people have developed this conviction that C is required for computers to work, that that's the baseline of computation. This comes from both novices and experts. I haven't figured it out.
- moosingin3space 10y agoThe C Abstract Machine looks like a generic machine based on the Von Neumann architecture, so it "feels" like it should be fundamental. Add in some sunk-cost fallacy, and a lot of people end up with the belief that C is fundamental to computing, despite the existence of systems that do not use any C.
- moosingin3space 10y agoCounterexample: Rust compiler is written in Rust.
- PeterisP 10y agoDoesn't Rust compilation rely on LLVM for all the actual compilation from IR to machine code?
- kibwen 10y agoFor now it does, but there's an upcoming experimental alternative backend written in Rust. Furthermore, there's no reason that LLVM has to be written in C++, it was just the best choice available when LLVM got started 15 years ago. Suffice to say, there are higher priorities for the Rust project than porting LLVM. :P
- moosingin3space 10y agoYes, but there is a research project here that replaces LLVM for codegen: https://github.com/stoklund/cretonne https://github.com/stoklund/cretonne
- PeterisP 10y agoYou can easily write the compilers/interpreters/other tooling in high level, memory safe languages. Not all, but quite a few of those safe languages have their tooling built in the same language PyPy is written in Python, golang has a compiler made in go, etc. Many others do rely in part on LLVM, but in the "long future" there's no technical reason why a common component like LLVM has to be written in C/C++, who knows, people might switch to something else written in a memory-safe language.