Alien + Cog VM

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

Alien + Cog VM

Ken Treis
What's the status of Alien in the new Cog VM? I was able to load Alien into Pharo 1.1.1 running Cog, and some simple callouts worked (e.g. `CRLibrary libraryVersionString` in CairoGraphics. But every callout with arguments failed in primFFICallResult:.

Alien works perfectly for me in Pharo 1.1 using JMM's VMs when I load the Pharo 1.1 version from ConfigurationOfAlien, but I admit I haven't tried 1.1.1 in this arrangement.

Is there something that's changed in Cog's Alien primitive implementation?

--
Ken Treis
Miriam Technologies, Inc.


Reply | Threaded
Open this post in threaded view
|

Re: Alien + Cog VM

Eliot Miranda-2
Hi Ken,

On Wed, Nov 10, 2010 at 10:20 AM, Ken Treis <[hidden email]> wrote:
What's the status of Alien in the new Cog VM? I was able to load Alien into Pharo 1.1.1 running Cog, and some simple callouts worked (e.g. `CRLibrary libraryVersionString` in CairoGraphics. But every callout with arguments failed in primFFICallResult:.

Alien works perfectly for me in Pharo 1.1 using JMM's VMs when I load the Pharo 1.1 version from ConfigurationOfAlien, but I admit I haven't tried 1.1.1 in this arrangement.

Is there something that's changed in Cog's Alien primitive implementation?

IIRC, the Alien callout code is written assuming stacks grow up (in MethodContext instances) whereas in the Cog Stack and JIT VMs stacks grow down.  So the glue in platforms/Cross/plugins/IA32ABI/dabusiness.h needs rewriting.  Specifically the second loop over the arguments at line 45 needs to mimic the code at line 17.  (I know, insane; why have two different loops in the first place?  counting down towards zero can generate slightly faster code than counting up towards a limit; you need one less register).

But I'm hoping that the ALien callouts will die the death soon.  I have Alien callbacks integrated with the FFI and of course the ALien data manipulation code works fine.  So if you're eager to have Alien callouts work see whether the above change fixes things, in which case I can integrate the fix.  But if you're not so eager you could wait for me to push out the FFI changes, but that could take a few weeks.

HTH
Eliot

--
Ken Treis
Miriam Technologies, Inc.



Reply | Threaded
Open this post in threaded view
|

Re: Alien + Cog VM

Patricio Plaza A.
Hi Eliot,


Nowadays I'm working on Alien in Pharo 1.1 and I'd like to know how to work in Pharo 1.2 running Cog VM, do you have some example using Alien/AlienOpenGL?


Merry Christmas,


Patricio


El 10-11-2010, a las 22:40, Eliot Miranda escribió:

Hi Ken,

On Wed, Nov 10, 2010 at 10:20 AM, Ken Treis <[hidden email]> wrote:
What's the status of Alien in the new Cog VM? I was able to load Alien into Pharo 1.1.1 running Cog, and some simple callouts worked (e.g. `CRLibrary libraryVersionString` in CairoGraphics. But every callout with arguments failed in primFFICallResult:.

Alien works perfectly for me in Pharo 1.1 using JMM's VMs when I load the Pharo 1.1 version from ConfigurationOfAlien, but I admit I haven't tried 1.1.1 in this arrangement.

Is there something that's changed in Cog's Alien primitive implementation?

IIRC, the Alien callout code is written assuming stacks grow up (in MethodContext instances) whereas in the Cog Stack and JIT VMs stacks grow down.  So the glue in platforms/Cross/plugins/IA32ABI/dabusiness.h needs rewriting.  Specifically the second loop over the arguments at line 45 needs to mimic the code at line 17.  (I know, insane; why have two different loops in the first place?  counting down towards zero can generate slightly faster code than counting up towards a limit; you need one less register).

But I'm hoping that the ALien callouts will die the death soon.  I have Alien callbacks integrated with the FFI and of course the ALien data manipulation code works fine.  So if you're eager to have Alien callouts work see whether the above change fixes things, in which case I can integrate the fix.  But if you're not so eager you could wait for me to push out the FFI changes, but that could take a few weeks.

HTH
Eliot

--
Ken Treis
Miriam Technologies, Inc.




Reply | Threaded
Open this post in threaded view
|

Re: Alien + Cog VM

Joachim Geidel
In reply to this post by Eliot Miranda-2
Hi Eliot,

On Nov 11, 2010; 02:40am, Eliot Miranda-2 wrote:
> But I'm hoping that the ALien callouts will die the death soon.  I have
> Alien callbacks integrated with the FFI and of course the ALien data
> manipulation code works fine.  So if you're eager to have Alien callouts
> work see whether the above change fixes things, in which case I can
> integrate the fix.  But if you're not so eager you could wait for me to
> push out the FFI changes, but that could take a few weeks.

What exactly does "Alien callouts will die" mean? Does it mean that the
Alien class library is deprecated and will be replaced by a new version of
FFI? Or is it something else?

I am close to releasing JNIPort for Pharo/Squeak. I am currently using Alien
for interfacing to the Java VM, and with the exception of callbacks from the
JVM to Smalltalk which come from foreign threads, everything works now on
the Squeak VM ("foreign" callbacks still crash the VM which outputs
"scheduler could not find a runnable process" to the console).

I would be a bit unhappy if I had to dump this work and redo the interface
to the JVM, and I wouldn't be happy at all if I had to use different class
libraries for calling foreign functions depending on the VM (Cog vs. Squeak
VM). So, what's the "official" plan for Alien/FFI?

Best regards,
Joachim Geidel
Reply | Threaded
Open this post in threaded view
|

Re: Alien + Cog VM

Eliot Miranda-2


On Sun, Dec 26, 2010 at 8:19 AM, Joachim Geidel <[hidden email]> wrote:

Hi Eliot,

On Nov 11, 2010; 02:40am, Eliot Miranda-2 wrote:
> But I'm hoping that the ALien callouts will die the death soon.  I have
> Alien callbacks integrated with the FFI and of course the ALien data
> manipulation code works fine.  So if you're eager to have Alien callouts
> work see whether the above change fixes things, in which case I can
> integrate the fix.  But if you're not so eager you could wait for me to
> push out the FFI changes, but that could take a few weeks.

What exactly does "Alien callouts will die" mean? Does it mean that the
Alien class library is deprecated and will be replaced by a new version of
FFI? Or is it something else?

It means what it says; that the callout primitives in Alien will die and all the rest will remain.  FFI callouts will accept Aliens and, because they have type information, render the Alien call-outs redundant and problematic.  The Alien data representation and callback facilities will be retained.

 

I am close to releasing JNIPort for Pharo/Squeak. I am currently using Alien
for interfacing to the Java VM, and with the exception of callbacks from the
JVM to Smalltalk which come from foreign threads, everything works now on
the Squeak VM ("foreign" callbacks still crash the VM which outputs
"scheduler could not find a runnable process" to the console).

I would be a bit unhappy if I had to dump this work and redo the interface
to the JVM, and I wouldn't be happy at all if I had to use different class
libraries for calling foreign functions depending on the VM (Cog vs. Squeak
VM). So, what's the "official" plan for Alien/FFI?

Best regards,
Joachim Geidel
--
View this message in context: http://forum.world.st/Alien-Cog-VM-tp3036626p3164309.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Alien + Cog VM

Joachim Geidel
Hi Eliot,

Am 26.12.10 19:11 schrieb Eliot Miranda:
>> What exactly does "Alien callouts will die" mean? Does it mean that the
>> Alien class library is deprecated and will be replaced by a new version of
>> FFI? Or is it something else?
>
> It means what it says; that the callout primitives in Alien will die and all
> the rest will remain.  FFI callouts will accept Aliens and, because they have
> type information, render the Alien call-outs redundant and problematic.  The
> Alien data representation and callback facilities will be retained.

Thanks for the clarification! This sounds as if upgrading a class library
from the current version of Alien to the new one won't be much work.

Joachim Geidel



Reply | Threaded
Open this post in threaded view
|

Re: Alien + Cog VM

Schwab,Wilhelm K
I can't speak to that, but the callouts of Alien have been at best damned by faint praise; FFI's weakness in callbacks is clear, so an enhancement of FFI with Alien's acknowledged strengths seems like a natural approach.  Hopefully the handling of structure fields will improve at the same time.




________________________________________
From: [hidden email] [[hidden email]] On Behalf Of Joachim Geidel [[hidden email]]
Sent: Sunday, December 26, 2010 1:46 PM
To: [hidden email]
Subject: Re: [Pharo-project] Alien + Cog VM

Hi Eliot,

Am 26.12.10 19:11 schrieb Eliot Miranda:
>> What exactly does "Alien callouts will die" mean? Does it mean that the
>> Alien class library is deprecated and will be replaced by a new version of
>> FFI? Or is it something else?
>
> It means what it says; that the callout primitives in Alien will die and all
> the rest will remain.  FFI callouts will accept Aliens and, because they have
> type information, render the Alien call-outs redundant and problematic.  The
> Alien data representation and callback facilities will be retained.

Thanks for the clarification! This sounds as if upgrading a class library
from the current version of Alien to the new one won't be much work.

Joachim Geidel




Reply | Threaded
Open this post in threaded view
|

Re: Alien + Cog VM

Patricio Plaza A.
In reply to this post by Eliot Miranda-2
Hi Eliot,


Regarding to deprecated Alien class libraries how can I get information about the changes between Pharo 1.1 and Pharo 1.2?


Cheers,


Patricio


El 26-12-2010, a las 15:11, Eliot Miranda escribió:



On Sun, Dec 26, 2010 at 8:19 AM, Joachim Geidel <[hidden email]> wrote:

Hi Eliot,

On Nov 11, 2010; 02:40am, Eliot Miranda-2 wrote:
> But I'm hoping that the ALien callouts will die the death soon.  I have
> Alien callbacks integrated with the FFI and of course the ALien data
> manipulation code works fine.  So if you're eager to have Alien callouts
> work see whether the above change fixes things, in which case I can
> integrate the fix.  But if you're not so eager you could wait for me to
> push out the FFI changes, but that could take a few weeks.

What exactly does "Alien callouts will die" mean? Does it mean that the
Alien class library is deprecated and will be replaced by a new version of
FFI? Or is it something else?

It means what it says; that the callout primitives in Alien will die and all the rest will remain.  FFI callouts will accept Aliens and, because they have type information, render the Alien call-outs redundant and problematic.  The Alien data representation and callback facilities will be retained.

 

I am close to releasing JNIPort for Pharo/Squeak. I am currently using Alien
for interfacing to the Java VM, and with the exception of callbacks from the
JVM to Smalltalk which come from foreign threads, everything works now on
the Squeak VM ("foreign" callbacks still crash the VM which outputs
"scheduler could not find a runnable process" to the console).

I would be a bit unhappy if I had to dump this work and redo the interface
to the JVM, and I wouldn't be happy at all if I had to use different class
libraries for calling foreign functions depending on the VM (Cog vs. Squeak
VM). So, what's the "official" plan for Alien/FFI?

Best regards,
Joachim Geidel
--
View this message in context: http://forum.world.st/Alien-Cog-VM-tp3036626p3164309.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.



Reply | Threaded
Open this post in threaded view
|

Fwd: Alien + Cog VM

Patricio Plaza A.
Hi everyone,

I'm using Alien libraries in Pharo 1.1 and I'd like to use this one in Pharo 1.2 (Cog VM) but I don't know what classes has been deprecated, where can I found information about it?


Best Regards,


Patricio

Inicio del mensaje reenviado:

De: Patricio Plaza <[hidden email]>
Fecha: 7 de enero de 2011 14:38:51 GMT-03:00
Asunto: Re: [Pharo-project] Alien + Cog VM

Hi Eliot,


Regarding to deprecated Alien class libraries how can I get information about the changes between Pharo 1.1 and Pharo 1.2?


Cheers,


Patricio


El 26-12-2010, a las 15:11, Eliot Miranda escribió:



On Sun, Dec 26, 2010 at 8:19 AM, Joachim Geidel <[hidden email]> wrote:

Hi Eliot,

On Nov 11, 2010; 02:40am, Eliot Miranda-2 wrote:
> But I'm hoping that the ALien callouts will die the death soon.  I have
> Alien callbacks integrated with the FFI and of course the ALien data
> manipulation code works fine.  So if you're eager to have Alien callouts
> work see whether the above change fixes things, in which case I can
> integrate the fix.  But if you're not so eager you could wait for me to
> push out the FFI changes, but that could take a few weeks.

What exactly does "Alien callouts will die" mean? Does it mean that the
Alien class library is deprecated and will be replaced by a new version of
FFI? Or is it something else?

It means what it says; that the callout primitives in Alien will die and all the rest will remain.  FFI callouts will accept Aliens and, because they have type information, render the Alien call-outs redundant and problematic.  The Alien data representation and callback facilities will be retained.

 

I am close to releasing JNIPort for Pharo/Squeak. I am currently using Alien
for interfacing to the Java VM, and with the exception of callbacks from the
JVM to Smalltalk which come from foreign threads, everything works now on
the Squeak VM ("foreign" callbacks still crash the VM which outputs
"scheduler could not find a runnable process" to the console).

I would be a bit unhappy if I had to dump this work and redo the interface
to the JVM, and I wouldn't be happy at all if I had to use different class
libraries for calling foreign functions depending on the VM (Cog vs. Squeak
VM). So, what's the "official" plan for Alien/FFI?

Best regards,
Joachim Geidel
--
View this message in context: http://forum.world.st/Alien-Cog-VM-tp3036626p3164309.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.