0

I'm in embedded development in C.

I've read that in distributed systems you should use the same programming language for different nodes or be prepared to reconcile different data types in the transmitted data.

Are there such warning signs for using different toolchains for different devices? If so, which parts of the toolchain should be the same?

2 Answers2

1

You should probably be prepared for that anyway. It's not a new issue - this is why we use bigendian data on the 'net, for instance - and there are tools prepared to do it, like DCE, MPI or CORBA.

Even if you use the same release of GCC on both sides, it won't eliminate architectural differences like endianness, data sizes available (long may be 64 bit, int may be 16 bit - for fixed sizes, use stdint.h) and such. Using different toolchains will usually not matter, because the above mentioned platform and ABI differences are there either way.

That said, you may run into things like standards compliance and new features that you want to match when you compile the program for multiple platforms, and getting the same toolchain is an easy way to achieve it. This is one of the driving forces behind GNU in the first place, because non-free vendors sometimes not only do not keep up, when they do, they want money for it. Often in the form of forcing you to replace your machines too.

Yann Vernier
  • 15,414
  • 2
  • 28
  • 26
1

There is not much point in locking yourself to one tool or toolchain, since in distributed systems which should be able to communicate with others you will have to think about communication protocol and data representation anyway. For example, even if you use same toolchain, target architectures may have different internal data representations, such as endianess and software has to take care of that.

I would recommend designing communication protocol which does not depend of target system architecture or particular toolchain. This way you will save yourself a trouble of redesigning the system when requirements change (i.e. another target architecture may have to be added which will have binary data representation incompatible with the "usual" one or it may require some special tools).

user688996
  • 173
  • 7