dynamic languages strike back scala strongly-typed jvm language dynamic: slow 10x-100x bad tools maintenance bad: millions of lines (but small code bases) eval lack of type tags PLUS: productivity, expressiveness, flexibility turing machine object and var types can change defeats compiler inline function call c++ virtual method calls foo.bar() polymorphism method lookup + function call instruction cache "scripting" no point optimizing better algorithm : optimize bubble-sort native threads / optional type system vm: generational gc, async io smarter compiler c++ vs java: short runtime / quick startup java: 10-100 threads, jvm java ~ c/c++ Erlang 10ks + more threads D objective-C C++ problems: portability ... fast deadend GC pause, OS pauses anyway ... used to be true ... common-lisp c-like speed 10-20% or 2x slower () strongTalk/scheme/self -> bad marketing? hotspot composable stuck with what we got ? 2008 large companies Sun MS Google squeak Io Scala ... hybrids ... industry 80/20 politics/technology google: scaling [ruby] TOOLS IDE: autocomplete, refactoring, jump-to-declaration better info at runtime, polymorphic inline caching [SELF, Urs Hoelzle] 80/20 power law ... for loop iteration specific type of var wont change usually ai winter determinism vs. statistical Peter Norvig NLU von Neumann MonteCarlo methods function foo(a,b) { return a+b; } var bar = 17.6 var x = {a: "hi", b: "there"}; but Java ... alias data flow analysis code graph of basic blocks 95% Java reflection ~5% renameMethod ... XML config, DB persistence, ... Java Smalltalk IDE tied to runtime ... javac bytecode jvm back to AST (bytecode verifier) constant propagation loop unrolling jvm undo ... java generics co- and contra-variant return types "dynamic" often rather static high-level gives perspective ... "small" system global optimization javascript ajax pypy c-like performance? type inference convert int 2 double on overflow double-dispatch trace trees runtime info gpu games mark-and-sweep gc, reference counting hardware mismatch with jit 2nd order language ? "dark corners" compilers eventually beat programmers' trick volatile declaration debugger unit tests == poor man's type system contracts type-signatures