PBI - MacRuby aux Fines Merbs...
IMHO, MacRuby and Merb are two of the most interesting current developments in the Ruby arena. Because I've been looking at both of them, I started noticing some similarities, including: * Focus on design and engineering In an age of "cowboy programming", I find it refreshing to see that some programming projects actually embrace design and engineering. * large, well-documented APIs In a community dominated by a web framework (Rails) that has no defined API, I think this is quite noteworthy. * MVC-based UI frameworks Both MacRuby and Merb can both be used for purposes other than interactive UI development (eg, batch-mode applications, web services). However, their focus is on UI and both use an MVC-based approach (though the specifics vary markedly). Anyway, I started wondering whether any parts of Merb might be useful for MacRuby to consider adopting. For example: * Merb, like Rails, defines conventions for directory layout. Would it make sense for MacRuby to have similar conventions? * Merb stresses modularity very strongly, using gems to add "plugins", "slices", etc. What kinds of modularity should we encourage for MacRuby, HotCocoa, etc? * Some of Merb's plugins add functionality (eg, DataMapper) which might be useful in a MacRuby application. Would it be useful for MacRuby to be able to use Merb plugins? Comments solicited... -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development
* Focus on design and engineering
In an age of "cowboy programming", I find it refreshing to see that some programming projects actually embrace design and engineering.
One thing the “cowboys”, from Rails for instance, have done right is that there are tests for almost everything, which is something that is seriously lacking atm imo. As I already discussed with Laurent, I especially would like to see full test/spec coverage for HotCocoa, because: (A) I think it's a good thing to do in any case, but that's just my opinion. (B) More importantly, HotCocoa will probably be the part of MacRuby that most rubyists will hack/contribute on. Without a full test suite it takes too much time to make it enjoyable for people to quickly write a good patch, because one has to trace through all the code. To put the money where my mouth is; I have started on writing specs for HotCocoa and will commit them once I feel it's a good enough starting point. (There's never enough time…) I would really like to hear the opinions from the main HotCocoa committers on this. PS: Credits to Laurent who has been making an effort on writing more and more tests for the core part of MacRuby! :)
* large, well-documented APIs
In a community dominated by a web framework (Rails) that has no defined API, I think this is quite noteworthy.
Serious?? I have not yet seen any well documented API in MacRuby, I must have missed it. Could you explain which one(s) you mean?
Anyway, I started wondering whether any parts of Merb might be useful for MacRuby to consider adopting. For example:
* Merb, like Rails, defines conventions for directory layout. Would it make sense for MacRuby to have similar conventions?
* Merb stresses modularity very strongly, using gems to add "plugins", "slices", etc. What kinds of modularity should we encourage for MacRuby, HotCocoa, etc?
These will at least be covered by Rucola again, once I have ported it to MacRuby. But because this will be quite an effort I would like to know from Laurent/Rich if we will not be duplicating functionality. - Eloy
At 10:50 +0100 11/12/08, Eloy Duran wrote:
One thing the "cowboys", from Rails for instance, have done right is that there are tests for almost everything, which is something that is seriously lacking atm imo.
Definitely. I had intended to mention testing, but it got lost. I can't find much indication that Cocoa has anything like the panoply of testing tools that Merb offers. Some of these tools might be of direct use to MacRuby; others might serve as inspirations. If the Ruby community can demonstrate the feasibility and value of test suites for Cocoa, it might be able to positively affect the way development is done in the rest of the Cocoa community.
I have not yet seen any well documented API in MacRuby, I must have missed it. Could you explain which one(s) you mean?
MacRuby inherits the ObjC APIs, including documentation, from OSX. Modulo a few accommodations in syntax, the documentation is quite applicable to MacRuby. And, if the Cocoa (etc) APIs are not well documented, it is not due to lack of effort on Apple's part... Of course, as Eloy points out in another thread, this documentation is only useful to the extent that one is using MacRuby directly. A programmer who is using an abstraction layer such as HotCocoa would need to dig through that layer to get to the relevant Cocoa calls, then look up the appropriate documentation.
These will at least be covered by Rucola again, once I have ported it to MacRuby. But because this will be quite an effort I would like to know from Laurent/Rich if we will not be duplicating functionality.
It might be worthwhile to compare Rucola to Merb and see whether a hybrid of some sort could be created. Merb is developing a lot of tooling; it would be very cool if MacRuby could use some of it. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development
One thing the "cowboys", from Rails for instance, have done right is that there are tests for almost everything, which is something that is seriously lacking atm imo.
Rails testing suite is in a very sad state, however I do agree with you, and I'll go further, we also need a test harness for developed apps. However, Laurent is working on macruby on his own and the same thing goes for Rich and HotCocoa. I guess we need to hear from them about what we can do to help them out. - Matt On Wed, Nov 12, 2008 at 4:50 AM, Eloy Duran <eloy.de.enige@gmail.com> wrote:
* Focus on design and engineering
In an age of "cowboy programming", I find it refreshing to see that some programming projects actually embrace design and engineering.
One thing the "cowboys", from Rails for instance, have done right is that there are tests for almost everything, which is something that is seriously lacking atm imo.
As I already discussed with Laurent, I especially would like to see full test/spec coverage for HotCocoa, because: (A) I think it's a good thing to do in any case, but that's just my opinion. (B) More importantly, HotCocoa will probably be the part of MacRuby that most rubyists will hack/contribute on. Without a full test suite it takes too much time to make it enjoyable for people to quickly write a good patch, because one has to trace through all the code.
To put the money where my mouth is; I have started on writing specs for HotCocoa and will commit them once I feel it's a good enough starting point. (There's never enough time…)
I would really like to hear the opinions from the main HotCocoa committers on this.
PS: Credits to Laurent who has been making an effort on writing more and more tests for the core part of MacRuby! :)
* large, well-documented APIs
In a community dominated by a web framework (Rails) that has no defined API, I think this is quite noteworthy.
Serious?? I have not yet seen any well documented API in MacRuby, I must have missed it. Could you explain which one(s) you mean?
Anyway, I started wondering whether any parts of Merb might be
useful for MacRuby to consider adopting. For example:
* Merb, like Rails, defines conventions for directory layout. Would it make sense for MacRuby to have similar conventions?
* Merb stresses modularity very strongly, using gems to add "plugins", "slices", etc. What kinds of modularity should we encourage for MacRuby, HotCocoa, etc?
These will at least be covered by Rucola again, once I have ported it to MacRuby. But because this will be quite an effort I would like to know from Laurent/Rich if we will not be duplicating functionality.
- Eloy
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Nov 12, 2008, at 4:31 PM, Matt Aimonetti wrote:
One thing the "cowboys", from Rails for instance, have done right is that there are tests for almost everything, which is something that is seriously lacking atm imo.
Rails testing suite is in a very sad state,
Definitely not going to argue with you on this ;)
however I do agree with you, and I'll go further, we also need a test harness for developed apps. However, Laurent is working on macruby on his own and the same thing goes for Rich and HotCocoa. I guess we need to hear from them about what we can do to help them out.
I have been writing RubyCocoa apps with (almost) full coverage since a long time, all my findings/hacks/helpers have gone into Rucola. As such, I totally agree with you about having apps with a test suite. But since there's so much work to do on this subject my priority for now would be to have a test suite for HotCocoa first, so everyone can dive in and start hacking. - Eloy
PS: Credits to Laurent who has been making an effort on writing more and more tests for the core part of MacRuby! :)
Ditto. I should say that the RubySpec effort is also useful for testing MacRuby, in as much as it provides coverage for the vast majority of the behavior which MacRuby shares with 1.9 (YARV? I never know what to call it anymore). There are bound to be wrinkles with regards to some of the natively bridged classes, but we ought to document these in our own specs as well. -Ben
At 13:36 -0500 11/12/08, Benjamin Stiglitz wrote:
I should say that the RubySpec effort is also useful for testing MacRuby, in as much as it provides coverage for the vast majority of the behavior which MacRuby shares with 1.9 ...
My understanding is that the 1.9 coverage in the RubySpec suite is pretty skeletal at present, but that simply means that we need to create more 1.9-specific tests, as well as some tests for MacRuby, per se. FWIW, any MacRubySpec (:-) effort should be coordinated with the fine folks running http://rubyspecresults.org/ -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development
It's possible to use HotCocoa to lay out windows, but (AFAIK) the developer still has to do most of the layout, specifying co-ordinates, etc. Like lots of other Ruby developers, I'm comfortable with HTML and CSS layout. So, I wonder how hard it would be to convince WebApp (for example) to accept web layout commands and hand back the resulting co-ordinates. Some kind of AJAX hack could even be used, I suspect, to get dynamic JavaScript support. I'd love to hear about any show-stoppers, other ideas, etc. I would be even happier to get some implementation hints (:-). -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development
This sounds like an idea with potential. Perhaps a new framework for creating "HTML" applications, that takes the HTML and uses a WebView - but instead of actually ending up with a WebView, the data is pulled out and passed onto a true Cocoa interface, kinda thing? On Nov 21, 2008, at 11:25 AM, Rich Morin wrote:
It's possible to use HotCocoa to lay out windows, but (AFAIK) the developer still has to do most of the layout, specifying co-ordinates, etc.
Like lots of other Ruby developers, I'm comfortable with HTML and CSS layout. So, I wonder how hard it would be to convince WebApp (for example) to accept web layout commands and hand back the resulting co-ordinates. Some kind of AJAX hack could even be used, I suspect, to get dynamic JavaScript support.
I'd love to hear about any show-stoppers, other ideas, etc. I would be even happier to get some implementation hints (:-).
-r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
At 12:52 -0900 11/21/08, elliottcable wrote:
This sounds like an idea with potential.
Perhaps a new framework for creating "HTML" applications, that takes the HTML and uses a WebView - but instead of actually ending up with a WebView, the data is pulled out and passed onto a true Cocoa interface, kinda thing?
Pretty much. For example, imagine that WebApp hands back a DOM tree that is decorated with geometric information. The MacRuby app walks this tree and makes the appropriate HotCocoa calls. I think WebApp will simply pass through information it doesn't need, so it should be possible to send in (say) a div that has attributes for widget type (etc) and get back something that means "put one of these widgets in this location with this size". I'm quite sure there are some ugly details to work out, but it costs us nothing to speculate about desirable behavior (:-). -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development
If you would like layout of elements with in HTML style, that's pretty much what Shoes (http://shoooes.net/) is. I had a discussion back in September of implementing Shoes on-top-of or along-side HotCocoa (http://lists.macosforge.org/pipermail/macruby-devel/2008-September/000508.ht... ), but there are problems with attempting to meld the two. For one thing, there's the "instance_eval" issue. Still, I think it would be useful to implement Shoes in MacRuby. I just haven't had time to give this any serious work. Cheers, Josh On Nov 21, 2008, at 4:52 PM, elliottcable wrote:
This sounds like an idea with potential.
Perhaps a new framework for creating "HTML" applications, that takes the HTML and uses a WebView - but instead of actually ending up with a WebView, the data is pulled out and passed onto a true Cocoa interface, kinda thing?
On Nov 21, 2008, at 11:25 AM, Rich Morin wrote:
It's possible to use HotCocoa to lay out windows, but (AFAIK) the developer still has to do most of the layout, specifying co-ordinates, etc.
Like lots of other Ruby developers, I'm comfortable with HTML and CSS layout. So, I wonder how hard it would be to convince WebApp (for example) to accept web layout commands and hand back the resulting co-ordinates. Some kind of AJAX hack could even be used, I suspect, to get dynamic JavaScript support.
I'd love to hear about any show-stoppers, other ideas, etc. I would be even happier to get some implementation hints (:-).
-r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm@cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841
Technical editing and writing, programming, and web development _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (6)
-
Benjamin Stiglitz
-
elliottcable
-
Eloy Duran
-
Joshua Ballanco
-
Matt Aimonetti
-
Rich Morin