Re: Anyone know where I can begin to teach myself programming?
Basically it's a runtime library and a compiler. It compiles directly to Java bytecode and you can actually just bundle the runtime library into a jar file and then it's indistinguishable from a general Java app.
You can do all the normal Functional language stuff. Anonomous functions, first class functions, higher order functions, so on and so forth. It also has mixins from Ruby (though Scala calls them traits). It optimises tail calls IIRC by using exceptions to trampoline it. Hopefully Java 7 will see proper tail calls implemented, that will fix a lot of functional languages on the JVM. The real brilliance is the type inference system is very good and allows you to leave a program nearly typeless and it will infer most types avoiding the need to use reflection.
You can call any Java code from Scala. Going the other way is more difficult but can be done if you extend interfaces.
|