codon icon indicating copy to clipboard operation
codon copied to clipboard

Question: Platform - cross compiling plans?

Open tpcgold opened this issue 1 year ago • 3 comments

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)

tpcgold avatar Mar 30 '23 07:03 tpcgold

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.

NickDatLe avatar Mar 31 '23 00:03 NickDatLe

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?

philiplessner avatar Jul 22 '23 20:07 philiplessner

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.

setop avatar Sep 15 '23 20:09 setop