in which I build a series of Sudoku solvers, accompanied by blog posts, written in various programming languages. All of them implement simple backtracking, but each of them works a bit differently, leveraging the individual strengths of the language.
sudoku.py: written in Python. Reference implementation. Using MRV and DFS.sudoku.lisp: written in SBCL. Leveraging macros, bitsets, and type and optimization declarations.sudoku.pro: written in SWI Prolog. Declarative, leverages Prolog for core algorithmn.sudoku.hs: written in Haskell. Leverages types and state using monads.sudoku.rs: written in Rust. Trying to get it as raw and low-level as it gets and minimize allocations.sudoku.ex: written in Elixir. Utilizes the Beam and concurrency on first split.sudolu.apl: written in Dyalog APL. Uses arrays and terse operators to their fullest.sudolu.carp: written in Carp. Uses functional and imperative programming as it sees fit.sudolu.fs: written in Forth. Stack-tical programming.sudoku.st: written in Pharo Smalltalk inside Glamorous Toolkit. Models the board as a live object graph with moldable inspector views.sudoku.rkt: written in Racket with a custom µKanren. Logic programming à la carte.sudoku.sql: written in SQL (sqlite). 'nuff said.
Each of them is accompanied by a blog post, so check them out if you want more information.
Have fun!