[HN Gopher] Scientific Computing with Perl
___________________________________________________________________
Scientific Computing with Perl
Author : smartmic
Score : 68 points
Date : 2021-06-08 19:24 UTC (3 hours ago)
(HTM) web link (pdl.perl.org)
(TXT) w3m dump (pdl.perl.org)
| denimboy wrote:
| See also integration between PDL and MXNet deep learning
| framework:
| https://mxnet.apache.org/versions/1.8.0/api/perl
| psychometry wrote:
| Please don't. Most of the Python/R/C code I've seen from
| scientists was terrible. 100% of the Perl code was, though.
| codezero wrote:
| Wow what a throwback. I used IDL when I worked in astrophysics,
| and I loved it. It had a lot of fun capabilities and was super
| easy to build C libraries for.
|
| Back then there was also an attempt at making GDL (gnu data
| language), but the tooling for IDL was so deep I doubt anything
| can directly replace it. Then again I've been out of this for
| twelve years.
| aduitsis wrote:
| I can see in the page that last PDL release was on February,
| okay. Probably the presence of activity indicates that there are
| people using PDL, and more than that, maintaining it. Since PDL
| existed for many years, I would speculate that these people
| presumably didn't jump into PDL yesterday. There can very well be
| large codebases using it for a long time.
|
| All the comments suggesting that this somehow shouldn't be and
| that people should move away from PDL, are depressing in the way
| that, in a split second, years of effort and thousands lines of
| code that are probably doing good work are dismissed just like
| that.
|
| If a bank is still using Cobol, it is interesting and a testament
| to how a Cobol programmer can still make a good living on it. But
| if a scientist is using Perl to carry out calculations, this is
| somehow bad?
| MontyCarloHall wrote:
| > If a bank is still using Cobol, it is interesting and a
| testament to how a Cobol programmer can still make a good
| living on it. But if a scientist is using Perl to carry out
| calculations, this is somehow bad?
|
| Yes. The negative externalities of doing scientific analyses in
| Perl are much greater than a bank having a legacy COBOL
| codebase. Only a handful of engineers within the bank will ever
| see that COBOL codebase. Science is globally collaborative;
| many people at many different institutions across the world
| would have to deal with some idiosyncratic scientist's decision
| to write their analysis in Perl.
|
| Also, the bank only has a COBOL codebase because it's reluctant
| to make major changes to an extremely important system that's
| been working flawlessly since the early 60s. There's absolutely
| no reason to start a totally brand new project in Perl (or
| COBOL, for that matter), when far superior alternatives exist.
| caslon wrote:
| Perl is shipped in virtually every Linux distribution; it's
| much closer to standard than, say, Node.
| pklausler wrote:
| Or Fortran, ironically.
| caslon wrote:
| This is mostly because of the compiler situation. Intel
| forbids redistribution of theirs, and GNU's isn't up to
| snuff, which continues to handicap the language.
| MontyCarloHall wrote:
| So is ed. That doesn't mean it's a better coding
| environment than modern IDEs, even though it's far more
| "standard."
| caslon wrote:
| Actually, line editors are really nice, and UNIX arguably
| makes a better IDE than any purpose-specific one.
| stabbles wrote:
| It's unlikely to perform well, so it may not be the right tool
| for the job.
| natch wrote:
| Can't speak to this library but in general Perl stands out as
| being extremely performant, if that is the goalpost you want
| to go with.
| pvaldes wrote:
| PDL was created to improve the perl performance when
| working with n-dimensional matrixes so should be even
| better than plain perl
| aduitsis wrote:
| Not at all, Perl is faster than Python. Largely due to Python
| not getting significantly faster I might add. This is
| supposed to change in the future, but here we are. But
| nobody's asking anyone to switch away from Python, right? So
| what if PDL or Perl or whatever was indeed slower?
| f6v wrote:
| Bioinformatics just finished transitioning from Perl to R and
| Python. The last thing I need is a Perl renaissance. Hope it
| never happens.
| 0xbadcafebee wrote:
| Please read this page first (and note the date):
| http://pdl.perl.org/?docs=Philosophy&title=PDL::Philosophy
| hoytech wrote:
| I really like PDL, even though I don't get to use it much
| anymore. Here's a fun application, FM radio demodulation in a
| page or so of pretty straightforward code:
|
| https://hoytech.com/talks/fm-demodulation
| anonu wrote:
| I think Perl missed the boat... too little way way too late.
|
| Also - they can't even get their SSL certs straight.
|
| I loved Perl - it was certainly my gateway to coding. Regex was
| beautiful in perl. But I shot myself in the foot so many times
| with that language.
| sega_sai wrote:
| I'm afraid this is ~ 10-15 years too late. I've used PDL somewhat
| in ~ 2005-2010 when python didn't have that many packages/numpy,
| and it did the job and could substitute IDL to some degree. But
| realistically, right now I don't see any reason to use PDL
| instead of Python.
| bjornjajayaja wrote:
| Meh... Python zealots abound. Folks often say the same thing
| about Fortran but frankly, those are the engines that power ALL
| scripting languages math features. You're running on
| C/C++/FORTRAN. If one needs better text-parsing features on top
| of that: use Perl; if you use a Python environment: use Python.
|
| Perl is superior in many ways and I think using it for data-
| exploration still has tons of merit.
|
| Folks "shoot themselves in the foot" when they don't understand
| the language. In Perls case: list/scalar context is usually the
| culprit, but it is quite easy to understand. It's more flexible
| and concise which in many ways makes Perl better at exploratory
| programming.
| sega_sai wrote:
| I (and many in science) switched from C/PDL/IDL to Python in
| last 10 years because it was is the best tool, not for
| zealotry.
|
| Python vs Perl for science has nothing to do with
| c/c++/fortran. C/C++/fortran have their own place for science
| computations. Perl does not. For anything involving any kind
| of numerics Python will be faster/better tested/will have
| more libraries/will have better visualisation capabilities,
| so there is no need for perl.
|
| Sure if you are _only_ working with strings, you can use
| perl, but that 's hardly scientific computing (not at least
| the field that I work in).
| 7thaccount wrote:
| The question isn't about Perl vs Python (which I still think
| is a clear winner for Python, although there are some uses
| where I could perfectly understand reaching for Perl first).
|
| The question is whether Perl's PDL is better than
| ScyPy/Numpy/Pandas/Cython, the Spyder IDE, bunch of plotting
| libraries...etc.
| mangecoeur wrote:
| People like other people using python because it makes it
| easier to share and exchange and built a community of
| knowledge and libraries. Science is a lot about ease of
| collaboration.
| pvaldes wrote:
| Is this true or is a belief?
|
| The fact is that most people don't even have an opinion
| about what is Python or Perl.
|
| Python can seem easy to share after you copy part of a
| python script and miss one blank space somewhere at the end
| of a line or start copying in the wrong line. If you use a
| dumb text editor the script will easily turn into a ugly
| mess. Perl scripts don't have this problem, so some people
| could say that they are easier to exchange and share in
| fact.
|
| Many Perl authors will be really glad to share your code
| with you. This is what they built an online community of
| knowledge and libraries called CPAN where you can find it
| easily. To find authors willing to help and explain obscure
| parts of their own scripts also if asked politely, is not
| uncommon or particularly difficult.
| dolodoot wrote:
| > right now I don't see any reason to use PDL instead of
| Python.
|
| I like python a lot and actually i wish less scientists used
| it. Perl/PDL is in my opinion much better suited to this
| (understandable) just getting the job done approach i often
| find in sciene or other areas in which writing software is not
| the primary goal.
| [deleted]
| adenozine wrote:
| As if research scientists' code wasn't unfun enough to read
| already!
| leephillips wrote:
| How interesting. I'm surprised that I'd never heard of this
| before.
| the_only_law wrote:
| I remember many years ago, outside programming I had a moderate
| interest in biology. I recall looking into bioinformatics, and
| reading about Python, but also about how popular Perl was in
| field. This was 5-10 years ago, though the sources I was
| reading very likely could have been 15 years old or more.
| pvaldes wrote:
| Perl has its own branch for bioinformatics. The Bioperl
| modules.
|
| https://bioperl.org/
| leephillips wrote:
| The first thing that occurs to me, and this may be
| superficial, is that bioinformatics has a linguistic
| character to it, with pattern matching of sequences and so
| forth, and this is something where Perl is more adept than
| most other languages.
| etangent wrote:
| your hunch is correct
| f6v wrote:
| Bioinformatics today is much more about complex statistical
| models applied to sequencing data. There's some pattern
| matching when doing low-level FASTQ processing for your
| fancy combinatorial barcoding. But other than that you need
| tools capable of processing huge datasets. Python ecosystem
| fits better in modern era.
| warlog wrote:
| Which .env fits better, exactly?
| gvurrdon wrote:
| Perl was extremely popular 20+ years ago in biology; I made
| the jump from the lab bench to bioinformatics with Perl and
| Bioperl (https://bioperl.org/). But, after a while I
| discovered Ruby, and later Python, and moved on, also
| switching to other fields. The presence of Perl and a
| "proper" terminal on Mac OS X back then was a big draw in
| encouraging bioinformaticians to use it (well, that is my
| recollection, anyway).
| kingaillas wrote:
| This tickled a memory... I remember seeing a Bioinformatics
| for Perl book ~20 years ago. I found it on O'reilly's
| website: https://www.oreilly.com/library/view/beginning-
| perl-for/0596...
|
| Searching more I see a Python one appears in 2009:
| https://www.oreilly.com/library/view/bioinformatics-
| programm...
|
| And now there are several out. Plus expanded topics like
| Python and Machine Learning, Python and Data Analysis, etc.
| flobosg wrote:
| Somewhat related, "How Perl Saved the Human Genome Project
| (1996)" :
| https://www.foo.be/docs/tpj/issues/vol1_2/tpj0102-0001.html
___________________________________________________________________
(page generated 2021-06-08 23:00 UTC)