PlatformIO Community

Terminology: What is "Platform"?

When reading the documentation, I was thoroughly confused. I drew the conclusion that “development platform” is the machine the developer uses for compiling: Windows, Mac or Linux, and “platform” was the target architecture that executes the final binary. But some other places suggest that “development platform” means the target architecture.
Are there established terms to unambigiously separate the two?

If not, I would suggest we use the common industry terms as used here: https://en.wikipedia.org/wiki/Cross_compiler. “Host” and “target” platforms should be easy to understand.

In fact, I’m trying to make the documentation clearer myself. I can include a clarification of the naming in the documentation edits I will propose.

Any particular page? I’m thinking you mean this one in particular.

You are correct in your interpretation of ‘platform’, being the target architecture for which all the toolchain, support tools, build scripts and board definitions are configured for.

I think here we hit one of the major faults of the English language - i.e. ambigious and contextual meaning, with ‘Development platforms’ (heading) in this instance in referring to the platforms to develop for, not the development platform aka host machine.

Thanks. Yes that’s the page. On thing that confuses me on that page is “Each development platform contains […] Pre-compiled toolchains and relative tools for multiple architectures”.

Can each development platform really include multiple architectures?

The answers are probably obvious for old-timers but trip up newcomers like myself. I will post a pull request with an introduction of the terms later on so this discussion can benefit more people.

1 Like

Yes, see https://github.com/platformio/platform-teensy
AVR + ARM.

1 Like

I think there two facets to multiple architectures… multiple target architectures such as AVR + ARM as Ivan just pointed, out, and also multiple host architectures… i.e. when I specify a platform, I don’t have to say something like “atmelavrOnWin” or “armelavrOnLinux”… I can just go ‘atmelavr’ and it will install the the necessary stuff for the host architecture. So it’s very much dependent on which way you are looking… :open_mouth:

Yes, see https://github.com/platformio/platform-teensy
AVR + ARM.

Interesting. Looking at the source code https://github.com/platformio/platform-teensy/blob/develop/builder/main.py I’d guess the Teensy platform is an outlier and that for most platforms, the platform equals a target architecture. If that was not the case, you could introduce a new abstraction level “architecture” to be reused by multiple platforms. Clearly that’s not worthwhile.

Another thing that makes me think Teensy is a special case are lines such as
elif "BOARD" in env and board_config.get("build.core") in ("teensy3", "teensy4")
that introduce dependencies from the platform to specific boards. I’m sure this pattern is rational here, but I don’t see the big benefit of the ‘platform’ concept if this pattern was common-place for all platforms.

TLDR; Is a platform normally the same as a target architecture?

Oh and are all development platforms supported by both Windows, Mac and Linux?

Normally yes, but there is scope for that to not be the case. Like any good rule of thumb, there are exceptions :wink:

Generally. Some are even supported on ARM (i.e. Raspberry Pi, and other SBCs also).

1 Like