Why does Software care about the architecture?

Posted:
in Mac Software edited January 2014
Hello. for the record, this post would probably fit in Mac OS, Applications and Future Hardware. If a Mod feels it is better suited for something other than Applications, please move it.



Anyway, i have a stupid question that comes completely from curiosity. I am not a programmer. The only thing i know is HTML (which isn't really a language) and stuff for my TI-83. Because of that i have a question:



Why does software, besides the actual OS itself, care about what architecture the computer is using? I mean, why would programmers have to port code when it is the same underlying OS. I understand porting from one OS to another, but why architecture?



Sorry if this is a very newbie question but i haven't been able to figure it out.

Comments

  • Reply 1 of 3
    skatmanskatman Posts: 609member
    Well, for the most part, software doesn't care these days. (there are exceptiong, of course)

    These days much of the software is written by combining prebuilt blocks into larger blocks which are then combined into even larger blocks and so on.

    The collection of the basic blocks for a particular OS on a particular architecture is called Application Programing Interface (API). APIs for the same OS on 2 different architectures, while being very similar to each other, are usually not identical and that may cause compatibility problems.

    Another case is when the software code doesn't use standard API, but rather uses some unorthodox calls for one reason or another. Games often do this. Then all the bets are off as one needs to figure out how to convert these unorthodox calls from one architecture to another.
  • Reply 2 of 3
    bborofkabborofka Posts: 230member
    When developers write software, they usually write code in an abstract, high-level language like C, C++, Objective-C, etc. When developers want to test or run this code, they have to compile it into something the computer can understand, which is all 1's and 0's (machine code). Computers don't understand the english-like phrases (if statements, for loops, variable declarations, etc.) we use to build software. These languages are just representations of 1's and 0's, through many layers of abstraction. They are translated to these 1's and 0's during the compile process. Abstraction makes writing software much easier, because no one would be able to write great software by writing long lines of 1's and 0's or assembly.



    That said, all these years, Mac software has been compiled for the PowerPC architecture, which processes 1's and 0's differently than the Intel architecture. That is why software cares about the architecture. Fortunately, the transition from PPC to Intel will be easier because not a lot of modification of the code is needed by the developer if it's written in Objective-C, C++, etc. All the dirty work is done by the compiler (gcc), which translates the high-level programming language (english-like) into machine language for Intel (1's and 0's).
  • Reply 3 of 3
    sunilramansunilraman Posts: 8,133member
    a bit off topic, but anyone remember those 'demos' in the early 90's, stuff written in pure assembly, with like some smooth (but primitive) 3d graphics and stuff?
Sign In or Register to comment.