background preloader

Scala

Facebook Twitter

Applications. Absolutely No Machete Juggling » Scala Second Impressions. In De­cem­ber, I posted about my early thoughts on Scala after using it for a short time. Ini­tially, I thought that using Scala didn't buy very much - the func­tional style could be adopted in in Java, and the syntax and li­braries could be ugly.

Since that time, I've been using Scala almost ex­clu­sively, and I wish to revise my view: Scala is awesome. While some of my initial thoughts still stand, par­tic­u­larly that Scala APIs often overuse op­er­a­tor over­load­ing, much of my per­cep­tion has shifted oth­er­wise. Scala not only allows, but en­cour­ages solid func­tional pro­gram­ming prin­ci­ples that are dif­fi­cult or im­pos­si­ble in Java. A great deal of my per­cep­tion shift has been due to fa­mil­iar­ity and train­ing. I realize that a lot of my earlier issues with Scala were due to my own lack of comfort with the lan­guage, and over the last year I've done a great deal to level up my Scala skills sig­nif­i­cantly, like: Read the en­tirety of Odersky et. al.'

Signal/Collect - Parallel Graph Processing. Fast and scalable Algorithms are automatically executed in parallel. Easy to use Many algorithms can be expressed in just a few lines of code. Configurable The defaults get you started quickly, but everything can be customized. How it works In Signal/Collect algorithms are written from the perspective of vertices and edges. Many algorithms have very simple and elegant implementations in Signal/Collect. Example Algorithms. Effective Scala. Table of Contents Other languages 日本語Русский简体中文 Introduction Scala is one of the main application programming languages used at Twitter. Scala provides many tools that enable succinct expression. Above all, program in Scala. This is not an introduction to Scala; we assume the reader is familiar with the language. This is a living document that will change to reflect our current “best practices,” but its core ideas are unlikely to change: Always favor readability; write generic code but not at the expensive of clarity; take advantage of simple language features that afford great power but avoid the esoteric ones (especially in the type system).

And have fun. Formatting The specifics of code formatting — so long as they are practical — are of little consequence. This is of particular importance to Scala, as its grammar has a high degree of overlap. We adhere to the Scala style guide plus the following rules. Whitespace Indent by two spaces. Naming Use short names for small scopes Use vals Prefer: Index. Addison-Wesley 2012 “Currently the best compact introduction to Scala” —Martin Odersky “The book is a joy to read. Probably the most concise reference for Scala available on the market, this deserves to be on every programmers bookshelf”—James Sugrue What you get: A rapid introduction to Scala for programmers who are competent in Java, C#, or C++ Blog-length chunks of information that you can digest quickly An organization that you'll find useful as a quick reference What you don't get: An introduction into programming or object-oriented design Religion about the superiority of one paradigm or another Cute or academic examples Mind-numbing details about syntax minutiae Available at Safari Books Online, as DRM-free e-book and/or printed book, and on Kindle You can get the A1 level chapters for free at TypeSafe.

Here is the source code for the examples. Gibberish in the book? Table of Contents The [AL][1-3] refer to Martin Odersky's Scala levels.