Need advice about which tool to choose?Ask the StackShare community!
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 MorePros of Clojure
Pros of C++
Pros of Erlang
Pros of Clojure
- It is a lisp117
- Persistent data structures100
- Concise syntax100
- jvm-based language90
- Concurrency89
- Interactive repl81
- Code is data76
- Open source61
- Lazy data structures61
- Macros57
- Functional49
- Simplistic23
- Immutable by default22
- Excellent collections20
- Fast-growing community19
- Multiple host languages15
- Simple (not easy!)15
- Practical Lisp15
- Because it's really fun to use10
- Addictive10
- Community9
- Web friendly9
- Rapid development9
- It creates Reusable code9
- Minimalist8
- Programmable programming language6
- Java interop6
- Regained interest in programming5
- Compiles to JavaScript4
- Share a lot of code with clojurescript/use on frontend3
- EDN3
- Clojurescript1
Pros of C++
- Performance202
- Control over memory allocation106
- Cross-platform97
- Fast96
- Object oriented84
- Industry standard57
- Smart pointers47
- Templates37
- Gui toolkits16
- Raii16
- Generic programming13
- Control13
- Flexibility13
- Metaprogramming11
- Hardcore9
- Simple5
- Full-fledged containers/collections API5
- Many large libraries5
- Performant multi-paradigm language4
- Large number of Libraries4
- Way too complicated3
- Close to Reality1
- Plenty of useful features1
Pros of Erlang
- Concurrency Support60
- Real time, distributed applications60
- Fault tolerance56
- Soft real-time35
- Open source31
- Functional programming21
- Message passing20
- Immutable data15
- Works as expected13
- Facebook chat uses it at backend5
- Practical4
- Knowledgeable community4
- Bullets included3
Sign up to add or upvote prosMake informed product decisions
Cons of Clojure
Cons of C++
Cons of Erlang
Cons of Clojure
- Cryptic stacktraces11
- Need to wrap basically every java lib5
- Toxic community4
- Good code heavily relies on local conventions3
- Tonns of abandonware3
- Slow application startup3
- Usable only with REPL1
- Hiring issues1
- It's a lisp1
- Bad documented libs1
- Macros are overused by devs1
- Tricky profiling1
- IDE with high learning curve1
- Configuration bolierplate1
- Conservative community1
- Have no good and fast fmt0
Cons of C++
- Slow compilation8
- Unsafe8
- Over-complicated6
- Fragile ABI6
- No standard/mainstream dependency management5
- Templates mess with compilation units4
- Too low level for most tasks3
- Compile time features are a mess1
- Template metaprogramming is insane1
- Segfaults1
- Unreal engine1
Cons of Erlang
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!
Jobs that mention Clojure, C++, and Erlang as a desired skillset
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?
What tools integrate with Clojure?
What tools integrate with Erlang?
Sign up to get full access to all the tool integrationsMake informed product decisions
Blog Posts
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.