Skip to content

Why Axel?

Joshua Grosso edited this page Apr 24, 2020 · 6 revisions

Why Use Axel Instead of...

... Haskell?

Axel is very similar to Haskell! If you ignore Axel's metaprogramming facilities, Axel files should be drop-in replacements for Haskell files. Just change the syntax from Haskell to Axel (which usually means just adding parentheses or curly braces), and you're done! No semantic changes required – one of Axel's goals is to stay as true to (and compatible with) Haskell as possible.

However, Axel and its Lisp-inspired syntax really shines when you take advantage of macros. Now, you can easily extend your programs' syntax in ways that would otherwise require Template Haskell or compiler extensions! For example, it's trivial to implement GHC's LambdaCase extension as a macro (see Introduction to Macros for a guided tutorial on how to do so). Even Axel's version of do-notation is a macro from the Axel Prelude; no hardwired syntax necessary!

Template Haskell has several major problems (e.g. it is notoriously unstable between GHC releases, according to the 2017 State of Haskell), and PureScript doesn't have a macro-like system in the first place. Axel aims to resolve these issues by providing an easy-to-use metaprogramming system on top of

Or, maybe the Haskell ecosystem isn't your cup of tea. Have no fear! We're currently working on adding PureScript and Eta backends for Axel, so you'll be able to take advantage of the JavaScript or Java ecosystem from Axel.

... Another Lisp?

Axel is a Lisp dialect, but what sets it apart from most other Lisps is its semantics. Since Axel is a layer over Haskell, you get to take advantage of Haskell's world-class type-system and purely-functional style while also keeping those glorious macros. This is Axel's big separator from traditional, dynamically-typed Lisps such as Common Lisp, Clojure, or Racket.

Axel is admittedly not alone in the "Haskell-esque Lisp" family, but it occupies a distinct place among its sister languages.

  • Axel was originally inspired by the excellent Hackett project, which adds Haskell's semantics to Racket's syntax and ecosystem. Axel is the "opposite" of Hackett, so to speak, in that it adds Lisp's syntax to Haskell's semantics and ecosystem. Axel tries to make the migration from Haskell as seamless as possible: You can gradually migrate a Haskell project to Axel if that works best for your project; Axel can (soon) auto-convert a Haskell project or file to the corresponding Axel syntax; etc. If you love Racket (its libraries, hygenic macro system, etc.), however, Hackett's an excellent choice.

  • Axel aims to be a spiritual successor to Liskell. At the time of writing, Liskell's last commit was in 2009, so Axel tries to take over where Liskell left off. Axel hopes to provide a production-ready Lisp on top of the Haskell ecosystem, while emphasizing developer experience along the way.