Skip to content

Explore adding Scala #137

Description

@leon0399

Why Scala

Scala runs on the JVM but brings a functional programming paradigm — pattern matching, immutable collections, higher-order functions. Comparing it against Java and Kotlin on the same JVM would show the overhead (or lack thereof) of functional idioms in a shared runtime.

Key considerations

  • JVM-based — can compare directly with Java and Kotlin
  • Scala 3 is the current version, significant changes from Scala 2
  • Functional style may require different patterns for treap/mutable data structures
  • scala-cli simplifies single-file compilation/execution
  • Scala Native exists but is less mature — JVM target is the priority

Implementation

Implement all 7 benchmark algorithms following the reference implementations (PHP, C++, Python):

  • collatz/MaxSequence
  • linpack/Linpack
  • mandelbrot/Simple
  • primes/Atkin
  • primes/Simple
  • recursion/Tak
  • treap/Naive

Setup:

  • Create langs/scala/benchmark.yml
  • Create docker/scala/Dockerfile
  • Update README.md implementation table

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions