News for hackers. Stuff that matters.
Re:Ask HN: What do you think of F#? by kgo on Sunday October 24, 2010 @04:07PM (#1827107)
Scala's...

weird...

Scala would fall under the typed functional family. It has it's own version of ADT's and it has pattern matching. But in a lot of ways it's a hybrid OO/Functional language. A lot of the decisions in the language's design were made so that it'd play nice with Java-proper.

My initial superficial feelings about it was that it combined the worst of both worlds. It had all the popularity of a functional language, and all the nice syntax of Java.

Since then I've started writing a Droid app to get a real feel for the language, and all my superficial feelings were wrong. I like the language a lot. But it's still a little weird compared to all the other typed functional languages. You can't see as much ML in Scala as you can in F# or even Haskell.

Still, if you're stuck (or prefer) the JVM, then that's probably the typed functional language you'd want to try. That's the reason I'm using it for Droid development.

Re:Ask HN: What do you think of F#? by StavrosK on Sunday October 24, 2010 @04:31PM (#1827172)
Thanks for that. The apps run on Android? I thought Dalvik only supported Java... Or is there a Scala -> Java compiler (or Java bytecode -> Dalvik bytecode, for that matter)?
Re:Ask HN: What do you think of F#? by pufuwozu on Sunday October 24, 2010 @06:47PM (#1827579)
dex is an executable that comes with the SDK and converts files from .class (Java bytecode) to .dex (Dalvik bytecode)

For a while there was a bug in the Dalvik VM that wouldn't let you run some Scala methods but I made a patch to fix that problem. I think it's in all releases after Android 1.6.

Re:Ask HN: What do you think of F#? by StavrosK on Sunday October 24, 2010 @07:01PM (#1827619)
Ah, I see, fantastic. I thought it compiled the code into .dex. I imagine it might run Jython as well, then?

EDIT: Apparently Jython uses on-the-fly bytecode generation on account of being dynamic, so it can't run.

Re:Ask HN: What do you think of F#? by pufuwozu on Sunday October 24, 2010 @07:08PM (#1827635)
The Android Scripting project adds support for Python, Perl, JRuby, Lua, BeanShell, JavaScript and Tcl:

http://code.google.com/p/android-scripting/

Re:Ask HN: What do you think of F#? by rbxbx on Sunday October 24, 2010 @09:53PM (#1828080)
http://www.mirah.org/ (formerly Duby) is another compelling candidate for Android development for those that like Ruby. Compiles to Java byte-code :)
Re:Ask HN: What do you think of F#? by StavrosK on Sunday October 24, 2010 @07:18PM (#1827660)
That's very handy, thank you!