3 ms·
I didn't downvote you, but I'd like to know what makes Perl a good option for embedded language and what implementations are available.
by Yaggo 9y ago
I didn't downvote you, but I'd like to know what makes Perl a good option for embedded language and what implementations are available.
- hnlmorg 9y agoLike with Python, Javascript, etc Perl has got a huge and collaborative eco-system (CPAN is the godfather (in terms of age) of npm / pip / et al). It's also terse enough that writing scripts doesn't become a bigger job than it needs to be. The language also offers better type safety than Javascript and most sysadmins are already proficient in Perl because, until recently, it used to be the goto scripting language for servers (these days it seems to be more Python) so Perl makes some sense for enterprise systems. There are big drawbacks for using Perl though. It's appallingly bad for writing OO code (objects in Perl are really just hashes / maps) so larger code bases or complex code can quickly become a pain to maintain. While it has one of the better approaches for comparing data of different types (imo), Perl still has more than it's fair share of hidden traps. Ultimately though, it's a better language than many give it credit for even if it is considered old fashioned these days. So if languages like Python and Javascript are to be considered then I think Perl deserves a mention as well. As for implementations, the standard Perl interpreter can be linked to which makes it very easy to embed into other programs.