DEV.co
AI Coding Agents · twitter

scrooge

Scrooge is a Thrift code generator that replaces Apache's Thrift compiler, generating optimized code for Scala, Java, Cocoa, Android, and Lua. Built and maintained by Twitter for production use, it generates compact, idiomatic code with tight integration into the Finagle RPC framework.

Source: GitHub — github.com/twitter/scrooge
794
GitHub stars
247
Forks
Scala
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorytwitter/scrooge
Ownertwitter
Primary languageScala
LicenseApache-2.0 — OSI-approved
Stars794
Forks247
Open issues46
Latest releasescrooge-22.12.0 (2022-12-26)
Last updated2025-04-02
Sourcehttps://github.com/twitter/scrooge

What scrooge is

Scala-based Thrift IDL parser and code generator that produces binary-compatible Thrift codecs while generating language-specific output optimized for each target (immutable Scala classes, Java POJOs, native mobile/Lua code). Integrates with Finagle for RPC patterns and metrics export.

Quickstart

Get the scrooge source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/twitter/scrooge.gitcd scrooge# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Polyglot microservices with Thrift contracts

Generate type-safe, compact client/server stubs across Scala, Java, Android, iOS, and Lua services sharing a common Thrift schema, reducing serialization boilerplate and maintaining binary compatibility.

High-performance Scala/Java services

Leverage Finagle integration to generate services with built-in metrics, connection pooling, and resilience patterns without manual glue code; ideal for latency-sensitive backend systems.

Mobile + backend integration

Generate Cocoa (iOS) and Android client stubs from shared Thrift definitions, ensuring mobile clients and JVM backends stay in sync without manual serialization logic.

Implementation considerations

  • Latest release (22.12.0, Dec 2022) is 16+ months old; verify compatibility with current Scala/Java LTS versions and Finagle release cycles before adoption.
  • Code generation is offline (build-time only); changes to .thrift files require recompilation and redeployment of all affected services.
  • Requires sbt or Maven build integration; no standalone CLI distribution noted, so embedding in non-JVM pipelines is non-trivial.
  • Finagle dependency tight coupling means adopting Scrooge often implies adopting Finagle patterns; evaluate organizational fit before committing.
  • 46 open issues suggest unresolved bugs or feature requests; review GitHub issues for your specific Thrift feature set before relying on stability.

When to avoid it — and what to weigh

  • REST/JSON-first architecture — Scrooge is Thrift-only; if your stack is built on REST, gRPC, or Protocol Buffers, this adds unnecessary abstraction layers and operational complexity.
  • Single-language deployments — If all services run in one language, the code generation benefit diminishes; consider lighter frameworks designed for that ecosystem specifically.
  • Rapid prototyping or schema-less workflows — Thrift requires upfront IDL definition and code regeneration; unsuitable for teams prioritizing fast iteration over strong contracts.
  • Minimal DevOps experience with JVM toolchains — Scrooge depends on Scala, sbt, Maven, and JVM deployment; teams unfamiliar with these tools will face a steep ramp-up and maintenance overhead.

License & commercial use

Apache License 2.0 (Apache-2.0). A permissive OSI-approved license that permits commercial use, modification, and redistribution under attribution and liability disclaimer.

Commercial use is permitted under Apache 2.0 terms (attribution, liability waiver). However, Scrooge is actively maintained by Twitter but has no commercial support offering; enterprise support arrangements must be negotiated separately or relied upon via community channels.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No security issues or disclosure process mentioned in provided data. Thrift protocol itself is not cryptographically secured (no built-in encryption); TLS/mutual auth must be layered at transport (Finagle can provide this). No recent security audit, CVE history, or cryptographic library audit noted; treat as assumption for review.

Alternatives to consider

Apache Thrift (native compiler)

Official Thrift implementation; language-agnostic, widely supported, no Scala dependency, but generates more verbose Java/C++ code and lacks Finagle integration.

gRPC + Protocol Buffers

Modern, polyglot RPC framework with better HTTP/2 support, streaming, and no JVM tie-in; use if adopting new stack or already invested in Protobuf ecosystem.

OpenAPI + code generation (e.g., OpenAPI Generator, swagger-codegen)

REST-first alternative better suited for HTTP-native architectures, wider tooling ecosystem, and easier API documentation integration; choose if REST is primary contract.

Software development agency

Build on scrooge with DEV.co software developers

Assess build integration, schema complexity, and Finagle adoption fit. Review open issues and release cadence. Consult our expert team for guidance on Thrift vs. gRPC/REST trade-offs.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

scrooge FAQ

Do I need Finagle to use Scrooge?
No, Scrooge generates standalone Thrift-compatible code; Finagle integration is optional. However, key features like metrics export and resilience patterns require Finagle or manual implementation.
Can Scrooge-generated code interoperate with Apache Thrift clients/servers?
Yes, Scrooge generates binary-compatible Thrift codecs and builds on libthrift; cross-framework compatibility is maintained by design.
What's the build-time cost of Scrooge code generation?
Unknown from provided data; depends on schema size and number of definitions. Recommend benchmarking with your largest .thrift files in sbt/Maven CI environment.
Is Scrooge suitable for new projects, or only legacy replacements?
Both; active development and Twitter production use suggest stability for new projects. However, evaluate whether Thrift + Finagle architecture fits your team's expertise and roadmap before committing.

Software development & web development with DEV.co

DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If scrooge is part of your ai coding agents roadmap, our team can implement, customize, migrate, and maintain it.

Ready to evaluate Scrooge for your polyglot architecture?

Assess build integration, schema complexity, and Finagle adoption fit. Review open issues and release cadence. Consult our expert team for guidance on Thrift vs. gRPC/REST trade-offs.