So, what specifically did you want to say about language grammar, extensibility, features that could be helpful to MCU developers?
There is very little (if anything) about language grammar that could be useful to MCU developers.
How did you establish that? what evidence supports this claim? Here's a post by an engineer that proves you wrong, I quote:
Ehh, what?
What has that post by that engineer have to do with language grammar? They're talking about conditional builds, which is solved by any toolchain that generates linkable object files by selecting which object files to compile and include in the final image.
ELF object files support per-symbol sections,
regardless of the language you use, which allows the linker to select which symbols (usually functions) to include based on which symbols
may be referenced. It means that only features you actually use are included in the linked target, and this is heavily used in current embedded toolchains, which basically all use ELF object files. You do not even have to
deselect the features you do not need; all you need to do is make sure all you might need is available (via whatever
include or
import mechanism your language uses), and use the ones you want. Only the features you use, and the features they refer to, will get included in the final linked object.
_ _ _
The way we established "language grammar isn't important to embedded developers" is by being, and working with embedded developers, who use whatever tools fit the task at hand best. Grammar is just flavour. I've never heard of any successful developer choosing their programming language or environment based on the grammar. I have seen many who did choose their programming language based on grammar or because it was the only language they could use, fail. I've talked with, and continuously talk to, and occasionally help, many developers, both in embedded and application development. Grammar has never been more than a flavour on top, as in "I find it ugly" or "it looks neat"; never at the core of any discussion related to solving a problem.
I'm not sure if I have talked shop in such details with the commonly suggested 1000 persons sufficient for a random opinion poll, and the selection definitely isn't random, but it is a significant number, well over a hundred at minimum. I also do not shy away from antagonistic discussions, so I often disagree with others –– often to find out the underlying reasons for their opinions, because opinions themselves aren't useful, but the reasons underlying the opinions are. (For one, opinions cannot be compared in any rational manner, but the reasons for those opinions can usually be rationally examined and compared.)
I note that one of the desires there was "give easy access to the flags". I pointed out that many ISAs don't even *have* flags.
Yep. In particular, you helped me realize I did not actually desire access to flags, just multiple function result values, to fulfill my needs.
Yes. Multiple return values are very desirable. Returning structures can substitute, but it's notationally annoying.
Most modern ABIs allow returning two word-size or one double sized value. With register based ABIs, usually in the same registers as used for the first two arguments. x86_64 is a weird exception with the first argument passed in RDI but the result in RAX.
But why can't you pass the same number of results as arguments? Function return is semantically no different to function call -- it is "calling the continuation". It would clearly be very very easy to enable this in modern ABIs that pass up to 6 or 8 arguments in registers -- it's simply relaxing a restriction. Figuring out where to put return values that overflow into RAM is harder. If the caller knows how many results are to be returned then it can allocate stack space for max(arguments, results). Support an unbounded number of return values would be a lot harder. But it's also hard to see a reason to support it. VARARGS seems like mostly a hack to support printf and friends.
Exactly. No, I don't need unbounded parameters or return values myself; even for printf and friends I prefer a string-building approach (if you recall my old replacement for standard C thread).
If we consider things like Foreign Function Interfaces and such, we could augment object file symbol versioning (or similar) to explicitly specify the exact function ABI variant, as in how many inputs and outputs, in which registers or stack –– noting that many architectures like x86-64 and ARMv8 already have separate vector registers for FP parameters. It does not even need to know the logical types, ie. whether something is an address or a number, just which registers or stack words are used for inputs, outputs, and as scratch registers. One would still need the exact declarations in each programming language, and compilers would need to check the declaration matches the object file ABI variant.
This is not dependent on any specific programming language, though.
It would be very interesting to consider if binary-only libraries should contain introspection information for their symbols, including the above information. Not necessarily introspection in the same file, but in an associated file, in some kind of common format. We already know from the widely used
GObject Introspection (for FFI bindings of GObject-based libraries, to a number of programming languages) that it can be extremely useful and powerful mechanism for run-time linkage across programming languages. (Most users of it aren't even aware of using it, it works that well.)