Scala Development with Ergo

Ergo's primary language is Scala. Similarly, the scripting language used by Ergo, ErgoScript, is also based on Scala.

If you're new to Scala development with Ergo, the Ergo Scala Skeleton App is a great place to start.

Why Scala?

Ergo's primary language is Scala. Similarly, the scripting language used by Ergo, ErgoScript, is also based on Scala, but the off-chain code can be written in any language. Developers have access to a growing selection of tools and Software Development Kits (SDKs) for JVM, Rust and JS/TS.

  • Truly cross-platform: the same code can run on JVM and JavaScript natively.
  • Key ecosystem libraries for Scala support all platforms, and the popularity of Scala.js and Scala-native is increasing.
  • Conciseness in both syntax and conceptual level.
  • Can be more efficient than similar Java code due to primitive unboxed types and code specialization.
  • Multi-paradigm: combines OOP, FP, and LP, suitable for a wide range of domains.
  • Scala 3 brings powerful features such as metaprogramming and tools for zero-cost abstractions.

Scala Versioning (Scala 3)

Ergo's core components, including the reference node and sigmastate-interpreter, have undergone migration to Scala 3. This migration leverages the newer language features, improved type system, and tooling enhancements offered by Scala 3.

  • Rationale & Implications: For a detailed understanding of the motivations behind the Scala 3 migration and its potential impact on the ecosystem (including Long-Term Support plans), refer to the official Scala blog post: Next Steps for Scala 3 and Scala 2 Long-Term Support.
  • Developer Impact: Developers contributing to or building upon these core libraries need to ensure their development environment and build tools (like SBT) are compatible with Scala 3. While Scala 3 offers significant improvements, developers should be aware of potential syntax changes or library compatibility adjustments compared to Scala 2.

Learning Resources

Development Resources

Note: The public interfaces of these libraries are subject to change.