New Cog VMs available

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

New Cog VMs available

Eliot Miranda-2
 
...in http://www.mirandabanda.org/files/Cog/VM/VM.r2628.

These fix a bug with pc mapping that could cause the Vm to crash on simple loops containing arithmetic on constants (e.g. 1 to: 20 do: [:i| 1=1]).  They also cause the instantiation primitives to pop all their arguments rather than assume their argument count is 0 or 1.  More change info available in the directory.
--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] New Cog VMs available

Blake McBride
 
Greetings,

I tried to integrate Squeak to a C based application more than six years ago.  The project failed because we were not able to have our application call Squeak, then have Squeak call the application, and then the application call Squeak again recursively.  An analysis of the Squeak VM revealed a kernel design consisting of a lot of global variables - quite unnecessarily.  The unnecessary use of global variables over a localized structure for example unnecessarily prevented the use of Squeak as an extension language (unless you had no recursion).  I spent several days trying to re-structure the Squeak kernel but I kept running into problems and just ran out of time. 

As a side note, that company I was with ended up making a lot of investment in Scheme because we were easily able to integrate that language with our application.  Now, not only is Scheme used heavily within that company but many of their clients use it too to customize their application.

This brings me to my question, is COG reentrant?  If not, as the author of COG, I would think it relatively easy to restructure it to be so.  Such a design capability can make a huge difference to COG's acceptance to many.  It may even be the reason to switch to COG.

Just sharing some thoughts.  Thanks.

Blake McBride


On Sun, Dec 2, 2012 at 7:55 PM, Eliot Miranda <[hidden email]> wrote:
...in http://www.mirandabanda.org/files/Cog/VM/VM.r2628.

These fix a bug with pc mapping that could cause the Vm to crash on simple loops containing arithmetic on constants (e.g. 1 to: 20 do: [:i| 1=1]).  They also cause the instantiation primitives to pop all their arguments rather than assume their argument count is 0 or 1.  More change info available in the directory.
--
best,
Eliot





Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] New Cog VMs available

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

On Mon, Dec 3, 2012 at 7:10 AM, Blake McBride <[hidden email]> wrote:
Greetings,

I tried to integrate Squeak to a C based application more than six years ago.  The project failed because we were not able to have our application call Squeak, then have Squeak call the application, and then the application call Squeak again recursively.  An analysis of the Squeak VM revealed a kernel design consisting of a lot of global variables - quite unnecessarily.  The unnecessary use of global variables over a localized structure for example unnecessarily prevented the use of Squeak as an extension language (unless you had no recursion).  I spent several days trying to re-structure the Squeak kernel but I kept running into problems and just ran out of time. 

As a side note, that company I was with ended up making a lot of investment in Scheme because we were easily able to integrate that language with our application.  Now, not only is Scheme used heavily within that company but many of their clients use it too to customize their application.

This brings me to my question, is COG reentrant?

Yes it is.  It supports call-outs and call-ins.  But currently there is no support for Cog to be packaged as a DLL.  You have to start by calling C from Squeak.  

 
 If not, as the author of COG, I would think it relatively easy to restructure it to be so.  Such a design capability can make a huge difference to COG's acceptance to many.  It may even be the reason to switch to COG.

Yes indeed.   The issue is of course funding to spend the time to make the necessary changes.


Just sharing some thoughts.  Thanks.

Blake McBride

On Sun, Dec 2, 2012 at 7:55 PM, Eliot Miranda <[hidden email]> wrote:
...in http://www.mirandabanda.org/files/Cog/VM/VM.r2628.

These fix a bug with pc mapping that could cause the Vm to crash on simple loops containing arithmetic on constants (e.g. 1 to: 20 do: [:i| 1=1]).  They also cause the instantiation primitives to pop all their arguments rather than assume their argument count is 0 or 1.  More change info available in the directory.
--
best,
Eliot











--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] New Cog VMs available

Blake McBride
 
Hello Eliot,

On Mon, Dec 3, 2012 at 1:09 PM, Eliot Miranda <[hidden email]> wrote:
 
Hi Blake,

On Mon, Dec 3, 2012 at 7:10 AM, Blake McBride <[hidden email]> wrote:
Greetings,

I tried to integrate Squeak to a C based application more than six years ago.  The project failed because we were not able to have our application call Squeak, then have Squeak call the application, and then the application call Squeak again recursively.  An analysis of the Squeak VM revealed a kernel design consisting of a lot of global variables - quite unnecessarily.  The unnecessary use of global variables over a localized structure for example unnecessarily prevented the use of Squeak as an extension language (unless you had no recursion).  I spent several days trying to re-structure the Squeak kernel but I kept running into problems and just ran out of time. 

As a side note, that company I was with ended up making a lot of investment in Scheme because we were easily able to integrate that language with our application.  Now, not only is Scheme used heavily within that company but many of their clients use it too to customize their application.

This brings me to my question, is COG reentrant?

Yes it is.  It supports call-outs and call-ins.  But currently there is no support for Cog to be packaged as a DLL.  You have to start by calling C from Squeak.

I believe the regular Squeak supports call-outs and call-ins as well.  The real question is if it can be done recursively.

Can you initialize a new instance of the VM in the middle of a nested call-in / callout?

Can an instance be cloned?  Destroyed?


Thanks.

Blake

 
 

 
 If not, as the author of COG, I would think it relatively easy to restructure it to be so.  Such a design capability can make a huge difference to COG's acceptance to many.  It may even be the reason to switch to COG.

Yes indeed.   The issue is of course funding to spend the time to make the necessary changes.


Just sharing some thoughts.  Thanks.

Blake McBride

On Sun, Dec 2, 2012 at 7:55 PM, Eliot Miranda <[hidden email]> wrote:
...in http://www.mirandabanda.org/files/Cog/VM/VM.r2628.

These fix a bug with pc mapping that could cause the Vm to crash on simple loops containing arithmetic on constants (e.g. 1 to: 20 do: [:i| 1=1]).  They also cause the instantiation primitives to pop all their arguments rather than assume their argument count is 0 or 1.  More change info available in the directory.
--
best,
Eliot











--
best,
Eliot



Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] New Cog VMs available

Eliot Miranda-2
 



On Mon, Dec 3, 2012 at 11:39 AM, Blake McBride <[hidden email]> wrote:
 
Hello Eliot,

On Mon, Dec 3, 2012 at 1:09 PM, Eliot Miranda <[hidden email]> wrote:
 
Hi Blake,

On Mon, Dec 3, 2012 at 7:10 AM, Blake McBride <[hidden email]> wrote:
Greetings,

I tried to integrate Squeak to a C based application more than six years ago.  The project failed because we were not able to have our application call Squeak, then have Squeak call the application, and then the application call Squeak again recursively.  An analysis of the Squeak VM revealed a kernel design consisting of a lot of global variables - quite unnecessarily.  The unnecessary use of global variables over a localized structure for example unnecessarily prevented the use of Squeak as an extension language (unless you had no recursion).  I spent several days trying to re-structure the Squeak kernel but I kept running into problems and just ran out of time. 

As a side note, that company I was with ended up making a lot of investment in Scheme because we were easily able to integrate that language with our application.  Now, not only is Scheme used heavily within that company but many of their clients use it too to customize their application.

This brings me to my question, is COG reentrant?

Yes it is.  It supports call-outs and call-ins.  But currently there is no support for Cog to be packaged as a DLL.  You have to start by calling C from Squeak.

I believe the regular Squeak supports call-outs and call-ins as well.  The real question is if it can be done recursively.

Yes it can.  The new ThreadedFFI plugin is reentrant, using alloca to stack allocate space for outgoing arguments and incoming results, permitting nested callouts and callbacks.
 
Can you initialize a new instance of the VM in the middle of a nested call-in / callout?

That;s not relevant.  Yes one can spawn another VM, but it doesn't share an address psace or a heap.  But within the single address space and single heap one can nest call-outs and call-backs.
 
Can an instance be cloned?  Destroyed?

Effectively yes.  One way is snapshot and start up of that snapshot.  But I think the OSProcessPlugin supports fork.  However, IMO that's unrelated to the reentrant FFI.
 
Thanks.

Blake

cheers!
 

 
 

 
 If not, as the author of COG, I would think it relatively easy to restructure it to be so.  Such a design capability can make a huge difference to COG's acceptance to many.  It may even be the reason to switch to COG.

Yes indeed.   The issue is of course funding to spend the time to make the necessary changes.


Just sharing some thoughts.  Thanks.

Blake McBride

On Sun, Dec 2, 2012 at 7:55 PM, Eliot Miranda <[hidden email]> wrote:
...in http://www.mirandabanda.org/files/Cog/VM/VM.r2628.

These fix a bug with pc mapping that could cause the Vm to crash on simple loops containing arithmetic on constants (e.g. 1 to: 20 do: [:i| 1=1]).  They also cause the instantiation primitives to pop all their arguments rather than assume their argument count is 0 or 1.  More change info available in the directory.
--
best,
Eliot











--
best,
Eliot







--
best,
Eliot