-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RubyMotion? #77
Comments
Our gem does not require any external dependency and every component is available in a full standard Ruby 1.9 implementation, so it should already run. |
@elcuervo I apologize, but my knowledge of RubyMotion is minimal. Are you asking if this gem will work with RubyMotion, or are you suggesting extending the gem with RubyMotion-specific optimizations? This gem is 100% pure Ruby and should run under any compliant interpreter. We have started to implement conditional JRuby-specific optimizations and are experimenting with CRuby/MRI-specific extensions as well. The idea is that the gem automatically detects which platform it is installed on and will include the relevant optimizations. If there is a way to implement similar optimizations on RubyMotion we'd be happy to explore that approach. So long as we provide a consistent API and behavior across all platforms we're happy to optimize when possible. |
Well, my knowladge is minimal as well. Here's the deal: I'm the author of airplay and I'm considering switching to Some people are asking me to port the gem to be RubyMotion compatible and since I'll have to do that maybe it will make sense to work in a implementation for concurrent-ruby since I saw the jruby/rbx flags in the code. I'm basically asking if I add a RubyMotion wrapper for the calls you'd be open to merge it. The idea is to use the GCD to handle thread dispatching. |
A new executor using GCD would make a lot of sense, and maybe some other primitives could directly use GCD such as queues and barriers. It would be really interesting to benchmark Ruby's primitives against GCD and Java. |
@elcuervo We'll happily support additional platform-specific optimizations. Our rule is to have a pure-Ruby implementation of every class/module/abstraction in the gem but support platform-optimized implementations where able (we'll be adding CRuby extensions soon). So long as the GCD versions support the same API and exhibit the same behavior as the pure Ruby versions, we'd be happy to include it. |
Awesome. I'll start working on that and keep you in the loop. ❤️ |
An issue right now that I see is that you're using |
For RubyMotion can you not just monkey patch |
Good question, I should try it. It would be awesome to have this gem available in RubyMotion. |
I recently purchased RubyMotion after seeing @lrz speak at Steel City Ruby. I haven't had a chance to work with it yet, but I do hope to make this gem compatible. @jamonholmgren Any help you can provide would be greatly appreciated. |
@jdantonio I'd be happy to help. Right now a bit buried with client work but eventually I'll give it a go. |
@jamonholmgren Great. Thank you! |
I've played with this some. Since most of the classes are POROs, this is certainly possible to port at least some of this to RubyMotion. Monkeypatching I think it might cause disruption in your code base beyond what you'd likely want to allow. For example, your Rakefile and Gemfile would both need to be split into two: one for RM and one for Ruby. C extensions won't be possible (I'm not sure yet how much of your code base relies on them). Specs will need to be somewhat rewritten. And I'm not sure what else yet. It might be best to create a new RubyMotion-specific gem and copy over relevant code. Some of the classes could probably benefit from the use of GCD (Grand Central Dispatch) rather than using threads. It's also possible that we could create a subfolder that holds the RubyMotion-specific code and refers back to the Either way, it'll be a lot of work. Unless there's a lot of demand for it I'd recommend tabling the discussion for now. Much as I'd like to see this lib in RM, it's probably not worth doing quite yet. |
@jamonholmgren Thank you very much for taking the time to look into this. None of the C or Java code in the gem is necessary--everything is written in pure Ruby and native code optimizations are only triggered on supporting platforms. In theory we could follow that same pattern for RubyMotion, but so far there isn't any demand. Your recommendation to not pursue this right now seems like the wise approach. |
I'm considering to use concurrent-ruby on some of my projects. For one of them some people are asking me for RubyMotion support and that'd require some work to implement concurrency since I'm already using Celluloid. Since I might take that road that will it make sense to add RubyMotion support for this gem? Or that's way out of the scope?
The text was updated successfully, but these errors were encountered: