Thread: [Siop-development] SIOP FAQ
Status: Pre-Alpha
Brought to you by:
slobberchops
From: Rapheal K. <ra...@ma...> - 2006-06-10 21:02:52
|
I have posted a FAQ: http://siop.net/wiki/index.php?pagename=SiopFaq Naturally, there is really only one question that people ask AT ALL, and the page reflects it. Naturally, this revision could use better wording. How does one explain what the hell this thing is? For example, how do I explain it to all of you??!?!!? |
From: Kevin S. <wx...@qu...> - 2006-06-11 06:00:52
|
On Sat, 2006-06-10 at 14:02 -0700, Rapheal Kaplan wrote: > I have posted a FAQ: > > http://siop.net/wiki/index.php?pagename=SiopFaq > > Naturally, there is really only one question that people ask AT ALL, and the > page reflects it. Naturally, this revision could use better wording. How > does one explain what the hell this thing is? For example, how do I explain > it to all of you??!?!!? I think the explanation you have there is actually pretty good...but it has a few gaps. Mostly, how could this thing actually be used? It's funny, because I actually really really wanted something exactly like SIOP a few years ago...but now I can't remember why. I had found a similar project at that time, but it was too immature, and the folks behind it seemed to be a couple junior high tinkerers who had neither the knowledge nor the follow-through to make it work. So what are some examples of how someone might actually benefit from this thing? Could I wrap wxpython and access it from a ruby app, instead of creating wxruby? Could I write a ruby library for something like statistics, and easily make it available to Python and Perl users? Or would this be appropriate to create a web app where the web service part runs as a separate process from the business logic part, even though both are in Ruby? An example is worth a million words. Speaking of examples, a 5-line "server" and 5-line "client" would go a long way toward showing what could be done. Something simple like a getter on an object (employee.name). A more detailed example might demonstrate the "key benefit" of SIOP over CORBA and XMLRPC: automatic wrapping with no IDL declarations. Probably as a separate Q/A: is the protocol binary or human-readable? Although the answer doesn't really matter, it does speak to the priorities of the project (speed vs. ease of debugging). Kevin |
From: Rapheal K. <ra...@ma...> - 2006-06-12 05:54:23
|
> > Thanks a lot Kevin. These are exactly the kind of things I need to > > focus on. I would like to make the example of Ruby using wx Windows, > > but I don't want to diss your efforts on the wxRuby stuff. I think I've > > heard it from you, in addition to an out of date Ruby site, but is it > > correct that wx support on Ruby is weak? > > Well, you could refer to "a GUI toolkit" rather than naming wx > specifically. But I actually wouldn't mind if you did use it as an > example. wxruby is "sort of working", but I haven't had the time to > "finish" it, and no other developers have stepped up to take the lead. > > Hey, if there's an easier way to make wx available to ruby apps, I might > jump ship. I'm skeptical about how easy it would be to wrap such a large > library, to bridge a few python/ruby differences, and then to make it > bearable to deploy ruby wx apps on all three major OS's. > > I'm intrigued. I would like to see something like that happen. So far, for some Python like reason, I am not able to hook up callbacks to wxWindows, although callbacks in general work over SIOP. Maybe the wxPython has a wierd way of handling setattr. This Ruby code works so far - When I figure a few more things out I will document it on the Wiki... ------------------------------------------- #!/usr/bin/env ruby require 'siop/pipe' Siop::Pipe.connect '../../scripts/siop-standard-server.py' do |bridge| bridge.fetch_namespace nil, 'wx' wx = bridge.remote_context.wx app = wx.PySimpleApp(0) frame = wx.Frame( nil, -1, "This is a test" ) frame.Show( true ) app.SetTopWindow( frame ) app.MainLoop.call end |
From: Rapheal K. <ra...@ma...> - 2006-06-12 06:20:44
|
> I would like to see something like that happen. So far, for some Python > like reason, I am not able to hook up callbacks to wxWindows, although > callbacks in general work over SIOP. Maybe the wxPython has a wierd way of > handling setattr. > > This Ruby code works so far - When I figure a few more things out I will > document it on the Wiki... > Of course... a windowing system IMMEDIATELY has threading issues. The call backs are coming in on a different thread, the results are returning from the Python server out of order. So, now there are threading issues. I though about having each message pass through with a sort of call stack identifier. As long as the transport itself is multi-threaded, it should be possible to have multiple threads with multiple call stacks using the bridge. |
From: Kevin S. <wx...@qu...> - 2006-06-12 21:55:55
|
On Sun, 2006-06-11 at 23:20 -0700, Rapheal Kaplan wrote: > Of course... a windowing system IMMEDIATELY has threading issues. The call > backs are coming in on a different thread, the results are returning from the > Python server out of order. So, now there are threading issues. Hm. Odd. I don't recall seeing multiple threads in wxruby. Maybe wxpython is causing wx to be threaded "unnecessarily". Just a thought. The example is pretty cool, though. Maybe you could find a non-GUI library that's available in one language and not the the other. I don't have any ideas, though. Kevin |
From: Rapheal K. <ra...@ma...> - 2006-06-12 22:23:01
|
If you think wxWindows is not threaded then I should look in to it. Maybe there is something I am missing. > > Of course... a windowing system IMMEDIATELY has threading issues. The > > call backs are coming in on a different thread, the results are returning > > from the Python server out of order. So, now there are threading issues. > > Hm. Odd. I don't recall seeing multiple threads in wxruby. Maybe > wxpython is causing wx to be threaded "unnecessarily". Just a thought. > > The example is pretty cool, though. Maybe you could find a non-GUI > library that's available in one language and not the the other. I don't > have any ideas, though. > > Kevin |
From: Rapheal K. <ra...@ma...> - 2006-06-14 07:56:28
|
Ok folks, as an example, I would like to introduce the first Python classes written in Ruby. They look funny now, but once we get up to level 2, implement static arrays and maps, this will look a lot cleaner. I'm thinking that it might even make sense for SIOP to have a level that deals with class definition. I will put this in an example directory. Kevin, the code below actually works... when you resize the window the new size is printed to the console. It's a fully Ruby based wx callback. The trick turned out to be to use this weird "instancemethod" function. Anyway, see if you can figure out what it means... ------------------------------- #!/usr/bin/env ruby require 'siop/pipe' Siop::Pipe.connect '../../scripts/siop-standard-server.py' do |bridge| bridge.fetch_namespace nil, 'wx' bridge.fetch_namespace nil, 'types' bridge.fetch_namespace nil, 'new' rc = bridge.remote_context wx = rc.wx instancemethod = rc.new.instancemethod $types = rc.types def tuple( *stuff ) list = $types.ListType.call for thing in stuff list.append( thing ) end $types.TupleType( list ) end def pyclass( name, parents, &definition ) instance_eval do klass = $types.ClassType( name.to_s, tuple( *parents ), $types.DictType.call ) klass.instance_eval &definition unless definition.nil? klass end end MyApp = pyclass :MyApp, [wx.App] do self.OnInit = proc do | pyself | pyself.frame = MyFrame.call(nil, -1, "This is a test") MyFrame.Show( pyself.frame, true ) pyself.SetTopWindow( pyself.frame ) true end self.OnInit = instancemethod.call( self.OnInit, nil, self ) end MyFrame = pyclass :MyFrame, [wx.Frame] do self.__init__ = proc do | pyself, parent, wid, title| wx.Frame.__init__( pyself, parent, wid, title ) pyself.Bind( wx.EVT_SIZE, pyself.OnSize ) end self.__init__ = instancemethod.call( self.__init__, nil, self ) self.OnSize = proc do |pyself, event| p "Coordinates (#{event.GetSize.call.x}, #{event.GetSize.call.y})" end self.OnSize = instancemethod.call( self.__init__, nil, self ) end app = MyApp.call app.MainLoop.call end |