Create an executable for a program in an interpreted language: Difference between revisions
Create an executable for a program in an interpreted language (view source)
Revision as of 11:50, 11 July 2022
, 1 year ago→{{header|Phix}}: added format directive note
m (→{{header|J}}) |
m (→{{header|Phix}}: added format directive note) |
||
Line 382:
If "p test" interprets something then "p -c test" produces an executable, and, unless you also specify "-norun" on the command line, invokes it immediately.<br>
There is a standard ''get_interpreter()'' routine which yeilds a full directory path and name, that should be used in preference to a hard-coded "p" or whateverer.<br>
Additionally pwa/p2js can be used to convert "test" into JavaScript, not yet via a command line, you'll have to manually select the file or paste the source code in, bar some programs being explictily marked as incompatible via "without javascript_semantics", for instance because they perform disk i/o or similar that is not permitted from within a web browser. However one thing that cannot do is create an "executable" that will run in a web browser.▼
A format directive can also be used to force cross-compilation, see p32.exu or p64.exu and phixzip.exw for a trivial example of that, in real-world use.<br>
▲Additionally pwa/p2js can be used to convert "test" into JavaScript, [not yet via a command line, you'll have to manually select the file or paste the source code in
Despite the protestations in the task description, there is no code that could possibly add any value to this entry, though perhaps if you are sufficiently desperate for such, you could always go and look at [[Rosetta_Code/Run_examples#Phix]], since that writes out text downloaded from the rosettacode site and runs (interprets) it, in at least five different programming languages already. Plus of course the "-c"
=={{header|Wren}}==
|