Building upon the discussion in the prior session that introduces Scala as a functional programming language on JVM (Java Virtual Machine) and its fundamental elements of its power, this session will provide a concrete example in code by illustrating those key concepts. Focusing on a simple and natural extension that Morgan Stanley built via Scala’s compiler plugin mechanism, and relating the syntax to its corresponding semantics, especially its optimized program behavior at runtime while being succinct in source form, an essential analysis will be conducted to show how the afore-mentioned benefits can be realized, for example general-purpose caching, asynchronous I/O, harnessing multi-core, and distribution of calculation, etc. Various classical optimization techniques can be applied without changing the source program text, so that it remains clear in terms of logic and intent, while only annotation is necessary for those optimization to materialize, thus maintaining the correctness when we optimize. All these make it possible for Morgan Stanley to run large-scale complex analyses on grids of machines, with predictable performance, to achieve demanding SLA (Service Level Agreement), in an ever-changing market.