Need advice about which tool to choose?Ask the StackShare community!
Common Lisp vs Perl: What are the differences?
Key Differences between Common Lisp and Perl
Perl and Common Lisp are two programming languages that have their own unique features and use cases. Here are six key differences between them:
1. Syntax: Common Lisp has a more traditional syntax with its focus on lists and parentheses, making it resemble a mathematical notation. On the other hand, Perl is known for its shorthand notation, using various special characters and symbols to accomplish tasks with concise code.
2. Paradigm: Common Lisp is primarily a functional programming language with support for imperative and object-oriented programming paradigms. Perl, on the other hand, is a highly flexible language that allows programmers to combine procedural, functional, and object-oriented styles as per their requirements.
3. Community and Libraries: Common Lisp has a smaller but dedicated community, with a focus on language standards and robust libraries for various purposes. Perl, on the other hand, has a larger user base and a wide range of libraries, making it suitable for a broad range of applications.
4. Expressiveness: Common Lisp provides a powerful macro system that allows users to extend the language with domain-specific abstractions, making it extremely expressive and customizable. In contrast, Perl is known for its built-in text manipulation capabilities and regular expression support, enabling rapid development for tasks involving parsing and data manipulation.
5. Language Stability: Common Lisp has a stable language specification and follows a more conservative approach to introducing new features. This stability can be advantageous for long-term projects with a need for compatibility. Perl, on the other hand, emphasizes flexibility and has a reputation for evolving quickly, introducing new features and improvements more frequently.
6. Use Cases: Common Lisp is often used for tasks that require complex programming logic, symbolic manipulation, artificial intelligence, and large-scale software development projects. Perl, on the other hand, has gained popularity for its ability to handle text processing, file manipulation, and system administration tasks in a concise and efficient manner.
In summary, the main differences between Common Lisp and Perl lie in their syntax, programming paradigms, community support, expressiveness, language stability, and use cases. These distinctions make them suitable for different types of projects and reflect the design philosophies of each language.
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.
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!
Pros of Common Lisp
- Flexibility24
- High-performance22
- Comfortable: garbage collection, closures, macros, REPL17
- Stable13
- Lisp12
- Code is data8
- Can integrate with C (via CFFI)6
- Multi paradigm6
- Lisp is fun5
- Macros4
- Easy Setup4
- Parentheses3
- Open source3
- Purelly functional3
- Elegant3
- DSLs1
- Multiple values1
- CLOS/MOP1
- Clean semantics1
- Will still be relevant 100 years from now1
- Still decades ahead of almost all programming languages1
- Best programming language1
- Simple syntax1
- Powerful1
- Generic functions1
- Can implement almost any feature as a library1
- Formal specification, multiple implementations1
Pros of Perl
- Lots of libraries72
- Open source66
- Text processing61
- Powerful54
- Unix-style49
- Regex47
- Stable37
- Concise syntax32
- Hackerish29
- Easy to use22
- Swiss army chainsaw16
- Code Less Do More13
- CPAN12
- Freedom9
- All purpose8
- Readability5
- Familiar5
- Many ways to do it5
- Community5
- Object-Oriented4
- Modular4
- Smart (does alot for you)4
- Postmodern3
- It's the best one-off task language3
- For a man2
- Good man pages2
- Auto case variables1
- Single Source Library (CPAN)1
- Multi-threaded support1
- Multiparadigm1
- C-style1
- Hashes1
Sign up to add or upvote prosMake informed product decisions
Cons of Common Lisp
- Too many Parentheses4
- Standard did not evolve since 19943
- Small library ecosystem2
- No hygienic macros2
- Inadequate community infrastructure1
- Ultra-conservative community1
Cons of Perl
- Messy $/@/% syntax4
- No exception handling3
- Bad OO support2
- "1;"2
- No OS threads2
- Variables are global by default1
- Copy-on-create for interpreter-based threads1
- Barewords1
- Errors/warnings are ignored by default1