← Back to context

Comment by quelsolaar

3 years ago

"Weird" platforms often do have their own tool-chains but they do have the ability to leverage LLVM, MISRA, and an array of common tools and analyses that exists for C. One of the reason we got new platforms like RISC-V is that today its possible to use existing OSS software to build a platform with a working OS and Development environment, that common basic libraries can be built for is that all this software is written in C and can be targeted towards a new platform.

doesn't LLVM only cover a smidge of the weird platforms, if that?

Like, it doesn't even cover ESP32 chips, despite attempts to get support into LLVM since 2019.

point being, they can't leverage LLVM

What is the relevance of RiscV here? Not weird at all. I feel like you skipped part of the argument.

  • Ok here’s a concrete one, ARM is experimenting with a brand new CHERI implementation that throws out a lot of “obvious” things that are supposed to be true for pointers and integers. The only way this has been able to work is that the standard is flexible enough to let C(++) work here. Rust is getting breaking changes to support the platform.

    • Unsurprisingly Rust can target Morello already but it comes at a performance penalty. Whereas C has myriad integer types for special purposes, Rust only has a pair - a signed and unsigned integer of the same size as pointers. Since on CHERI a pointer is a different size from an address, Rust pays the price of using a 128-bit integer (to store pointers) as its array index.

      The potential change would make these types address-sized, so you can't fit a whole pointer in them on Morello where the pointer isn't just an address. On other platforms this change makes no practical difference.

  • The point is that new exploration of the design space only works when there’s a familiar environment to build on. The old days of each architecture being its own hermetic environment are gone.