Get Advice Icon

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

Erlang

1.3K
748
+ 1
345
Perl

3.5K
934
+ 1
575
Add tool

Erlang vs Perl: What are the differences?

Introduction

Erlang and Perl are both popular programming languages, but they have distinct differences in terms of design philosophy, syntax, and purpose. This article will highlight the key differences between Erlang and Perl.

  1. Concurrency and Parallelism: Erlang is designed for building highly concurrent and fault-tolerant systems, utilizing lightweight processes (also known as "actors") and message passing. It excels in handling massive concurrency and can handle millions of processes simultaneously. In contrast, Perl does not have built-in concurrency mechanisms like Erlang and is generally used for scripting and text processing tasks, where parallelism is not a primary concern.

  2. Syntax and Expressiveness: Erlang has a unique, functional programming-based syntax that emphasizes pattern matching and immutability. It has a simple and consistent syntax, which makes it easy to learn and read. Perl, on the other hand, has a more traditional syntax influenced by C and other scripting languages. Perl's syntax allows for more flexibility and expressiveness, enabling developers to write concise, powerful scripts.

  3. Regular Expressions: Perl is famous for its extensive support for regular expressions. It provides powerful built-in features for pattern matching and text manipulation, making it well-suited for tasks that involve complex string processing. While Erlang also supports regular expressions, it does not have the same level of built-in functionality as Perl.

  4. Scalability: Erlang is known for its ability to scale horizontally, making it ideal for distributed systems and telecommunication applications. It provides built-in features for distribution and fault tolerance, such as automatic process migration and hot code reloading. Perl, on the other hand, is not specifically designed for massive scalability and may not be the best choice for building large-scale distributed systems.

  5. Community and Libraries: Perl has a large and active community that has developed a vast array of libraries and modules. These libraries provide extensive functionality and cover a wide range of domains, making Perl a versatile language for various tasks. While Erlang also has a community and ecosystem of libraries, it may not have the same level of breadth and maturity as Perl's.

  6. Industry Adoption: Perl has had a long history and is widely adopted in various domains, particularly in the field of system administration and web development. It has a significant codebase and is supported by a large number of developers. Erlang, on the other hand, has gained popularity in specific niches, such as the telecommunication industry and the development of highly available and fault-tolerant systems.

In summary, Erlang and Perl differ in their approach to concurrency, syntax, regular expression support, scalability, community and library ecosystems, and industry adoption. While Erlang excels in highly concurrent and fault-tolerant systems, Perl is renowned for its text processing capabilities and extensive community support.

Advice on Erlang and Perl
Needs advice
on
GolangGolangPerlPerl
and
RustRust

I intend to use a programming language which I'll use as AWS runtime and write a script that will comb through tons of files in a directory and its subdirectories and search for simple text regular expressions and process and write the matches in a file as output. I have heard that Perl is good for regex based search but I also want the performance to be good as it will have to go through tons of files for IO. In this post: https://filia-aleks.medium.com/aws-lambda-battle-2021-performance-comparison-for-all-languages-c1b441005fd1, I see that Rust works well as AWS Lambda runtime with very good performance. Which one should I choose as my AWS lambda runtime for this problem? Golang is also an option as it is fast as per the above link.

See more
Replies (1)
Recommends

I used to work in a Perl shop and must admit that the language is very simple for tasks like these, but as you mentioned it's not fast at execution time. I'm now a Go programmer professionally but I taught myself the language while in college purely out of interest and eventually found my way to the job, not the other way around. I've recently been learning a little rust because of how much that language comes up in conversations around Go. I find the concept of the borrow checker nice but I have to admit I feel lost like I am in most flavors of new fancy framework js. That's not to say Rust is really anything like js, but the learning appears the same to me as someone who's convinced they could learn just about any programming language if it was necessary (over time I've seen procedural, OOP, declarative and functional stuff but never programming logic outside of the prolog code I wrote in school).

Go isn't made for your specific task at hand but it's a very easy language to pick up and it has good directory traversal standard library code and good regex (even though with time perl's has been optimized to be faster and I think it's written in C++) but more than anything Go is "cloud native" programming in that an awful lot of new microservice tech stacks are centered around it, docker and kubernetes are written in it, and there's a thriving community whose focus is generally web-first and performance-oriented. This means for your use case there might already be a large cohort of gophers that have asked the stackoverflow questions for you

I personally would push you towards the NYT Profiler for Perl before I would towards Rest, but that's because I know you wouldn't waste any time being able to get to the task at hand and then make it go faster, and I expect all but a few rustaceans would be able to do so with the same speed.

Whatever you pick I wish you the very best of luck!

See more
Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of Erlang
Pros of Perl
  • 62
    Real time, distributed applications
  • 62
    Concurrency Support
  • 58
    Fault tolerance
  • 36
    Soft real-time
  • 32
    Open source
  • 22
    Message passing
  • 22
    Functional programming
  • 16
    Immutable data
  • 14
    Works as expected
  • 6
    Facebook chat uses it at backend
  • 5
    Practical
  • 5
    Knowledgeable community
  • 4
    Bullets included
  • 1
    WhatsApp uses it at backend
  • 72
    Lots of libraries
  • 66
    Open source
  • 61
    Text processing
  • 54
    Powerful
  • 49
    Unix-style
  • 47
    Regex
  • 37
    Stable
  • 32
    Concise syntax
  • 29
    Hackerish
  • 22
    Easy to use
  • 16
    Swiss army chainsaw
  • 13
    Code Less Do More
  • 12
    CPAN
  • 9
    Freedom
  • 8
    All purpose
  • 5
    Readability
  • 5
    Familiar
  • 5
    Many ways to do it
  • 5
    Community
  • 4
    Object-Oriented
  • 4
    Modular
  • 4
    Smart (does alot for you)
  • 3
    Postmodern
  • 3
    It's the best one-off task language
  • 2
    For a man
  • 2
    Good man pages
  • 1
    Auto case variables
  • 1
    Single Source Library (CPAN)
  • 1
    Multi-threaded support
  • 1
    Multiparadigm
  • 1
    C-style
  • 1
    Hashes

Sign up to add or upvote prosMake informed product decisions

Cons of Erlang
Cons of Perl
  • 1
    Languange is not popular demand
  • 4
    Messy $/@/% syntax
  • 3
    No exception handling
  • 2
    Bad OO support
  • 2
    "1;"
  • 2
    No OS threads
  • 1
    Variables are global by default
  • 1
    Copy-on-create for interpreter-based threads
  • 1
    Barewords
  • 1
    Errors/warnings are ignored by default

Sign up to add or upvote consMake informed product decisions

2K
2.8K
9.7K
2.2K
13.4K
68.1K

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.

What is Perl?

Perl is a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming, GUI development, and more.

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

What companies use Erlang?
What companies use Perl?
Manage your open source components, licenses, and vulnerabilities
Learn More

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

What tools integrate with Erlang?
What tools integrate with Perl?

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

Blog Posts

What are some alternatives to Erlang and Perl?
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.
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.
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.
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.
Akka
Akka is a toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM.
See all alternatives