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

Clojure

1.9K
1.4K
+ 1
1.1K
C++

16.9K
9.1K
+ 1
845
Erlang

1.3K
739
+ 1
327

C++ vs Clojure vs Erlang: What are the differences?


## Key Differences between C++ and Clojure and Erlang

1. **Syntax**: C++ is a statically typed language with a syntax influenced by C, while Clojure is a dynamically typed language that runs on the JVM and Erlang is a functional programming language designed for concurrency.
2. **Concurrency**: Clojure and Erlang are built with concurrency in mind, featuring immutable data structures and mechanisms for handling concurrent processes, whereas C++ traditionally relies on libraries like std::thread for concurrency support.
3. **Memory Management**: C++ requires manual memory management, leading to potential memory leaks and segmentation faults, while Clojure and Erlang have automatic garbage collection, resulting in more stable and reliable memory management.
4. **Object-Oriented Programming**: C++ is primarily an object-oriented language that supports classes and inheritance, Clojure is a functional language focusing on immutability and pure functions, and Erlang is a concurrent, functional language with lightweight processes for scalability.
5. **Community and Ecosystem**: C++ has a large and mature ecosystem with extensive libraries and tooling support, whereas Clojure and Erlang have smaller communities but are known for their active and passionate developer base focused on functional programming paradigms and tooling specific to their ecosystems.
6. **Compilation and Deployment**: C++ code is typically compiled into machine code for specific platforms, while Clojure and Erlang are often deployed as bytecode on virtual machines, allowing for portability and flexibility across different environments.

In Summary, C++, Clojure, and Erlang differ in syntax, concurrency support, memory management, programming paradigms, community ecosystems, and compilation practices.
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Clojure
Pros of C++
Pros of Erlang
  • 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
  • 202
    Performance
  • 106
    Control over memory allocation
  • 97
    Cross-platform
  • 96
    Fast
  • 84
    Object oriented
  • 57
    Industry standard
  • 47
    Smart pointers
  • 37
    Templates
  • 16
    Gui toolkits
  • 16
    Raii
  • 13
    Generic programming
  • 13
    Control
  • 13
    Flexibility
  • 11
    Metaprogramming
  • 9
    Hardcore
  • 5
    Simple
  • 5
    Full-fledged containers/collections API
  • 5
    Many large libraries
  • 4
    Performant multi-paradigm language
  • 4
    Large number of Libraries
  • 3
    Way too complicated
  • 1
    Close to Reality
  • 1
    Plenty of useful features
  • 60
    Concurrency Support
  • 60
    Real time, distributed applications
  • 56
    Fault tolerance
  • 35
    Soft real-time
  • 31
    Open source
  • 21
    Functional programming
  • 20
    Message passing
  • 15
    Immutable data
  • 13
    Works as expected
  • 5
    Facebook chat uses it at backend
  • 4
    Practical
  • 4
    Knowledgeable community
  • 3
    Bullets included

Sign up to add or upvote prosMake informed product decisions

Cons of Clojure
Cons of C++
Cons of Erlang
  • 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
  • 8
    Slow compilation
  • 8
    Unsafe
  • 6
    Over-complicated
  • 6
    Fragile ABI
  • 5
    No standard/mainstream dependency management
  • 4
    Templates mess with compilation units
  • 3
    Too low level for most tasks
  • 1
    Compile time features are a mess
  • 1
    Template metaprogramming is insane
  • 1
    Segfaults
  • 1
    Unreal engine
    Be the first to leave a con

    Sign up to add or upvote consMake informed product decisions

    - 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 C++?

    C++ compiles directly to a machine's native code, allowing it to be one of the fastest languages in the world, if optimized.

    What is 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.

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

    What companies use Clojure?
    What companies use C++?
    What companies use Erlang?

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

    What tools integrate with Clojure?
    What tools integrate with C++?
    What tools integrate with Erlang?

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

    Blog Posts

    May 6 2020 at 6:34AM

    Pinterest

    JavaScriptC++Varnish+6
    5
    3365
    Oct 24 2019 at 7:43PM

    AppSignal

    JavaScriptNode.jsJava+8
    5
    954
    GitHubGitPython+22
    17
    14208
    GitHubGitDocker+34
    29
    42438
    GitHubSlackNGINX+15
    28
    20915
    What are some alternatives to Clojure, C++, and Erlang?
    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.
    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.
    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]
    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.
    See all alternatives