Skip to content

jason-womack/project-polyglot-euler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

project-polyglot-euler

A polyglot Project Euler workspace with modern build tooling, test frameworks, and starter structure so you can focus on writing solutions.

Goals

  • Keep each language idiomatic while giving you one predictable workflow.
  • Make adding a new problem fast and scriptable.
  • Encourage tests for helper logic and invariants without hardcoding final Euler answers.

Included languages

  • Java (JDK 21, Gradle, JUnit 5)
  • Scala (Scala 3, Gradle, ScalaTest)
  • Kotlin (Kotlin 2, Gradle, JUnit 5)
  • Groovy (Groovy 4, Gradle, Spock)
  • Clojure (Clojure 1.12, Gradle + Clojurephant, clojure.test)
  • TypeScript (Node 22+, TypeScript 5, Vitest)
  • Haskell (GHC via cabal, Hspec)
  • Rust (edition 2024, Cargo, built-in test)
  • Go (Go 1.24+, go test)
  • Python (Python 3.12+, pytest, Ruff)

Repository layout

languages/
  jvm/        # Java, Scala, Kotlin, Groovy, Clojure modules under one Gradle build
  typescript/ # npm + TypeScript + Vitest
  haskell/    # cabal + Hspec
  rust/       # Cargo project with one binary per problem
  go/         # Go module with one cmd package per problem
  python/     # pyproject + pytest + Ruff
problems/     # per-problem notes/specs independent of language
scripts/      # bootstrap, scaffold, run, and test helpers

Quick start

bash scripts/bootstrap.sh
bash scripts/test-all.sh

Add a new problem skeleton

bash scripts/new-problem.sh 0002

This creates a top-level problem markdown file and starter files in each language project if they do not already exist.

Run one solution

bash scripts/run-problem.sh java 0001
bash scripts/run-problem.sh scala 0001
bash scripts/run-problem.sh kotlin 0001
bash scripts/run-problem.sh groovy 0001
bash scripts/run-problem.sh clojure 0001
bash scripts/run-problem.sh typescript 0001
bash scripts/run-problem.sh haskell 0001
bash scripts/run-problem.sh rust 0001
bash scripts/run-problem.sh go 0001
bash scripts/run-problem.sh python 0001

Testing policy

  • Test helper functions and algorithm properties.
  • You can use small examples from the Euler prompt (for example, below 10 for Problem 1).
  • Avoid committing final-answer assertions for the full target input when you want to keep solutions private.
  • Prefer invariant tests (monotonicity, divisibility checks, edge cases, parity across implementations).

Legacy code

Your original Clojure file remains at main/clojure/src/projecteuler.clj for reference.

About

project-polyglot-euler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors