jcw 2011-04-19 - With NaTcl illustrating that it's possible to run the same compiled code across different OS platforms, I'm wondering whether it'd be possible to do the same for Tcl extensions:
There are a range of hurdles, but for new developments such as NaTcl to become widespread, it may simply be unavoidable in the longer term.
The biggest hurdle may be how to implement a binary code loading mechanism which works across OS's (and which passes each of their code-signing requirements). And the next one is no doubt figuring out how to generate the binary code in this to-be-define binary extension format. IIRC, the Apache web server platform once did this sort of stuff.
RLE (2011-04-19) If memory serves, X.org already has an OS independent loading mechanism for loading compiled video drivers and other compiled extensions into the X server. Maybe you might want to look there for inspiration.
MS notes that at least Windows uses a different C calling convention from the others. This sounds like very problematic to me, I don't know how NaCl does it. Possibly by refusing to link in native libraries that are not part of the NaCl ecosystem?
RLE (2011-04-20) It would seem that such could be worked around by a small wrapper that switched calling conventions before jumping into the called function, then reversed the change upon return from the called function. Yes, a small performance loss for the side that contains the mismatch, but that loss might be worthwhile if a single compiled extension could work cross platform.