Clojure vs Common Lisp vs Haskell

Need advice about which tool to choose?Ask the StackShare community!

Clojure

1.9K
1.4K
+ 1
1.1K
Common Lisp

265
255
+ 1
145
Haskell

1.4K
1.2K
+ 1
527

Clojure vs Common Lisp vs Haskell: What are the differences?

Introduction

Clojure, Common Lisp, and Haskell are three popular functional programming languages with distinctive features. To understand their differences, we will highlight key aspects that set them apart.

  1. Syntax: Clojure uses a Lisp syntax with a focus on simplicity and minimalism, leveraging the parentheses-heavy S-expression format. Common Lisp offers a more verbose syntax with a rich set of built-in constructs, making it suitable for a wide range of tasks. Haskell, on the other hand, uses a unique mix of functional and imperative styles, featuring distinctive type signatures and type inference capabilities.

  2. Concurrency: Clojure emphasizes immutable data structures and software transactional memory for managing concurrency. Common Lisp provides multiprocessing capabilities through its threads and processes model. Haskell incorporates lazy evaluation and pure functions to enhance concurrency handling, with features like Software Transactional Memory (STM) in its toolbox.

  3. Type System: Clojure is dynamically typed, allowing for rapid prototyping and flexibility in development. Common Lisp supports both strong and weak typing paradigms, providing developers with a choice based on project requirements. Haskell boasts a powerful static type system that ensures type safety at compile time, promoting robust and reliable code.

  4. Community and Ecosystem: The Clojure community is known for its emphasis on simplicity, immutability, and the pragmatic programming philosophy. Common Lisp boasts a long-standing and dedicated community that continues to maintain and expand libraries and tools. Haskell's community is renowned for its focus on purity, correctness, and mathematical rigor, supporting developers in creating high-performance and reliable software.

  5. Learning Curve: Clojure's minimalist syntax and functional programming concepts make it relatively accessible for newcomers, especially those familiar with Lisp-style languages. Common Lisp's rich feature set and syntactic flexibility can lead to a steeper learning curve for beginners. Haskell's strong emphasis on types and functional programming principles may pose a challenge for individuals transitioning from imperative languages.

  6. Use Cases: Clojure is well-suited for web development, data processing, and concurrent programming due to its emphasis on immutability and simplicity. Common Lisp shines in AI research, language design, and rapid prototyping, offering a mature ecosystem for various domains. Haskell excels in creating high-performance, reliable, and mathematically rigorous software, making it popular in industries such as finance, academia, and research.

In Summary, Clojure, Common Lisp, and Haskell differ in syntax, concurrency handling, type systems, community focus, learning curves, and preferred use cases, each offering distinct advantages for various programming tasks.

Decisions about Clojure, Common Lisp, and Haskell

We’re a new startup so we need to be able to deliver quick changes as we find our product market fit. We’ve also got to ensure that we’re moving money safely, and keeping perfect records. The technologies we’ve chosen mix mature but well maintained frameworks like Django, with modern web-first and api-first front ends like GraphQL, NextJS, and Chakra. We use a little Golang sparingly in our backend to ensure that when we interact with financial services, we do so with statically compiled, strongly typed, and strictly limited and reviewed code.

You can read all about it in our linked blog post.

See more
Timm Stelzer
VP Of Engineering at Flexperto GmbH · | 18 upvotes · 678K views

We have a lot of experience in JavaScript, writing our services in NodeJS allows developers to transition to the back end without any friction, without having to learn a new language. There is also the option to write services in TypeScript, which adds an expressive type layer. The semi-shared ecosystem between front and back end is nice as well, though specifically NodeJS libraries sometimes suffer in quality, compared to other major languages.

As for why we didn't pick the other languages, most of it comes down to "personal preference" and historically grown code bases, but let's do some post-hoc deduction:

Go is a practical choice, reasonably easy to learn, but until we find performance issues with our NodeJS stack, there is simply no reason to switch. The benefits of using NodeJS so far outweigh those of picking Go. This might change in the future.

PHP is a language we're still using in big parts of our system, and are still sometimes writing new code in. Modern PHP has fixed some of its issues, and probably has the fastest development cycle time, but it suffers around modelling complex asynchronous tasks, and (on a personal note) lack of support for writing in a functional style.

We don't use Python, Elixir or Ruby, mostly because of personal preference and for historic reasons.

Rust, though I personally love and use it in my projects, would require us to specifically hire for that, as the learning curve is quite steep. Its web ecosystem is OK by now (see https://www.arewewebyet.org/), but in my opinion, it is still no where near that of the other web languages. In other words, we are not willing to pay the price for playing this innovation card.

Haskell, as with Rust, I personally adore, but is simply too esoteric for us. There are problem domains where it shines, ours is not one of them.

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Clojure
Pros of Common Lisp
Pros of Haskell
  • 117
    It is a lisp
  • 100
    Persistent data structures
  • 100
    Concise syntax
  • 90
    jvm-based language
  • 89
    Concurrency
  • 81
    Interactive repl
  • 76
    Code is data
  • 61
    Open source
  • 61
    Lazy data structures
  • 57
    Macros
  • 49
    Functional
  • 23
    Simplistic
  • 22
    Immutable by default
  • 20
    Excellent collections
  • 19
    Fast-growing community
  • 15
    Multiple host languages
  • 15
    Simple (not easy!)
  • 15
    Practical Lisp
  • 10
    Because it's really fun to use
  • 10
    Addictive
  • 9
    Community
  • 9
    Web friendly
  • 9
    Rapid development
  • 9
    It creates Reusable code
  • 8
    Minimalist
  • 6
    Programmable programming language
  • 6
    Java interop
  • 5
    Regained interest in programming
  • 4
    Compiles to JavaScript
  • 3
    Share a lot of code with clojurescript/use on frontend
  • 3
    EDN
  • 1
    Clojurescript
  • 24
    Flexibility
  • 22
    High-performance
  • 17
    Comfortable: garbage collection, closures, macros, REPL
  • 13
    Stable
  • 12
    Lisp
  • 8
    Code is data
  • 6
    Can integrate with C (via CFFI)
  • 6
    Multi paradigm
  • 5
    Lisp is fun
  • 4
    Macros
  • 4
    Easy Setup
  • 3
    Parentheses
  • 3
    Open source
  • 3
    Purelly functional
  • 3
    Elegant
  • 1
    DSLs
  • 1
    Multiple values
  • 1
    CLOS/MOP
  • 1
    Clean semantics
  • 1
    Will still be relevant 100 years from now
  • 1
    Still decades ahead of almost all programming languages
  • 1
    Best programming language
  • 1
    Simple syntax
  • 1
    Powerful
  • 1
    Generic functions
  • 1
    Can implement almost any feature as a library
  • 1
    Formal specification, multiple implementations
  • 90
    Purely-functional programming
  • 66
    Statically typed
  • 59
    Type-safe
  • 39
    Open source
  • 38
    Great community
  • 31
    Built-in concurrency
  • 30
    Built-in parallelism
  • 30
    Composable
  • 24
    Referentially transparent
  • 20
    Generics
  • 15
    Intellectual satisfaction
  • 15
    Type inference
  • 12
    If it compiles, it's correct
  • 8
    Monads
  • 8
    Flexible
  • 5
    Great type system
  • 4
    Purely-functional Programming
  • 4
    One of the most powerful languages *(see blub paradox)*
  • 4
    Proposition testing with QuickCheck
  • 3
    Pattern matching and completeness checking
  • 3
    Great maintainability of the code
  • 3
    Fun
  • 3
    Reliable
  • 3
    Highly expressive, type-safe, fast development time
  • 2
    Best in class thinking tool
  • 2
    Type classes
  • 2
    Kind system
  • 2
    Better type-safe than sorry
  • 1
    Orthogonality
  • 1
    Predictable

Sign up to add or upvote prosMake informed product decisions

Cons of Clojure
Cons of Common Lisp
Cons of Haskell
  • 11
    Cryptic stacktraces
  • 5
    Need to wrap basically every java lib
  • 4
    Toxic community
  • 3
    Good code heavily relies on local conventions
  • 3
    Tonns of abandonware
  • 3
    Slow application startup
  • 1
    Usable only with REPL
  • 1
    Hiring issues
  • 1
    It's a lisp
  • 1
    Bad documented libs
  • 1
    Macros are overused by devs
  • 1
    Tricky profiling
  • 1
    IDE with high learning curve
  • 1
    Configuration bolierplate
  • 1
    Conservative community
  • 0
    Have no good and fast fmt
  • 4
    Too many Parentheses
  • 3
    Standard did not evolve since 1994
  • 2
    Small library ecosystem
  • 2
    No hygienic macros
  • 1
    Inadequate community infrastructure
  • 1
    Ultra-conservative community
  • 9
    Too much distraction in language extensions
  • 8
    Error messages can be very confusing
  • 5
    Libraries have poor documentation
  • 3
    No good ABI
  • 3
    No best practices
  • 2
    Poor packaging for apps written in it for Linux distros
  • 2
    Sometimes performance is unpredictable
  • 1
    Slow compilation
  • 1
    Monads are hard to understand

Sign up to add or upvote consMake informed product decisions

- No public GitHub repository available -
- No public GitHub repository available -

What is Clojure?

Clojure is designed to be a general-purpose language, combining the approachability and interactive development of a scripting language with an efficient and robust infrastructure for multithreaded programming. Clojure is a compiled language - it compiles directly to JVM bytecode, yet remains completely dynamic. Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system.

What is Common Lisp?

Lisp was originally created as a practical mathematical notation for computer programs, influenced by the notation of Alonzo Church's lambda calculus. It quickly became the favored programming language for artificial intelligence (AI) research. As one of the earliest programming languages, Lisp pioneered many ideas in computer science, including tree data structures, automatic storage management, dynamic typing, conditionals, higher-order functions, recursion, and the self-hosting compiler. [source: wikipedia]

What is Haskell?

It is a general purpose language that can be used in any domain and use case, it is ideally suited for proprietary business logic and data analysis, fast prototyping and enhancing existing software environments with correct code, performance and scalability.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Clojure?
What companies use Common Lisp?
What companies use Haskell?

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Clojure?
What tools integrate with Common Lisp?
What tools integrate with Haskell?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

GitHubGitPython+22
17
14432
GitHubGitDocker+34
29
42960
What are some alternatives to Clojure, Common Lisp, and Haskell?
Scala
Scala is an acronym for “Scalable Language”. This means that Scala grows with you. You can play with it by typing one-line expressions and observing the results. But you can also rely on it for large mission critical systems, as many companies, including Twitter, LinkedIn, or Intel do. To some, Scala feels like a scripting language. Its syntax is concise and low ceremony; its types get out of the way because the compiler can infer them.
Elixir
Elixir leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems, while also being successfully used in web development and the embedded software domain.
Julia
Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library.
Erlang
Some of Erlang's uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance. OTP is set of Erlang libraries and design principles providing middle-ware to develop these systems.
Golang
Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.
See all alternatives