4 ms·
> if you provide your own thin abstractions Without generics these abstractions are hard to work with and hard to make work across libraries. I am reminded of
by Manishearth 10y ago
> if you provide your own thin abstractions
Without generics these abstractions are hard to work with and hard to make work across libraries. I am reminded of https://thefeedbackloop.xyz/i-bet-that-almost-works/ https://thefeedbackloop.xyz/i-bet-that-almost-works/
> Take the rust compiler itself: AFAIK it's now implemented in C++
The compiler is written in Rust. It uses LLVM, which is in C++, for codegen, but in the future we might be able to turn that off too (https://internals.rust-lang.org/t/possible-alternative-compiler-backend-cretonne/4275/22 https://internals.rust-lang.org/t/possible-alternative-compi...)
Besides, the implementation language of a compiler does not make the compiler an "abstraction" over the language. Sort of, but not really.
- quicknir 10y agoUhm, in the context of native languages, without further qualification, it is clear that "compiler" is a program that translates said language into native code, i.e. assembly. To dismiss the translation of llvm IR into assembly as "codegen" is at best using a misleading definition of compiler. The only fair thing to say at present is that Rust's main/most useful/most performant/most whatever implementation is a mixture of Rust and C++.