←back to thread

Eurydice: a Rust to C compiler

(jonathan.protzenko.fr)
185 points todsacerdoti | 2 comments | | HN request time: 0.018s | source
Show context
bloppe ◴[] No.46180140[source]
Rust compiles to LLVM IR. I'm pretty surprised that building this transpiler was considered a better use of time than writing an LLVM backend for whatever "weird embedded target" might need this.
replies(9): >>46180523 #>>46180571 #>>46180649 #>>46180773 #>>46180810 #>>46181523 #>>46184598 #>>46185313 #>>46189858 #
Wuzado ◴[] No.46180649[source]
Sometimes you may need to deal with odd proprietary processors with limited and flawed knowledge about them.

For example, in the 37c3 talk "Breaking "DRM" in Polish trains" by the folks from Dragon Sector (I highly recommend watching it), they needed to reverse-engineer Tricore binaries, however they found the Ghidra implementation had bugs.

As for the PLCs, the IEC 61131-3 functional block diagrams transpile to C code which then compiles to Tricore binaries using an obscure GCC fork. Not saying that anyone would want to write Rust code for PLCs, but this is not uncommon in the world of embedded.

replies(1): >>46184185 #
1. mistrial9 ◴[] No.46184185[source]
.. there is some humor in the string

"Breaking "DRM" in Polish trains"

replies(1): >>46184645 #
2. iberator ◴[] No.46184645[source]
Why?