Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Perl is used heavily in biology and bio informatics. It's also really really good for messing with text in complicated ways. And it's still in use as a web language. So that's three more use cases.

I think you can think of it this way. ANSI C doesn't have a built in linked list, or hash/dictionary, or line count when reading a file, or map or grep or a bunch of things... and you can implement them (though map/grep are a bit tricky) but you have to worry about the implementation, and matching other people's implementation. By having the many useful primitives Perl does, it provides a broader standard interface for doing things, and that makes hacking easier.

Perl tries to give you lots of tools to express yourself. If you are a wood carver, you know that you can work wood with very limited tools, but having the right tool in your shop makes things a lot easier and simpler for the expert. So it is with Perl.



yeah, i'm aware that perl is used by biologists, but the question is more like, "should perl be used by biologists?" no question that c is not a great choice, but what about python? or, hell, javascript, even? for the kind of programs biologists would want to write (i.e. programs that need to describe a system that performs several tasks rather than programs that need to perform one or two specific tasks), it'd be helpful to have a language that not only has data structures like arrays/lists and hashes/dictionaries but also a data model that includes things like classes as a primitive. python in particular has numpy/scipy.

perl's syntax for regexp matching definitely makes it a good choice for programs that have to do a lot of string-munging, but that's what i meant by "sys-admin-type stuff."


Classes are not primitives in either language... primitives contain a value instead of a reference. I think you mean that classes are first order, but I don't want to put words in your mouth so perhaps you can clarify what the difference you are pointing to.

I think, given that Perl is being used, the question might be, what features make javascript or Python a good reason to switch? I'd want to avoid losing features.

Perl is stable. Perl written two decades or more ago still runs fine in modern perl. That's important for data analysis, especially in the sciences.

I'll have to read up on Python ... I'd want a tie equivalent to be able to treat large files as if they were arrays/hashs (lists/dicts) without loading them into memory as such.


> I think you mean that classes are first order, but I don't want to put words in your mouth

please do. i'm a language user, not a designer.

> what features make javascript or Python a good reason to switch?

or, for a mostly-disinterested (in programming, i mean), entrenched group of users like biologists, this question becomes more like, "what features would necessitate a switch?" same question for plan 9 vs. linux or any technology that's trying to do a better job of filling a need that's already being met. ...and, of course, the answer is that there are none. perl has notions of object-oriented-ness. it's possible to build in your own type-checking. the backwards compatibility thing is definitely helpful for the sciences, and it's free, so, like the fortran routines that parts of numpy ultimately wrap, their code can live on.

i mentioned python and javascript not because i think they're such great languages but because i feel that they're in that position relative to perl. of course, unlike plan 9, python and javascript got a lot of users.

> treat large files as if they were arrays/hashs (lists/dicts) without loading them into memory as such.

not totally sure what you mean here. isn't that what databases are for?

anyway, for a new code base that's going to evolve a lot and possibly get scrapped entirely (i.e. most hn readers' situation), python is worth checking out.


In Perl you can do what numpy/scipy do with PDL, the Perl Data Language.

Perl is not just a string mangling language, it's a full-fledged generic programming language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: