Live data from Hacker News

RubyMotion - Ruby for iOS

rubymotion.com

221–230 of 250 posts

Re: RubyMotion - Ruby for iOS

#221

Earlier quoted context omitted.

I strongly disagree with your statement that Ruby excels and metaprogramming and DSLs. Other languages (Scala, C#, F#, etc) with coherent type systems have demonstrated an ability to define equivalently useful DSLs with the added property of validating correctness of a declarative language at compile time. You mention LINQ as somehow deriving from Ruby -- it doesn't, it derives from set theory, relational algebra, an…

"Ruby is a "me too" on those fronts, and not a particularly novel one." Of course . No one, especially not Matz, ever claimed Ruby was novel. Why should I care whether a language feature is new when I have features to ship? What you seem to be dogmatically, blindly ignoring is that Ruby's peculiar amalgamation of existing techniques, borrowed from (standing on the shoulders of) Smalltalk, Perl, Python, certain aspect…

> Suffice it to say, in my entire software career I've kept track of the sum total of bugs I've fixed related to passing the wrong type to a method, or receiving a wrong type from a method, and that number, to date, is (whirring, calculating sounds): 0

This is the classic response. It's also ridiculous. It's not just a matter of "passing the wrong type", it's a matter of using the type system to express higher-level constraints that make it impossible to introduce bugs in a complex system -- bugs more fancy than "I passed a string when I should have passed an int".

Of course, passing a string when you should have passed an int happens with regularity, too, and claims otherwise are a lie, especially if you don't spend a ridiculous amount of time pretending to be a compiler by writing extensive unit tests that would be totally unnecessary if you had one.

> And I never claimed that LINQ or C# lambdas were derived from Ruby, just that they were Ruby-ish. Clearly someone in Redmond is watching Ruby and Rails.

What? I ... no. I point out a 1965 paper on lambdas and you claim MS R&D is watching Ruby? You're comparing LINQ -- which implements a coherent model of relational algebra and set theory -- to Rails?

Ruby didn't pioneer these things, didn't add anything novel to them, implemented inconsistent models of them, and can't take any credit for them.

Re: RubyMotion - Ruby for iOS

#222

Earlier quoted context omitted.

Why not? Sure, neither ruby nor python emphasise immutability, and recursion isn't optimised, but both lend themselves to a functional style if you're so inclined. See http://stackoverflow.com/questions/159797/is-ruby-a-function...

I think 55pts makes an important distinction: just because it's possible to write programs in a functional style doesn't mean it's a functional language. The answer with the most votes in your SO link sums it up: Ruby is an imperative, OO language, and you can be generous and add that it has first-class functions and lexical closures. But JavaScript, Python, Perl, PHP, and C# fall in this category, and maybe Java 8 w…

Well said. Functional features do not a functional language make.

Re: RubyMotion - Ruby for iOS

#223
post #195

Earlier quoted context omitted.

It's true, I didn't read up on the tech at all. That was just my initial reaction. If it's fast, great! I'd love to see some performance benchmarks. As for Objective-C, whether the language in and of itself is the source of the slowness I was talking about is somewhat beside the point, IMHO. I'm aware that laying out views in Cocoa involves a lot of overhead, and that it's as much to do with the complexity of what's…

The fact of the matter remains though that you take a performance hit when laying out non-trivial views that need to be updated as fast as possible (e.g. when a table view scrolls by even one pixel and all the views have to be redrawn). Not true, on a bunch of different levels. A. Go do a benchmark with a nib loaded with UINib, and then with your "non-trivial view". The difference is negligible. You won't get more th…

Hey, thanks for the comments. I like talking about this stuff.

A. I wasn't talking about loading a nib vs programmatically wiring up a view. Many people never touch interface builder and write all their views from scratch, but in that case you still have the choice between compositing your view using subviews and overriding drawRect with drawing calls. Have you ever has the pleasure setting up a tableview controller on an older (first or second generation) iOS device? The difference in responsiveness there can be quite striking. This may be a topic rendered somewhat moot with newer hardware.

B. That's not my understanding, but if you have a source on that I'd appreciate a link. I was under the impression that while the cell will only be requested once it comes into view, scrolling the table still requires the visible to cells to be re-layed out, which is where the relative inefficiency of subview rendering starts to hurt you. I certainly could be wrong about that though.

C. If I recall, CoreGraphics is implemented on top of OpenGL. You still don't want to do complex graphics in your cell's drawRect in this sort of situation (I'm just imagining an image and a few labels, nothing fancy). Drawing a static image, pre-generated or cached, is a nice solution in some cases.

Re: RubyMotion - Ruby for iOS

#225

Earlier quoted context omitted.

"Ruby is a "me too" on those fronts, and not a particularly novel one." Of course . No one, especially not Matz, ever claimed Ruby was novel. Why should I care whether a language feature is new when I have features to ship? What you seem to be dogmatically, blindly ignoring is that Ruby's peculiar amalgamation of existing techniques, borrowed from (standing on the shoulders of) Smalltalk, Perl, Python, certain aspect…

> Suffice it to say, in my entire software career I've kept track of the sum total of bugs I've fixed related to passing the wrong type to a method, or receiving a wrong type from a method, and that number, to date, is (whirring, calculating sounds): 0 This is the classic response. It's also ridiculous. It's not just a matter of "passing the wrong type", it's a matter of using the type system to express higher-level…

"This is the classic response."

It's classic because it's true.

"bugs more fancy..."

Fancy? Fancy?? (thumbs through Knuth and SICP looking for "fancy" bugs...looks for "fancy" anti-pattern...)

Nope, not there. Consistent with my own experience, rather than anecdotal FUD (Fanciness Uncertainty and Doubt), after years and years and thousands and thousands of lines of code in type-safe and dynamic environments, I've yet to encounter a significant issue that would have been caught by a type-safe system.

"...especially if you don't spend a ridiculous amount of time pretending to be a compiler by writing extensive unit tests that would be totally unnecessary if you had one."

Complete. Nonsense. I write the same unit tests in RSpec and TestUnit that I write in NUnit and JUnit, and far, far, FAR, fewer lines of code for the same coverage in Ruby. I do NOT write extra unit tests because -- holy crap! I don't have type-safety!

No, type coverage is a side-effect of a well-written unit test. No extra effort whatsoever is needed.

"I point out a 1965 paper on lambdas and you claim MS R&D is watching Ruby?"

This is starting to sound like a debate between a CS student who just got out of a Set Theory final and just figured out who CAR Hoare is, and someone who is just trying to ship features and make sure his company makes money. Yes, I have a decent handle on lambda calculus (thanks for the Wikipedia link) and I know the differences between Ruby's collections DSL and LINQ, having used both pretty extensively.

It doesn't matter. The notion that MS is not paying attention to the most influential application framework of the last 10 years is a ridiculous idea. The fact that Ruby didn't pioneer lambda calculus is...just as obvious as the fact that C# didn't pioneer VMs, GC, generics, etc., and can't take credit for those either, and just as much of a non-sequitur.

Re: RubyMotion - Ruby for iOS

#226

I love writing Ruby code, but today I'm finally at a point where I also feel happy and productive with Objective-C. What made my eyes bulge is this: http://www.rubymotion.com/developer-center/guides/project-ma... No XCode. Instead of obscure and impenetrable project files, a convention over configuration Rakefile. Clean and Ruby-like workflows and repositories. While you can certainly configure an Xcode workspace to…

Which makes me wonder.. is it possible to rig up such an environment for standard Objective C iOS app development? It could be huge.

It's entirely possible to use Make (or whatever you want) to build a project. There's no magic to Xcode. You just need to invoke to correct compiler and linker (Apple's GCC, usually), include the right flags and frameworks for them, and probably invoke some Apple tools for things like code-signing.

Re: RubyMotion - Ruby for iOS

#227
post #195

Earlier quoted context omitted.

The fact of the matter remains though that you take a performance hit when laying out non-trivial views that need to be updated as fast as possible (e.g. when a table view scrolls by even one pixel and all the views have to be redrawn). Not true, on a bunch of different levels. A. Go do a benchmark with a nib loaded with UINib, and then with your "non-trivial view". The difference is negligible. You won't get more th…

Hey, thanks for the comments. I like talking about this stuff. A. I wasn't talking about loading a nib vs programmatically wiring up a view. Many people never touch interface builder and write all their views from scratch, but in that case you still have the choice between compositing your view using subviews and overriding drawRect with drawing calls. Have you ever has the pleasure setting up a tableview controller…

Many people never touch interface builder and write all their views from scratch, but in that case you still have the choice between compositing your view using subviews and overriding drawRect with drawing calls.

Many people overestimate how expensive a view is to lay out, and jump straight into code (I'm as guilty of this as anyone else), without actually stopping to see how nibs perform, due to misunderstanding some part of the pipeline.

Have you ever has the pleasure setting up a tableview controller on an older (first or second generation) iOS device? The difference in responsiveness there can be quite striking. This may be a topic rendered somewhat moot with newer hardware.

Yup. Fun times. Glad we're not there anymore. And given AT&T gives away 3GS's for free, I'd have to agree that the topic's moot and go on to say that it isn't worth the time or effort to support a device that no one has anymore ;)

..but if you have a source on that I'd appreciate a link

Add a log to -layoutSubviews of your cell subclass, and look at how often it gets printed out when you scroll.

If I recall, CoreGraphics is implemented on top of OpenGL. You still don't want to do complex graphics in your cell's drawRect in this sort of situation (I'm just imagining an image and a few labels, nothing fancy). Drawing a static image, pre-generated or cached, is a nice solution in some cases.

Go far enough back, and everything UI-related is OpenGL. CoreGraphics, however, is not built directly on top of OpenGL. It's part of Quartz, (specifically, QuartzGL). QGL on Mac can use either CPU-backed or GPU-backed drawing. On Mac, QGL defaults to CPU-backed drawing, but an app can use the GPU backing instead, by setting QuartzGLEnable to true in Info.plist. This option isn't available on iOS. You're stuck with CPU, only, for CG.

Re: RubyMotion - Ruby for iOS

#228
I would love to try this out, but a 100+ euro pricetag for evaluation is a bit steep (yeahyeah, I know, but hey...Jetbrains gives a 30 day eval version of their iOS IDE so why not RubyMotion?).

Any chance on a (feature crippled) evaluation version?

Re: RubyMotion - Ruby for iOS

#230

Earlier quoted context omitted.

> Suffice it to say, in my entire software career I've kept track of the sum total of bugs I've fixed related to passing the wrong type to a method, or receiving a wrong type from a method, and that number, to date, is (whirring, calculating sounds): 0 This is the classic response. It's also ridiculous. It's not just a matter of "passing the wrong type", it's a matter of using the type system to express higher-level…

"This is the classic response." It's classic because it's true . "bugs more fancy..." Fancy? Fancy?? (thumbs through Knuth and SICP looking for "fancy" bugs...looks for "fancy" anti-pattern...) Nope, not there. Consistent with my own experience, rather than anecdotal FUD (Fanciness Uncertainty and Doubt), after years and years and thousands and thousands of lines of code in type-safe and dynamic environments, I've ye…

Since you're arguing by authority, I've been doing this for 15 years.
Post reply on HN