Ah OK thanks. So I suppose that polyml knows to look for the "main"
function due to the PolyML.export command specified in :
compile()
{
echo "use (List.nth(CommandLine.arguments(), 2));
PolyML.export(List.nth(CommandLine.arguments(), 3), main);" |
${BINDIR}/poly -q --error-exit "$1" "$2"
}
function in polyc.in at
https://github.com/polyml/polyml/blob/ce3107ba56c642bb0e1e8f60605018f9f46c49e8/polyc.in
?
On Fri, Sep 4, 2015 at 10:59 AM, David Matthews <
[email protected]> wrote:
> On 03/09/2015 22:38, Artella Coding wrote:
>
>> Is "Handle IntTaskData::EnterPolyCode()" in interpret.cpp (
>>
>> https://github.com/polyml/polyml/blob/ce3107ba56c642bb0e1e8f60605018f9f46c49e8/libpolyml/interpret.cpp
>> )
>> the point at which the sml main function is invoked from the C code?
>> Thanks
>>
>
> It's the point at which the run-time system (RTS) switches to ML code but
> only if you happen to be using interpreted byte code. If you are running
> on any X86 machine (32 or 64-bit) you will almost certainly be running the
> native machine code version of the compiler and RTS and then the relevant
> function is X86AsmSwitchToPoly called from X86TaskData::EnterPolyCode.
> Even then there are some layers of ML code before your own "main" function
> is entered.
>
> David
> _______________________________________________
> polyml mailing list
> [email protected]
> http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
>
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml