Skip to content

nayato/scrooge

 
 

Repository files navigation

Scrooge

Build status Coverage status Project status Gitter Maven Central

Scrooge is a thrift code generator written in Scala, which currently generates code for Scala and Java.

It's meant to be a replacement for the apache thrift code generator, and generates conforming, compatible binary codecs by building on top of libthrift. It integrates with the finagle project, exporting stats and finagle APIs, and makes it easy to build high throughput, low latency, robust thrift servers and clients.

Part of the motivation behind scrooge's scala implementation is that since Scala is API-compatible with Java, you can use the apache thrift code generator to generate Java files and use them from within Scala, but the generated code uses Java collections and mutable "bean" classes, causing some annoying boilerplate conversions to be hand-written. Scrooge bypasses the problem by generating Scala code directly. It also uses Scala syntax so the generated code is much more compact.

There is a comprehensive set of unit tests, which generate code, compile it, and execute it to verify expectations, as well as gold files to make it easy to review the effects of changes to the generator.

Status

This project is used in production at Twitter (and many other organizations), and is actively developed and maintained.

Building the develop branch locally

You will need the develop branch of util.

Finagle depends on scrooge-core, so the order in which you build dependencies should be:

  • in util: ./sbt publishLocal
  • in scrooge: ./sbt publishLocal
  • in finagle: ./sbt publishLocal

You will need the develop branch of finagle to run tests in scrooge-generator-tests, but you do not need it to build scrooge otherwise.

Full Documentation

https://twitter.github.io/scrooge/

Packages

No packages published

Languages

  • Scala 61.2%
  • Java 14.9%
  • HTML 8.6%
  • Thrift 6.8%
  • Objective-C 5.0%
  • Shell 2.2%
  • Other 1.3%