Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Scala Native
  3. ScalaPB

ScalaPB

Apache-2.0Scalav1.0.0-alpha.3

Protocol buffer compiler plugin for Scala that generates case classes, parsers, and serializers.

Visit WebsiteGitHubGitHub
1.3k stars293 forks0 contributors

What is ScalaPB?

ScalaPB is a protocol buffer compiler plugin for Scala that generates Scala case classes, parsers, and serializers from .proto files. It solves the problem of integrating Protocol Buffers into Scala projects by producing idiomatic Scala code that can coexist with Java-generated protocol buffer code, enabling gradual migration from Java implementations.

Target Audience

Scala developers working with Protocol Buffers who need type-safe serialization/deserialization, particularly those migrating from Java protocol buffers or building systems with gRPC, Scala.js, or SparkSQL integration.

Value Proposition

Developers choose ScalaPB because it generates clean, idiomatic Scala case classes with features like functional lenses for easy updates, separate file generation for better incremental compilation, and seamless compatibility with both Java protocol buffers and modern Scala ecosystems including Scala.js and gRPC.

Overview

Protocol buffer compiler for Scala.

Use Cases

Best For

  • Generating Scala case classes from .proto files
  • Building gRPC services in Scala
  • Creating Scala.js applications with Protocol Buffers
  • Migrating Java protocol buffer codebases to Scala
  • Working with SparkSQL and Protocol Buffers
  • Functional programming with protocol buffers using lenses

Not Ideal For

  • Projects using build tools other than sbt, such as Maven or Gradle without sbt integration
  • Teams requiring the latest Protocol Buffers features beyond version 3.5.x, as ScalaPB's stable support is limited
  • Environments where minimizing dependencies is critical, due to added runtime and compiler plugins
  • Teams preferring hand-written serialization for maximum control over performance and customization

Pros & Cons

Pros

Idiomatic Scala Integration

Generates Scala case classes that integrate naturally with Scala projects, with separate file generation for each top-level message to improve incremental compilation, as highlighted in the README.

Gradual Migration Path

Enables coexistence with Java-generated protocol buffer code, allowing easy migration from Java to Scala without breaking existing implementations, per the project philosophy.

Comprehensive Feature Set

Supports gRPC, Scala.js, SparkSQL, JSON conversion, and user-defined options out of the box, providing versatile functionality for various use cases.

Functional Programming Support

Includes functional lenses for updating nested structures in a functional way, enhancing code maintainability and alignment with Scala best practices.

Cons

Build Tool Dependency

Primarily designed for sbt, requiring plugin installation and configuration in build.sbt, which adds complexity for projects using other build systems or preferring simpler setups.

Version Limitations

The stable version supports Protobuf only up to 3.5.x, potentially missing newer features or bug fixes from later releases, as indicated in the version table.

Performance Overhead

Some operations, like parsing ASCII representations, delegate to the Java implementation, adding runtime overhead compared to native Scala solutions, as noted in the README.

Frequently Asked Questions

Quick Stats

Stars1,336
Forks293
Contributors0
Open Issues28
Last commit7 days ago
CreatedSince 2014

Tags

#scala-js#protocol-buffers#grpc#serialization#scala#code-generation

Built With

s
sbt
S
Scala

Links & Resources

Website

Included in

Scala Native273
Auto-fetched 35 minutes ago

Related Projects

FastParseFastParse

Writing Fast Parsers Fast in Scala

Stars1,135
Forks165
Last commit3 months ago
scalatagsscalatags

ScalaTags is a small XML/HTML construction library for Scala.

Stars772
Forks117
Last commit9 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub