Earlier quoted context omitted.
>There was no such thing as just writing f(a,b) to call a function. You had to use something called "$@" or whatever Just so it's clear, you do call a function in that way... some_function($a,$b). It's how the function gets a hold of those arguments that you're talking about..the args are in an array called @_, like: sub some_function { ($first_arg,$second_arg)=@_; } And, like most things in Perl, there's lots of dif…
Having a lot of different bad ways of dealing with something is not an excuse for not having a single good way of dealing with something, which is kind of the point about why Perl has failed as a programming language.
Ask HN:Why is Perl so dwarfed in data science by Python?
71–80 of 120 posts
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#72Not much more than an anecdote, but I found working with julia quite a lot of fun. It was not data science, but since julia is more or less aimed at data science, I'd predict that my positive experience means julia is a very good choice there too. There is the "time to first plot" issue, and I found that the "efficient as C, easy as Python" motto really means "efficient as C XOR easy as Python", but all in all, it's…
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#73Because no one wants to write Perl ? Also because Python is readable by most software engineers and data scientists, unlike R.
I don’t mind writing Perl, reading Perl is what actually scares me.
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#74Python is not a good language for low-level numerics like FORTRAN, but it has good facilities to make foreign language libraries (written in C, FORTRAN, CUDA, etc.) that do high-level operations. There is not just the foreign function interface but also the operator overloading that makes it possible to write something like dataframe["A"] + dataframe["B"] and get a Series. You can make things that look like numbers o…
Perl 6 (Raku) is effectively a different language. Porting from 5 to 6 would change most lines of code, in other words, a complete rewrite. To ease transition, Perl 6 made it so that both could coexist, but if you want to go v6, then it is all or nothing.
Python 2 and 3 are not that different. You can easily write code that is compatible in both, and porting is often not much more than using 2to3.py most of it is replacing "print" with "print()" and converting between bytes and str.
Perl strategy was that to create a modern language inspired by Perl, in indeed, Perl 6 has quite a few features ahead of its time. And Raku (the new name for Perl 6) is still one of the most advanced language today.
Python strategy was to keep the same language but address a few pain points that require breaking compatibility, Unicode in particular.
Perl 6 took a much bigger gamble.
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#75What? No it isn't
.
> how come Perl lags far behind
Because nobody wants to use it, same reason it lags far behind in literally every other field in programming, too
If you actually want to understand this, learn why CGI doesn't point at Perl anymore. That was its last real stronghold.
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#76Because no one wants to write Perl ? Also because Python is readable by most software engineers and data scientists, unlike R.
Exploring Bioperl for genetics leads to several big rewards, but you need to want to take the extra-mile and doing it. And is not easy. In the same way as exploring R in the past where none used it, was definitely benefical to me. R is awesome.
All is readable if you find the correct people able to read it. People at the university just keep using the same as their boss so you really can't always choose. Maybe Perl wizards were highly sough and didn't remained in the university. Maybe is just a question of different generations of programmers and Perl is a little older. Dunno.
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#77Earlier quoted context omitted.
Readability is really a weak argument. I've seen a lot of unreadable code written by data scientist in Python. And a lot of readable Perl code. It's not about the language, it's about the best practices. The concept behind sigils is very simple and once you've learned it, it's not that threatening. And when talking about data structures, it is a benefit to have it more structured and know that you are dealing with an…
> Readability is really a weak argument. I vehemently disagree. When choosing among languages today, performance is mostly good enough across all languages and readability becomes the most important consideration. It's "subjective", but human beings are subjects, and subjective things are important to them. > I've seen a lot of unreadable code written by data scientist in Python. And a lot of readable Perl code. It's…
I absolutely agree that readability is most important consideration. I just disagree that it depends on the language. As said before, there is a lot of write-only code written by data scientists in Python.
> Well sorry, but I don't want to get used to your favorite language's line noise. That's why I choose another language. That's why everyone else chooses another language.
You don't have to. It's called a programming language paradigm, not noise. You either learn it or not when studying a language. If you want to understand something without studying it, it's your choice. I am proficient in both of these languages and can see the strengths and weaknesses in both of them.
> Those libraries were developed in Python because the authors of those libraries preferred to work in Python. The authors preferred to work in Python because of the legibility considerations I've already mentioned.
Perl was extensively used by scientific community, but Python was the lucky one that was backed by Google in 2005. And that's ok. It is better than Perl for data science now, but not because of its syntax :)
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#78What is PERLs version of numpy?
Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#79Re: Ask HN:Why is Perl so dwarfed in data science by Python?
#80I do love Perl. However, for data science, the biggest drawback vs Python is how you work with complex data structures. Because everything in Python is an object, (de)referencing things is generally straightforward, like: somelist[12]['whatever']="abc" mylen=len(somelist) Where Perl devolves into a mess of sigils, when to use $ vs % vs @, wrapping references with {}, etc. $somelist[12]{'whatever'}="abc"; $mylen=lengt…
print(f"it turns out that {TV[family]['lead']} has ", end=‘’)
print(len(TV[family]['kids']), " kids named ", end='')
print(*[kid.name for kid in TV[family]['kids']], sep=', ')
For me, it was the culture “there is _one_ obvious (for a Dutch) way to do it” vs. “many” in Perl and most people lack discipline/good taste to handle the [too much] freedom provided by Perl.Somehow Python took the niche of “executable pseudocode”, “glue language” for me.