@mwieder:
1) There is certainly a cognitive difference in providing higher-level syntax for an operation than just having to perform the operation itself. However, with this change there would be an actual difference between both the action of the command and what the expressions in the syntax mean:
Code: Select all
do <args> as <language>
and
do <script> as <language>
And that difference comes about just by switching platforms.
2) The point here is that you cannot separate 'do ... as ...' from the 'alternateLanguages' feature. The syntax:
*Is* the syntax for the alternateLanguages feature - there's nothing in the syntax to be able to distinguish between the semantics you propose and the semantics that exist already on the other platforms.
Whilst the implementations are different on Mac and Windows, the semantics of them are largely the same - you give the engine a script and a language, and it executes that script in that language. Just because the feature is not currently implemented on Linux does not mean that syntax is available there for something that works in a different way - that very much goes against the 'cross-platform' spirit of LiveCode syntax.
To give an analogy, the dragImage isn't currently implemented on Linux, but I don't think anyone would be happy if (on Linux) you had to do:
Rather than:
Indeed, it would mean that you'd have to write separate clauses dependent on platform:
Code: Select all
if the platform is "Linux" then
set the dragImage to the filename of image id <id>
else
set the dragImage to <id>
end if
The point here is that by-and-large, the same syntax on all the platforms does work in the same way meaning you don't have to switch on platform. Now, I realize that there are many cases were platform-specific issues do crop up and mean this is necessary, but they should be the exception and not the rule (and gradually removed over time), and wherever possible the situation should not be made any worse.
3) The point here is not about compatibility in the effects of the command, but compatibility in the semantics of the syntax. The action is (of course) tied to platform-specific concerns - you are dealing with large opaque blobs of functionality (i.e. Windows Scripting Host, Open Scripting Architecture) over which LiveCode has no control and so a script that uses this feature has to be written with this in mind.
Certainly ensuring that the necessary pre-requisites are installed that an app requires is beyond the realm of LiveCode, but if they are installed there is an expectation that syntax on one platform will work in the same way as syntax on another platform.
As I pointed out in my previous post - 'perl' is an example of a language that has an embedding API. If someone came along in the future and wanted to add 'perl' to the alternateLanguages on all platforms (the perl embedding API appears to be cross-platform), then they could. However, if they did then programs that are using the variant you propose would break... Indeed, as posed (the proposed functionality being a 'fallback' if a language isn't present) already introduces this problem. On Windows, LiveCode has no control over the list of languages Windows Scripting Host provides so it is perfectly possible that some systems could have 'perl' as one of the alternateLanguages, if it does then a script that relies on the proposed variant would break.
Regardless of functionality, the point here is that we cannot really change the semantics of the syntax 'do <string> as <language>' as they have already been defined. The proposed feature has significantly different semantics so, at the very least, it needs different syntax.