Towards Threaded FFI

17 January, 2016

spur_gear

Eliot Miranda writes:

.. I expect this is the year [the threaded FFI] will be [production ready].  Spur provides pinning, so the VM infrastructure is there.  The Pharo community plus some commercial relationships that have developed are providing funding.  Esteban Lorenzano and I want to collaborate on this and I hope to get help from some other people, such as Ronie Salgado.  And Mariano is working on an important part of the problem.  So I feel there’s sufficient momentum for us to realize the threaded FFI this year.

.. and when Craig Latta tried to use it late last year it worked up to a point.  The thing that didn’t work was callbacks from foreign threads.  So it looks like the core threading code is not too far away from working.

Another really important part, bigger than threading, is marshaling.  Being able to handle the full x86_64 abi requires a better approach than interpreting tops signatures.  Igor’s NativeBoost gave an example of how to generate marshaling machine code, but alas only for x86.  But Sista includes an extensible bytecode set for arbitrary instructions.  Sista is close to production, and we know the bytecode set works.  So the plan is to use these bytecodes to do the marshaling.  That neatly solves the problems of a) associating marshaling machine code with a method and b) marshaling in an interpreted stack VM, since the bytecode set works in any Cog VM.  So the plan is to write an ABI compiler from C signatures to marshaling code to replace the interpreted FFI plugin.

So this year I hope we will have an excellent high-performance FFI.

spur_gear

 

Clément Béra just posted an excellent article explaining the new Spur Object format.  Definitely worth a read!

Eliot Miranda has also mentioned that Spur is coming to life in Newspeak as we speak and then Squeak 5.0.

Find out more about the Squeak VM called Cog and the new memory manager called Spur at Eliot’s Cog Blog.

Bert VM Icon(icon by Bert)

Word has it that Clément Béra is working With Eliot Miranda on Cog.  Göran pointed out Clements excellent blog: here, to me a few weeks ago after meeting him at ESUG.

From Eliot: Clément Béra is, amongst other things, working on Cog performance, looking at adaptive optimization/speculative inlining (Sista in Cog, for Speculative Inlining Smalltalk Architecture).

I just wanted to welcome Clément Béra and to say thank you to everyone working on the VM for both communities, you know who you are (and we do to) and especially Eliot for working on Cog and keeping the advancements coming!  Hip Hip … and all that.

spur_gear

 

 

I’ve just published a blog post on lazy become and the partial read barrier in Spur.  I’d really appreciate criticism, preferably as comments on the blog page (Eliot’s blog not this one, please follow the link to comment).  This is one of the riskier parts of the design so it really does need to be pounded on.


thanks,

Eliot

 

A Spur gear for Cog

5 September, 2013

Cog-Spur

 

 

Moving the Squeak GC forward in COG.

http://www.mirandabanda.org/cogblog/2013/09/05/a-spur-gear-for-cog/

tim

Don’t miss Tim’s interview with SmalltalkInspect!  You can find it here: Smalltalk under the Pi: an Interview with tim Rowledge

In this episode we talk to tim Rowledge about his work on Smalltalk VMs over the years, especially for the RISC OS Platform and ARM machines.. The latest and probably hottest thing in this arena is his port of Squeak to the Raspberry Pi. This is not only cool in itself, but more importantly enables Raspberry Pi users to use Scratch and EToys on this little machine on RISC OS (the Raspbian Linux version existed before). You can probably imagine how much fun we had in recording this session.