Hey all,
Would someone help me understand the difference between “porting” and “cross-compiling”? I did some googling and YouTubing but it seems some people don’t make a distinction, some do, and some talk about crossing to a different OS and some to a different chip architecture.
PS: I have also read that porting/cross-compiling takes a very long time and can be a hard task – apparently Google Chrome and Firefox both have assembly in them but why was it so important to put assembly in them? It has to be super important given that they knew it would take a long time to port/cross compile to a different chip than the original one right?!
Thanks so much!
Thanks!!
In: Technology
As an analogy: cross-compiling is taking a product, translating the text on the box into German, and trying to sell the product in Germany. That might work for some products, like a bicycle for example.
Porting is taking a product and rethinking it for a different market. That might be needed for something like a washing machine, where everything from the power outlet shape to typical expectations of appliances might be completely different in Germany.
To answer your second question: the vast majority of the code in Chrome and FIrefox is written in a high-level language that can be cross-compiled to any processor architecture like x86 or ARM. Only a tiny fraction is written in assembly language and that’s usually done for performance reasons, in rare cases where that’s the only way to make code optimally efficient. I doubt that would be a large roadblock.
However, Chrome and Firefox have lots of code that’s specific to each operating system. That’s because operating systems provide all of the functionality needed to do just about anything fundamental on a computer, including interacting with hardware (your disk, display, keyboard, mouse, network, etc.). Each operating system has completely different functions you need to call to accomplish those tasks.
Chrome and Firefox were both designed from the start to be ported to multiple operating systems. However, the work needed to port to a new operating system is massive because browsers are large and complex and there are probably hundreds of thousands of lines of operating-system-specific code that needs to be ported.
Latest Answers