Live data from Hacker News

Confessions of a Ruby Developer Whose Heart was Stolen by Scala

speakerdeck.com

71–74 of 74 posts

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#71
post #57
post #54

Earlier quoted context omitted.

What you're telling me sounds reasonable, but I thought about it some more, and these rules are so syntactically ambiguous, writing a Ruby parser should be just plain impossible! If you can call 0-ary functions (functions which take zero arguments) without parentheses, how does Ruby know what a statement as simple as "a = b" does? It must expand internally to something like this (in Python notation): a = b() if b.is_…

It's a common joke that Ruby is designed to make it as hard as possible for parsers. For the code samples going forward, keep in mind that in ruby you don't need a literal return statement to return a value from a method. Just whatever value is last, is returned: def val 5 end That method would always return 5. > But then if the b() call itself returns a function, then is that function auto-called as well? No, the on…

This is really interesting. I guess some of my examples were relying on using a similar lexer as C -- which you probably couldn't in Ruby. I'll have to think some more about what a Ruby lexer would look like...

But again, it steepens the learning curve -- it's so different from other languages that it's actually kind of hard to immediately see all the implications of "well Ruby's lexer is different than C's lexer".

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#72
post #66

Earlier quoted context omitted.

Thanks, I forgot about loading the libraries directly onto my phone for testing. When you say Android Annotations, are you referring to the ones built into java/android (like @TargetApi) or your own custom ones? Just wondering, since I'm about to add ActionBarSherlock to a Scala project and it includes quite a few I'll have to rewrite. Edit: seems it doesn't like ActionBarSherlock most likely due to that. I get "Erro…

I don't believe I've used ABS with Scala before. Shouldn't integrating ABS as an apklib solve this issue though? Regarding AndroidAnnotations: https://github.com/excilys/androidannotations/wiki

In case you were curious it was a super vague proguard error that turned out to be the issue. Adding

-keepclassmembers class * extends com.actionbarsherlock.ActionBarSherlock { (android.app.Activity, int); }

fixed it. Ugh :/

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#73
post #42

I just wonder when someone will build a tool to annotate Ruby, Python source code with var types gathered during run-time. If C has Valgrind then dynamic typed languages should get something for the types.

Python 3.0 has the Gradual module[1][2].

[1] http://ecee.colorado.edu/~siek/gradualtyping.html

[2] https://pypi.python.org/pypi/gradual

Re: Confessions of a Ruby Developer Whose Heart was Stolen by Scala

#74
post #25

They way you'd build large systems in dynamic languages is to break it up into many smaller pieces that work together. This frees you to change parts without worrying about the rest. To me, this type of development is much more natural and sane than the "one big clusterfuck" type of projects I've seen in Java et.al. Edit: Also, dynamic languages let you make the tradeof between safety and speed. Sometimes you go slow…

Hm, I don't know what you've seen but I'm pretty sure Java is about breaking up large systems into many smaller pieces that work together, instead of one big clusterfuck. Must be some really badly designed system, more of a programmer's fault than the language itself

True, but isn't it still one big program/project? What I mean was to break it up into many smaller programs and (possibly) projects (think unix process vs. classes =)
Post reply on HN