Play with the API
Edit and run JavaScript using sortSmart,
compareSmart, sortSmartByKey,
smartKey, and Order for options.
Ctrl+Enter runs it too.
Using another language? See below for the same API in C++, C#, Java, Lua, Python, and Rust, as read-only example programs.
Same code, seven languages
This is the code you'd write to use Ordable from each language: one tour through the whole API. Every version prints exactly the same text, and they all run in CI.
Run it:
How it's made
Ordable is written once, in Temper, a language built for writing libraries that compile to many other languages. Temper turns the same source into a natural library for each one: classes and methods in C# and Java, modules in Lua and Python, a crate in Rust, and so on. Tests run on every language, and every language sorts every list the same way.
This page uses the JavaScript version directly, with no framework, bundled with esbuild. Much of its size is Unicode tables: digits in every script, case folding, and accented letters' base letters.