Signals and notifiers?

6 views
Skip to first unread message

Patrik Sundberg

unread,
Nov 9, 2011, 1:02:09 PM11/9/11
to maglev-d...@googlegroups.com
Hi,

Are signals and notifiers like chapter 11 of http://community.gemstone.com/download/attachments/6816350/GS64-ProgGuide-3.0.pdf?version=1 somehow exposed in maglev? It'd be wicked feature.

Patrik

Jesse Cooke

unread,
Nov 9, 2011, 2:26:46 PM11/9/11
to maglev-d...@googlegroups.com
On Wed, Nov 9, 2011 at 10:02 AM, Patrik Sundberg <patrik....@gmail.com> wrote:
Hi,

Are signals and notifiers like chapter 11 of http://community.gemstone.com/download/attachments/6816350/GS64-ProgGuide-3.0.pdf?version=1 somehow exposed in maglev? It'd be wicked feature.
No, but maybe some day ;-) 


Patrik

--
You received this message because you are subscribed to the Google Groups "MagLev Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maglev-discussion/-/Byu9kOSs7v0J.
To post to this group, send email to maglev-d...@googlegroups.com.
To unsubscribe from this group, send email to maglev-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maglev-discussion?hl=en.

Tim Felgentreff

unread,
Nov 9, 2011, 2:51:07 PM11/9/11
to maglev-d...@googlegroups.com
I don't think they are, but if you're up to it, the class methods :primitive and :class_primitive take two arguments: the name of the ruby method you want to expose sth as, and the name of the Smalltalk method to expose. Have a look at rchash.rb to see how it can be done. If you extract something useful, we can certainly include it in the next release. :)

Sent from my mobile, please excuse me for being brief.

From: Patrik Sundberg
Sent: 09/11/2011 19:02
To: maglev-d...@googlegroups.com
Subject: [maglev-discussion] Signals and notifiers?

Hi,

Are signals and notifiers like chapter 11 of http://community.gemstone.com/download/attachments/6816350/GS64-ProgGuide-3.0.pdf?version=1 somehow exposed in maglev? It'd be wicked feature.

Jesse Cooke

unread,
Nov 9, 2011, 2:55:12 PM11/9/11
to maglev-d...@googlegroups.com
On Wed, Nov 9, 2011 at 11:51 AM, Tim Felgentreff <timfelg...@gmail.com> wrote:
I don't think they are, but if you're up to it, the class methods :primitive and :class_primitive take two arguments: the name of the ruby method you want to expose sth as, and the name of the Smalltalk method to expose. Have a look at rchash.rb to see how it can be done. If you extract something useful, we can certainly include it in the next release. :)
That would be sweet! I've done some work to test RCHash & RCQueue using mspec in the spec/maglev folder but I haven't submitted a pull request yet. Right now tests are in src/test. It would be nice to move to something more structured like mspec. 

Peter McLain

unread,
Nov 9, 2011, 2:56:30 PM11/9/11
to maglev-d...@googlegroups.com

On Nov 9, 2011, at 10:02 AM, Patrik Sundberg wrote:

> Are signals and notifiers like chapter 11 of http://community.gemstone.com/download/attachments/6816350/GS64-ProgGuide-3.0.pdf?version=1 somehow exposed in maglev? It'd be wicked feature.

They are not currently exposed. It is easy and straightforward to expose a Smalltalk API to Ruby (e.g., see src/kernel/bootstrap/System.rb for ideas). The hard part is handling the asynchronous signals. Smalltalk's execption handling is superior to Ruby's, since Smalltalk handles the exception by pushing another frame onto the stack and running the exception handler there, giving you the option of resuming the previous computation. Ruby semantics destroy the stack as it searches for a handler, so if you install a handler up at the beginning of your program, you can't effectively handle it from Ruby (no place to resume after catching the exception).

Despite those problems, there are some interesting possibilities (a) you could poll for the gem to gem signals and (b) there might be a way to start a smalltalk thread to handle the async signals, and then deliver them to Ruby using some communications channel that is appropriate for Ruby (a queue, callback or whatever).

Could be an interesting project!

--
Peter McLain
pmc...@vmware.com


Tim Felgentreff

unread,
Nov 9, 2011, 3:25:57 PM11/9/11
to maglev-d...@googlegroups.com
Well, if you're executing Smalltalk code you do see the non-destroyed
stack. So exposing might be as simple as adding some more powerful Api
methods in Smalltalk and exposing those, too.
From: Peter McLain
Sent: 09/11/2011 20:56
To: maglev-d...@googlegroups.com
Subject: Re: [maglev-discussion] Signals and notifiers?

--
Peter McLain
pmc...@vmware.com


Patrik Sundberg

unread,
Nov 9, 2011, 5:51:34 PM11/9/11
to maglev-d...@googlegroups.com
It's a bit above my head at the moment but I'll try to read up and learn. For my purposes the gemstone/s features are great, but I love the ruby language (to be honest never given smalltalk much of a go) so getting the combo would be fantastic and worth learning a bit to accomplish.

Jesse Cooke

unread,
Nov 9, 2011, 6:10:53 PM11/9/11
to maglev-d...@googlegroups.com
On Wed, Nov 9, 2011 at 2:51 PM, Patrik Sundberg <patrik....@gmail.com> wrote:
It's a bit above my head at the moment but I'll try to read up and learn. For my purposes the gemstone/s features are great, but I love the ruby language (to be honest never given smalltalk much of a go) so getting the combo would be fantastic and worth learning a bit to accomplish.
I highly recommend installing GemTools & looking around in Pharo. I thoroughly enjoy looking at the Smalltalk code! 

--
You received this message because you are subscribed to the Google Groups "MagLev Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maglev-discussion/-/ae-xJxWZS0gJ.

Patrik Sundberg

unread,
Nov 10, 2011, 5:13:43 AM11/10/11
to maglev-d...@googlegroups.com
which gemtools version goes well with maglev and where do I find it? thanks

Tim Felgentreff

unread,
Nov 10, 2011, 5:25:30 AM11/10/11
to maglev-d...@googlegroups.com
The latest Gemtools are at
http://seaside.gemstone.com/squeak/GemTools-MagLev-1.0.0.zip

Feel free to pop into irc and ask questions, Squeak can be quite
overwhelming the first time :)

On 10 November 2011 11:13, Patrik Sundberg <patrik....@gmail.com> wrote:
> which gemtools version goes well with maglev and where do I find it? thanks
>

> --
> You received this message because you are subscribed to the Google Groups
> "MagLev Discussion" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/maglev-discussion/-/kH6dnSd8VScJ.

Reply all
Reply to author
Forward
0 new messages