| ▲ | neuroelectron 13 hours ago |
| It's amazing to me that this is trusted to build so much of software. It's basically impossible to audit yet Rust is supposed to be safe. It's a pipe dream that it will ever be complete or Rust will deprecate it. I think infinite churn is the point. |
|
| ▲ | pornel 13 hours ago | parent | next [-] |
| Rust does its own testing, and regularly helps fix issues in LLVM (which usually also benefits clang users and other LLVM languages). Optimizing compilers are basically impossible to audit, but there are tools like alive2 for checking them. |
|
| ▲ | hu3 13 hours ago | parent | prev | next [-] |
| Go is sometimes criticised for not using LLVM but I think they made the right choice. For starters the tooling would be much slower if it required LLVM. |
| |
| ▲ | phplovesong 12 hours ago | parent [-] | | Also OCaml. Having a own compiler is THE way for language development. IMHO. | | |
| ▲ | anonymous908213 10 hours ago | parent [-] | | Personally I think a happy medium is to compile to C99. Then, after your own compiler's high-level syntax transformation pass, you can pass it through the Tiny C Compiler which is somewhere on the order of ~10x faster than Clang -O0. When you need performance optimizations at the cost of build speed, or to support a compilation target that TCC does not, you can freely switch to compiling with Clang, getting much of the value of LLVM without ever specifically targeting it. This is what I do for my own language, and it makes my life significantly easier and is perfectly sufficient for my use, since as with most languages my language will never be used by millions of people (or perhaps only ever one person, as I have not deigned to publish it). I think writing a compiler targeting machine code from scratch only really makes sense if you have Google's resources, as Go did. That includes both the money and the talent pool of employees that can be assigned to work on the task full-time; not everyone has Ken Thompson lying around on payroll. To do better than LLVM is a herculean feat, and most languages will never be mainstream enough to justify the undertaking; indeed I think an undertaking of that scale would prevent a language from ever getting far enough along to attract users/contributors if it doesn't already have powerful backing from day 0. | | |
| ▲ | simonask 7 hours ago | parent | next [-] | | That might be convenient if your language has semantics that map well-ish to C99 semantics. But C is a really messy language with lots of little quirks. For example, Rust code would compile to something slower if it had to use C as an intermediate representation. Also, compiled languages want accurate and rich debug info. All of that information would be lost. | | |
| ▲ | tubs 7 hours ago | parent [-] | | You can track debug symbol through c. It’s just one of many layers debug info gets tracked through. |
| |
| ▲ | adgjlsfhk1 5 hours ago | parent | prev [-] | | C is a pretty horrible compilation target. Avoiding UB when generating C code is really tough. |
|
|
|
|
| ▲ | bigstrat2003 11 hours ago | parent | prev [-] |
| > I think infinite churn is the point. That would require the LLVM devs to be stupid and/or evil. As that is not the case, your supposition is not true either. They might be willing to accept churn in the service of other goals, but they don't have churn as a goal unto itself. |
| |