Sortable table
Click a column header to sort. The URL updates, the back button works, and a reload keeps the order.
| Name | Year ↑ | Creator |
|---|---|---|
| Fortran | 1957 | John Backus |
| Lisp | 1958 | John McCarthy |
| COBOL | 1959 | Grace Hopper et al. |
| ALGOL 60 | 1960 | Backus, Naur et al. |
| BASIC | 1964 | Kemeny and Kurtz |
| Simula | 1967 | Dahl and Nygaard |
| Logo | 1967 | Papert, Feurzeig, Solomon |
| Forth | 1970 | Charles Moore |
| Pascal | 1970 | Niklaus Wirth |
| C | 1972 | Dennis Ritchie |
| Smalltalk | 1972 | Alan Kay et al. |
| Prolog | 1972 | Alain Colmerauer |
| ML | 1973 | Robin Milner |
| SQL | 1974 | Chamberlin and Boyce |
| Scheme | 1975 | Sussman and Steele |
| Awk | 1977 | Aho, Weinberger, Kernighan |
| Modula-2 | 1978 | Niklaus Wirth |
| Ada | 1980 | Jean Ichbiah |
| Objective-C | 1984 | Cox and Love |
| Common Lisp | 1984 | Steele et al. |
| MATLAB | 1984 | Cleve Moler |
| C++ | 1985 | Bjarne Stroustrup |
| Eiffel | 1986 | Bertrand Meyer |
| Erlang | 1986 | Joe Armstrong |
| Perl | 1987 | Larry Wall |
| Tcl | 1988 | John Ousterhout |
| Haskell | 1990 | Hudak, Hughes, Peyton Jones, Wadler |
| Python | 1991 | Guido van Rossum |
| Visual Basic | 1991 | Microsoft |
| Lua | 1993 | Ierusalimschy et al. |
| R | 1993 | Ihaka and Gentleman |
| Ruby | 1995 | Yukihiro Matsumoto |
| Java | 1995 | James Gosling |
| JavaScript | 1995 | Brendan Eich |
| PHP | 1995 | Rasmus Lerdorf |
| Racket | 1995 | PLT |
| OCaml | 1996 | Xavier Leroy et al. |
| C# | 2000 | Anders Hejlsberg |
| D | 2001 | Walter Bright |
| Scala | 2004 | Martin Odersky |
| F# | 2005 | Don Syme |
| Clojure | 2007 | Rich Hickey |
| Nim | 2008 | Andreas Rumpf |
| Go | 2009 | Griesemer, Pike, Thompson |
| CoffeeScript | 2009 | Jeremy Ashkenas |
| Rust | 2010 | Graydon Hoare |
| Kotlin | 2011 | JetBrains |
| Dart | 2011 | Bak and Lund |
| Elixir | 2011 | José Valim |
| Julia | 2012 | Bezanson, Karpinski, Shah, Edelman |
| TypeScript | 2012 | Anders Hejlsberg |
| Elm | 2012 | Evan Czaplicki |
| Swift | 2014 | Chris Lattner |
| Crystal | 2014 | Ary Borenszweig |
| Zig | 2016 | Andrew Kelley |
| Gleam | 2016 | Louis Pilfold |
| V | 2019 | Alexander Medvednikov |
| Mojo | 2023 | Modular |
What to look at
There is no API route for this one. Each header link points at this very page with ?sort= and ?dir=. hx-select="#table" tells htmx to pull only the table out of the full response and swap it in.
hx-push-url="true" pushes that URL into the browser history. Go back and forth with the browser buttons: htmx restores the page. Reload, and Astro renders the same order on the server, because the page reads the same query string.
The links have a real href too. Without JavaScript, they still sort the table with a full page load. That is progressive enhancement for free.