Alien FFI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Alien FFI

Ang BeePeng
I'm trying to load Alien-core into my image, in Windows. It complaint about syntax error.

Ccalloc: byteSize "<Integer> ^<Integer>"
        <primitive: 'primCalloc' error: Literal constant expected ->errorCode module: 'IA32ABI'>
        ^self primitiveFailed

Similar error occur to many other methods. What should I do to correct it?

Thanks.

Ang Beepeng
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

johnmci
Did you follow the instructions via:

http://www.nabble.com/-squeak-dev--Re:--Pharo-project--Alien-FFI-td20656508.html


On 21-Mar-09, at 6:16 AM, Ang Beepeng wrote:

>
> I'm trying to load Alien-core into my image, in Windows. It  
> complaint about
> syntax error.
>
> Ccalloc: byteSize "<Integer> ^<Integer>"
> <primitive: 'primCalloc' error: Literal constant expected ->errorCode
> module: 'IA32ABI'>
> ^self primitiveFailed
>
> Similar error occur to many other methods. What should I do to  
> correct it?
>
> Thanks.
>
> Ang Beepeng
> --
> View this message in context: http://www.nabble.com/Alien-FFI-tp22635925p22635925.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

Ang BeePeng
Yes, I loaded the Alien-core-first first, and also the VMMaker support and plugin. Syntax error occur when I load Alien core.

I haven't generate the plugin yet, but I think it should not affect the process of loading in the package, will it?

Thanks.

Ang Beepeng

John M McIntosh wrote
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

johnmci
I've only tested with Pharo what type of image are you using?

On 21-Mar-09, at 10:36 AM, Ang Beepeng wrote:

>
> Yes, I loaded the Alien-core-first first, and also the VMMaker  
> support and
> plugin. Syntax error occur when I load Alien core.
>
> I haven't generate the plugin yet, but I think it should not affect  
> the
> process of loading in the package, will it?
>
> Thanks.
>
> Ang Beepeng
>
>
> John M McIntosh wrote:
>>
>> Did you follow the instructions via:
>>
>> http://www.nabble.com/-squeak-dev--Re:--Pharo-project--Alien-FFI-td20656508.html
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Alien-FFI-tp22635925p22638453.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

Ang BeePeng
Squeak3.10.2-7179-basic.image, I get it from the Squeak.org when I first learn on Squeak. The basic one.

Thanks.

Ang Beepeng

John M McIntosh wrote
I've only tested with Pharo what type of image are you using?
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

johnmci
You should attempt your efforts using a pharo image and see if you  
have the same problems.

On 21-Mar-09, at 12:14 PM, Ang Beepeng wrote:

>
> Squeak3.10.2-7179-basic.image, I get it from the Squeak.org when I  
> first
> learn on Squeak. The basic one.
>
> Thanks.
>
> Ang Beepeng
>
>
> John M McIntosh wrote:
>>
>> I've only tested with Pharo what type of image are you using?
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Alien-FFI-tp22635925p22639337.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

Eliot Miranda-2
In reply to this post by Ang BeePeng
Hi Ang,

On Sat, Mar 21, 2009 at 6:16 AM, Ang Beepeng <[hidden email]> wrote:

I'm trying to load Alien-core into my image, in Windows. It complaint about
syntax error.

Ccalloc: byteSize "<Integer> ^<Integer>"
       <primitive: 'primCalloc' error: Literal constant expected ->errorCode
module: 'IA32ABI'>
       ^self primitiveFailed

You are missing some pragma support.  The relevant method in my image (unofficial) that accepts a variable name in that position is attached.

HTH

Eliot


Similar error occur to many other methods. What should I do to correct it?

Thanks.

Ang Beepeng
--
View this message in context: http://www.nabble.com/Alien-FFI-tp22635925p22635925.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.






Parser-pragmaLiteral.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

johnmci
Alien-Core has this, so is the one  you've attached superceeds that?

pragmaLiteral: selectorSoFar
        "Read a pragma literal.  As a nicety we allow a variable name (rather
         than a literal string) as the second argument to primitive:error:"

        (hereType == #string or: [ hereType == #literal or: [ hereType ==  
#number ] ])
                ifTrue: [ ^ self advance ].
        (here == $# and: [ tokenType == #word ])
                ifTrue: [ ^ self advance ].
        (here == #- and: [ tokenType == #number ])
                ifTrue: [ ^ (self advance; advance) negated ].
        (here = 'true' or: [ here = 'false' or: [ here = 'nil' ] ])
                ifTrue: [ ^ Compiler evaluate: self advance ].
        ((selectorSoFar = 'primitive:error:') and: [hereType == #word]) ifTrue:
                [^self advance].
        ^ self expected: 'Literal constant'


On 21-Mar-09, at 2:19 PM, Eliot Miranda wrote:

> Hi Ang,
>
> On Sat, Mar 21, 2009 at 6:16 AM, Ang Beepeng <[hidden email]>  
> wrote:
>
> I'm trying to load Alien-core into my image, in Windows. It  
> complaint about
> syntax error.
>
> Ccalloc: byteSize "<Integer> ^<Integer>"
>        <primitive: 'primCalloc' error: Literal constant expected -
> >errorCode
> module: 'IA32ABI'>
>        ^self primitiveFailed
>
> You are missing some pragma support.  The relevant method in my  
> image (unofficial) that accepts a variable name in that position is  
> attached.
>
> HTH
>
> Eliot
>
>
> Similar error occur to many other methods. What should I do to  
> correct it?
>
> Thanks.
>
> Ang Beepeng
> --
> View this message in context: http://www.nabble.com/Alien-FFI-tp22635925p22635925.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>
>
> <Parser-pragmaLiteral.st>

--
=
=
=
========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
=
=
=
========================================================================




Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

Eliot Miranda-2


On Sat, Mar 21, 2009 at 5:40 PM, John M McIntosh <[hidden email]> wrote:
Alien-Core has this, so is the one  you've attached superceeds that?

Yes.  The old one doesn't support primitive:moduleName:error: et al.

(apologies)
 
pragmaLiteral: selectorSoFar
       "Read a pragma literal.  As a nicety we allow a variable name (rather
        than a literal string) as the second argument to primitive:error:"

       (hereType == #string or: [ hereType == #literal or: [ hereType == #number ] ])
               ifTrue: [ ^ self advance ].
       (here == $# and: [ tokenType == #word ])
               ifTrue: [ ^ self advance ].
       (here == #- and: [ tokenType == #number ])
               ifTrue: [ ^ (self advance; advance) negated ].
       (here = 'true' or: [ here = 'false' or: [ here = 'nil' ] ])
               ifTrue: [ ^ Compiler evaluate: self advance ].
       ((selectorSoFar = 'primitive:error:') and: [hereType == #word]) ifTrue:
               [^self advance].
       ^ self expected: 'Literal constant'



On 21-Mar-09, at 2:19 PM, Eliot Miranda wrote:

Hi Ang,

On Sat, Mar 21, 2009 at 6:16 AM, Ang Beepeng <[hidden email]> wrote:

I'm trying to load Alien-core into my image, in Windows. It complaint about
syntax error.

Ccalloc: byteSize "<Integer> ^<Integer>"
      <primitive: 'primCalloc' error: Literal constant expected ->errorCode
module: 'IA32ABI'>
      ^self primitiveFailed

You are missing some pragma support.  The relevant method in my image (unofficial) that accepts a variable name in that position is attached.

HTH

Eliot


Similar error occur to many other methods. What should I do to correct it?

Thanks.

Ang Beepeng
--
View this message in context: http://www.nabble.com/Alien-FFI-tp22635925p22635925.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.



<Parser-pragmaLiteral.st>

--
===========================================================================
John M. McIntosh <[hidden email]>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================







Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

Ang BeePeng
In reply to this post by Eliot Miranda-2
Hi.

I tried that, still getting the same error. I tried to load the package into Pharo image, and it is fine.

Thanks. :)

Ang Beepeng

Eliot Miranda-2 wrote
Hi Ang,

You are missing some pragma support.  The relevant method in my image
(unofficial) that accepts a variable name in that position is attached.

HTH

Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Alien FFI

Eliot Miranda-2
looks like your image doesn't have pragma support.  You must have either pragma support or special code to compile the primitive:error:module: pragmas.


On Sun, Mar 22, 2009 at 12:42 PM, Ang Beepeng <[hidden email]> wrote:

Hi.

I tried that, still getting the same error. I tried to load the package into
Pharo image, and it is fine.

Thanks. :)

Ang Beepeng


Eliot Miranda-2 wrote:
>
> Hi Ang,
>
> You are missing some pragma support.  The relevant method in my image
> (unofficial) that accepts a variable name in that position is attached.
>
> HTH
>
> Eliot
>
>

--
View this message in context: http://www.nabble.com/Alien-FFI-tp22635925p22649725.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.





Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Alien FFI

Andreas.Raab
Should this work in the closure-converted image? If so, this would be a
good starting point:

http://squeakvm.org/win32/release/Squeak-3.10.2-Closures.zip

Cheers,
   - Andreas

Eliot Miranda wrote:

> looks like your image doesn't have pragma support.  You must have either
> pragma support or special code to compile the primitive:error:module:
> pragmas.
>
>
> On Sun, Mar 22, 2009 at 12:42 PM, Ang Beepeng <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>     Hi.
>
>     I tried that, still getting the same error. I tried to load the
>     package into
>     Pharo image, and it is fine.
>
>     Thanks. :)
>
>     Ang Beepeng
>
>
>     Eliot Miranda-2 wrote:
>      >
>      > Hi Ang,
>      >
>      > You are missing some pragma support.  The relevant method in my image
>      > (unofficial) that accepts a variable name in that position is
>     attached.
>      >
>      > HTH
>      >
>      > Eliot
>      >
>      >
>
>     --
>     View this message in context:
>     http://www.nabble.com/Alien-FFI-tp22635925p22649725.html
>     Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>
>
>
> ------------------------------------------------------------------------
>
>