4 ms·
> I really want type inference, lightweight objects, properties (vs JavaBean accessor convention), switch for 'instanceof', etc. I believe you're asking for Sc
by saryant 13y ago
> I really want type inference, lightweight objects, properties (vs JavaBean accessor convention), switch for 'instanceof', etc.
I believe you're asking for Scala. For example, switching on types:
trait Foo
class Bar extends Foo
class Baz extends Foo
val thing = // could be either bar or baz, don't know
thing match {
case f: Foo => println("Got foo")
case b: Bar => println("Got bar")
}
- specialist 13y ago:) Our study group has done two Scala tracks (and currently studying Akka and reactive programming). Ruby and Scala make my head hurt. I don't have a mental model for what's happening under the hood. Unlike LISP, Forth, Java, etc. I really do want a refined, simplified Java. My wishlist of features are gleened from Boo (minus the duck typing), Nice, and Kava (lightweight objects). http://boo.codehaus.org http://boo.codehaus.org http://nice.sourceforge.net http://nice.sourceforge.net http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.3172 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.3... Honorable mention for Frink (preserves units). http://en.wikipedia.org/wiki/Frink http://en.wikipedia.org/wiki/Frink
- pron 13y agoYou're not alone. Scala has the features you're looking for, but it's also a mashup of Haskell and Lisp and C++ and a few other mismatched languages. As I said in another comment, Scala is for people who find Haskell too simple, and want to add mutability, inheritance and macros on top of it. I think that what you're really looking for is Kotlin: http://kotlin.jetbrains.org/ http://kotlin.jetbrains.org/
- MrBra 13y agoCan you give an example of something in Ruby that makes your head hurt because you don't know what's going on under the hood?