exaloop / codon

A high-performance, zero-overhead, extensible Python compiler using LLVM
https://docs.exaloop.io/codon
Other
15.01k stars 517 forks source link

Question: Platform - cross compiling plans? #309

Open tpcgold opened 1 year ago

tpcgold commented 1 year ago

Hi, Codon seems to have a lot of potential, are there any plans to allow cross-compiling code for different platforms? (e.g. would be also helpful for embedded systems)

NickDatLe commented 1 year ago

If it's going to be similar to rust or go, then I think you'll need to build the binaries on that system. You could just run a virtual machine (virtual box for example) and compile from that OS.

philiplessner commented 1 year ago

If it's going to be similar to rust or go, then I think you'll need to build the binaries on that system. You could just run a virtual machine (virtual box for example) and compile from that OS.

For an embedded microcontroller you can't compile on that system because of limited resources. You need to compile on a host (e.g., Linux, MacOS) using a cross compiler and flash the program to the target microcontroller. So the question is whether you will develop a compiler for microcontrollers (e.g., ARM Cortex M) that can be run on a Linux or MacOS host?

setop commented 1 year ago

Similar use case here. I'm trying to cross-compile for 32bit x86 target.

Zig does it by embedding tool chains for many target.

Nim kinda support it by generating C code (that can be cross-compiled with zig tool chain for example).

Best lead for Codon are probably to generate C or LLVM-IR or MLIR or any other intermediate representation that an other tool could cross compile.