3 ms·
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 i
by kgo 16y ago
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.
- StavrosK 16y agoThanks 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)?
- pufuwozu 16y agodex 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.
- StavrosK 16y agoAh, 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.
- pufuwozu 16y agoThe Android Scripting project adds support for Python, Perl, JRuby, Lua, BeanShell, JavaScript and Tcl: http://code.google.com/p/android-scripting/ http://code.google.com/p/android-scripting/