Skip to main content
100%

Sieve

✓ Published0🌍 Public
Aankuagar
Last edited Apr 8, 2016
Created on Apr 18, 2018

This example compares four functional programming languages—OCaml, JSJS, Clojure, and Scala—each implementing the Sieve of Eratosthenes to count primes up to a given integer. The code shows recursive filtering of a list range, using language-specific constructs like OCaml’s `List.filter`, Clojure’s `loop`/`recur`, and Scala’s `def aux` with list operations. The visualization highlights syntactic and structural differences across languages, with each snippet sharing the same algorithmic logic. The data source is the inline code itself, illustrating how each language handles list generation, recursion, and modular arithmetic.

AI-generated description

Similar vizzes