Why Perl Didn't Win(outspeaking.com) |
Why Perl Didn't Win(outspeaking.com) |
I started on Perl 4 in the mid-1990s. It was fantastic! I started replacing thousand-line C programs with hundred-line Perl programs that were more robust and worked better, and replacing shell scripts made of awkward sed/awk pipelines with neat, tight Perl. Arrays and hashes as first class data structures? Marvelous!
Then Perl 5 ruined it all. The ridiculous, bloated "object oriented" syntax rendered it basically unreadable, without adding much useful functionality. The layers of syntax options forced teamwork-driven Perl (I wrote about 10k lines of it) to pay close attention to coding standards, closer than more consistent languages, just to not step on each other or have fights.
Then along came Python and Ruby, which shared most of the benefits of Perl (scripting, mostly), but added very clean, elegant OO syntax. Everyone who actually cared about writing decent OO scripts switched. Plus Python had much better math libs, and Ruby soon had Rails.
And Perl 6? Fourteen years and nothing to show for it, and it'll have to be backwards compatible to all the things violently wrong with Perl 5. There's no use case that isn't already covered by Python and Ruby. Unless some new technology comes along and Perl jumps in firstest with mostest (like Ruby did with Rails), no one will really care.
The average age of Perl programmers has been increasing by about one year per year since 2002 or so. I don't see that changing anytime soon.
... except a nearly feature-complete [1] compiler [2] and an impressive test suite [3]
[1] http://perl6.org/compilers/features [2] http://rakudo.org/ [3] https://github.com/perl6/roast/
> and it'll have to be backwards compatible to all the things violently wrong with Perl 5
Not at all. The whole point about Perl 6 is that it breaks backwards compatibility to fix the things that are wrong with Perl 5.
I think this is is a contributor to why Perl 6 will never amount to anything. That boat has sailed. Python 3 broke backwards compatibility and to my knowledge everybody is still using Python 2. Python has a lot of energy right now, so that might save it, or it might go the way of Perl when the next cool language comes out and everybody jumps ship.
There are still a lot of problems in the Perl 4 space and to be honest I wish that distributions shipped with a supported version of 4.036.
There are also some features that were eventually removed from Perl5, but not really. For example setting $[ was removed (it was a pretty stupid idea), but if you try to use it Perl loads the module arybase which re-implements that feature. (removing it simplified the internals)
PHP was much more friendly towards new programmers than Perl 5, it was so much easier to make simple web pages. So it took over. It didn't matter that Perl 5 was more advanced.
(oh, you uploaded module to same dir and didn't remember to add something to @INC)
I don't think that's the case. The problem is that the generation of tools that have stuff in common with perl (awk, sed, shell) are completely unfamiliar to programmers which started programming in the last 15 years, compared to those that started 30 years ago.
* Perl 6: almost everyone is on Perl 5, or switched to another language
* Python 3: many libraries and devs will stick with Python 2, several devs switched to Go
* PHP 6: unicode rewrite never released, new features backported to 5.3+, several books were published in advance with PHP 6 in the title, next release will be named PHP 7 to avoid confusion
* Lua 5.2+: half of the community stuck with 5.1 as supported with LuaJIT and is many applications (World of Warcraft, Photoshop Lightroom, Facebooks AI platform, etc.)
* VB.Net: many stick with VB 6, many switched to web development
* VBA.Net: everyone still use VBA 6/7 in various Office applications
* ASP.Net: many stuck with ASP coded in VBS/JS, many switched to similar platforms e.g. PHP
The opposite:
* Node.js: it seems many consider the io.js fork based on up-to-date v8 js engine with ES6 support (nodejs 0.11/12 branch fork) and may leave the old nodejs 0.10.x behind
Now that I think about it, not even that big projects, teams of 10 or so devs, getting bogged down in language issues that Python simply didn't have (and no one even wished for tool support for, the was no need!)
Yes, I'm talking about Java. It's easy to hate now, but Java back then replaced all the server-side Perl programming that I did in the space of about 3 years, from 1994 where CGI programming was king to 1995 and the applets craze to 1999 when I was still regularly having conversations with people about the benefits of Java vs Perl to 2001 when you were actively hurting your career by not learning Java (not least because it seemed like the only people hiring were doing enterprise Java with horrible things like EJB and CMP/BMP).
Why did Java beat Perl? Well, there's a lot to that -- but at least part of it has to do with that fact that Java was simpler and didn't have nearly as many tricks up its sleeves (also known as the write-only problem). This is similar to the argument people today make when picking Go over other options like Scala. I also don't think it hurt that Java came out of Sun, which on the one hand was extremely influential because they sold the hardware everyone with money used, but on the other wasn't influential at all because they were "big iron" to the web's "why would I buy a Sparcstation when I can just put a PC under my desk?"
Fundamentally, though, Java was very successful at becoming the language you wrote code in if you wanted to be taken seriously as a software engineer building web applications and you didn't already have 5+ years of C++ experience. Perl programmers didn't get the same respect, and so Perl died.
My employer produced an amazingly popular perl-based web application, using flat files for data storage because so few shared hosts had DBI and DBD::mysql installed. It's some gloriously horrible code. They did a ground-up rewrite and then hired me to maintain it, right as PHP was becoming popular.
They refused to do a PHP version until it was too late. Someone else translated our code into PHP, then rewrote it a few times before releasing it. Over just a year or two, our marketshare plummeted, and now the UBB is a distant memory. We couldn't deliver a competing product.
Even if perl hadn't lost the deployability battle, the perl 6 fiasco was what let python and company eat away at the mindshare that wasn't concerned with just web applications.
That's not to say Perl 6 wasn't needed. Among programming languages Perl was probably my first love, especially the linguistics tie-ins with $ @ % etc, but write-only was a real problem, and people were moving to Python on the one hand and Java on the other. Maybe PHP killed Perl for low-end cheap hosting, but for larger projects, among people who would never have considered PHP, it lost because picking it seemed irresponsible.
At least there are people maintaining Perl 5 at this point.
I can't help but think that we'll eventually be seeing "Why Python3 Didn't Win". Perl and Python both foolishly abdicated the throne. While shots are fired, I think Python3 could still recover with more compromises from its 'leadership'.
I've come to realize years after that Perl is simply difficult to learn, lots of little things to memorize. Its community took pride in language arcana. Things that are now simple in other languages are unbelievably difficult in Perl, like "hashes of arrays of hashes" and things like that.
On top of that, it's also difficult to read. No wonder Perl is losing, and to me the faster the world is cleanup from that, the better.
If you read Ovid's Beginning Perl, or chromatic's Modern Perl, you'll find they managed to explain the concepts very easily.
You have to evolve to survive. If you don't don't you may stay alive for a while. But you will die slowly.
> The implications for a programming language are difficult to prove conclusively, but simple to explain: an ecosystem focused more on maintaining existing projects than creating new projects will be less attractive for new projects.
Ruby/Rails provides an interesting example here. The ruby and rails community ecosystem (the author is right it's about "ecosystem" more than the language) -- has, in general, done it's best to focus as much as possible on innovation over stability. That is, has tried to choose focus on creating new projects over support for existing projects.
Much to the frustration of some in the ruby ecosystem with existing projects to support.
(Rails, of course, from one perspective is an existing project; from another is a framework, which has generally over it's history cared more about new projects that will be created with Rails than existing projects built on Rails that need to be supported).
Of course, there still are existing projects, and there are still developers participating in the ecosystem who need to support those existing projects. So you can only go so far.
What has this done for ruby/rails ecosystem? Hard to say. Overall it's been successful, but it still can't make the ecosystem as greenfield as a true greenfield ecosystem, which is perhaps why some are leaving ruby/rails for greener pastures -- more than any qualities of ruby as a language, it's just the opportunity to be in a greenfield ecosystem that is attractive, perhaps.
PHP, on the other hand, handled the PHP 6 "failure" relatively gracefully. There was a bit of stagnation in the days of PHP 5.2 when the devs devoted too much energy to PHP 6 and not enough on improving the current version. But soon, PHP 6 was put on hold and some of its better parts began to be ported to PHP 5. Thanks to this decision, PHP has improved by leaps and bounds since 5.3. Also thanks to the lessons learned, nobody is particularly worried about any breaking changes in PHP for the foreseeable future. Everyone knows that any script that works in PHP 5.6 will probably work just fine in 7.0, so new projects continue to be written in PHP. This peace of mind is very important for languages that carry a lot of legacy baggage.
If there's anything for other languages to learn from PHP, it would be their graceful handling of PHP 6 -> 5.3~5.6. The syntax is still terrible, and the default behavior remains borderline insane, but PHP since 2009 has been an exemplar of how a widely used scripting language should handle new versions.
When I converted a perl script to python and saved 50% LOC I didn't know which version of which I was using. Am only vaguely aware of the Python 2.x vs. 3 issues. Never was aware of Perl 5 vs. 6.
When Python and Ruby fade, I look forward to the hand wringing about how version whatever didn't get pushed out fast enough. But that won't be the reason.
This is the way I see it. Perl5 is still being actively developed, perl6 is coming along nicely, cpan more awesome than ever, and there's still work for a perl dev.
If everyone was using the same language, then we'd all suffer because no one would be getting the new ideas.
Competition keeps things healthy.
Maybe it didn't win because the language syntax was just a mess, and same variables just in different contexts could mean like 3 different things depending on what way you pass them, what you you return them and what kind of random character is in front of them.
Don't take this personally, just ranting out my feelings for the Perl programming language, and glad that it isn't one of the things I have to know anymore! Good riddance!
Allison Randal wrote on the death of Perl a while back and had some observations worth nothing to understand how it fell: http://allisonrandal.com/2013/03/31/mythbusters-why-i-still-...
I really liked working with Modern Perl, but rarely do anymore mostly since "nobody uses Perl" kills any suggestion even when it might be the right tool for the job. Ruby has become Perl 6 for me.
while I don't do anything with it today, I do know Perl/6 would be in contention for my 'deserted island' language of choice.
yet another dph
Python? Very popular. Solid language. Probably at some point more adopted than Perl, but not so much so that I can say it "won", partially because of how this list goes on.
Ruby? Same.
PHP? Maybe in the web space but not in general.
Javascript? Even in light of Node, this is still a marginal language out of the browser, especially considered over the past 15 years.
Lua? No.
Perl may not have "won" but it has hardly "lost", and now IMHO the sun is just beginning to set on this entire catagory of 1990s-style dynamic scripting language and there probably will be no further "winner" in this space.
http://programming.tudorconstantin.com/2015/01/perl-already-...
That's a strong statement. Are you quite sure those are the only two possibilities?
> They're going to merge Perl 5.12 and Perl 6
in "mid-2001" to:
> There's a Perl 5.8 on the way
in 2002. ^_~
That said, I think that anyone doing serious Perl 5.x work has long since abandoned the idea that Perl 6 has anything to do with Perl 5.x other than sharing the "Perl" name and Larry Wall. Maybe this is confusing to "outsiders" and the branding needs to change? It's not like the Perl 5.x line is not being maintained. Since Perl 5.10, there were some significant improvements, with consistent point releases coming out.
I think you might mean "unknown" rather than "moribund", but just in case: no it wasn't, it was quite successful, RAA wasn't CPAN but was quite rich, there were steady improvements to the language and the community outside japan was growing (i.e. most of the european ruby user groups started before ruby on rails). It was just growing slowly, rather than skyrocketing.
I feel Perl does not deserve to be mentioned in a hero's tale. There's been too much rankling and nincompoopery out of perl's characters given the size of that community. Far, FAR too much griping. Perl is a bummer, and that is why it did not win.
My philosophy is: live the life of a champion - overcome and be a shining light for others. Your war stories should be mostly glorious victories, no matter how mundane the battles or battlefields were.
There's a wrinkle, too. Perl isn't just a web thing. It was (and is) still used in "enterprise" spaces for scripting on servers. It's still out there being used to create scripts rather than applications. In that space Ruby/Python are competing, but there's still plenty of sysadmins who use Perl since it works.
I don't know how it looks now, but if you login into the likes of HP-UX, Aix, Solaris and so on, usually only Perl is available.
This is what made me learn Perl, back when I was mostly into Python (.com days).
On people picking up Go over other options, well that's because people never learn and we are bound to propel shitty languages ad-nauseam.
Sys admins were still about getting shit done quickly at scale, and Python slowly began to replace Perl. Python 2 had string methods built in, Red Hat switched everything to Python, tool.s like LXML started coming out right when we all had to munge XML all day and suddenly that was it.
The most fun security bug the previous major version had was a side effect of file naming. In order to prevent users from just downloading data files, every data file was given the .cgi extension and was always saved as 0777 because shared hosting sucks and nobody ever used suexec like they should.
The file format for user records is the login name on the first line, and the plaintext password on the second, email on the third. Someone figured out that #, ! and / weren't filtered in usernames. See where this is going yet? If the directory containing member records was available inside the document root, someone could perform trivial remote command execution.
The second most fun was people discovering XSS before it was called XSS. With some creative quoting, you could inject javascript into the markup.
I'm just thankful nobody figured out CSRF, I'd have hated to figure out how to deal with that way back then...
Those were the days.
And why would you need to fork Python 3 to support Python 2 codebases?
Yes.
At a Perl conference in October last year Stefan Seifert decided it was time for him to have a go at something Perl 6 related. He had never written Perl 6 code before, let alone participated in the project, but within 24 hours he had Perl 6 calling Perl 5 calling Python[1].
That was just a few months ago. Now the Inline::Perl5 module[2] allows folk to use Perl 5 modules, even ones that do C level guts poking in to the Perl 5 interpreter, and to pass data back and forth, do callbacks back and forth, handle exceptions raised by Perl 5 in Perl 6 and vice-versa, use Perl 6 to call methods on Perl 5 objects and vice-versa, and use Perl 6 to subclass Perl 5 classes. Thus he's been able to, for example, create apps in Perl 6 using a leading Perl 5 web framework called Catalyst.[3] He's also having fun with calling Python libs from Perl 6.[4]
There's a lot more going on related to interop between Perl 6 and Perl 5, and more generally between Perl 6 and other languages, but the above is obviously a biggie.
> Is it even possible to convert existing Perl5 CPAN packages to support both versions at the same time
As is hopefully clear, with Inline::Perl5 there's no need to convert.
(Some folk will still want to rewrite some Perl 5 code in to Perl 6, and there are fledgling tools to assist, but they aren't necessary, just a nice option to have.)
[1] https://www.youtube.com/watch?v=m_Y-lvQP6jI&list=UU7PuZDAIVM...
[2] https://github.com/niner/Inline-Perl5
[3] http://www.reddit.com/r/perl6/comments/2k6ii8/nines_apw_talk...
[4] http://www.reddit.com/r/perl6/comments/2n27el/perl6_20141121...
But Python3 is an obvious failure and no one is admitting it, yet. I've seen claims from the core dev team about how Python3 is doing well because it has more downloads from Python.org, which is so stupid I won't even address it. A comparison of PyPI download statistics says it all.
Python3 migration had many ridiculous ways of pushing people to migrate. The answer for Python3's adoption was always something new. It reads like the list of reasons for invading Iraq.
Originally (and today's) overly optimistic EOL for Python2, then automated code conversion utilities, then porting all the major libraries, then 'six' type libraries to allow an ugly PythonX middle ground, then adding 3.x-only new features as a carrot, now the bright idea from the core dev team is to focus on pushing Python3 as the default install on distros. They all failed. Python3 as default on most distros won't do anything either.
All that said, and I think this is the best-case scenario: Python3 will survive and eventually thrive. It will just be a shadow of Python's former glory.
Is that -really- worth forcing unicode handling? For Zeus' sake, I wouldn't think so. This coming from someone who agrees with the change in theory.
Respectively: Not at all, and not without major contortions. The languages have diverged a lot; even basic tasks like defining a function are not the same.
This is no longer strictly true. On Friday, the "let's remove all the deprecated stuff" RFC was passed. Anything that causes an E_DEPRECATED in 5.6 will now be a fatal in 7. For example, ext/ereg and ext/mysql are no longer included, and have been shipped off to PECL. Shouldn't be a problem for anyone that doesn't compile their own, really. A few php.ini settings are also now removed, which will fatal on startup.
It'll be safe to say that if your code runs fine under 5.6 with error_reporting set to -1, then you'll probably run under 7 without too much trouble.
And that's exactly how deprecation is supposed to work! No massive changes, only incremental changes, and even those incremental changes come with at least a couple of years of grace period.
Not completely, ext/mysql does not output E_DEPRECATED. Although I guess installing a compatibility library is probably not all that much trouble.
Those will migrate to Julia, Go, or something else.
I used Python a lot in the last decade (2000 - 2004) for automatation and little applications.
Nowadays my choice would be OCaml for the same type of tasks.
EDIT: typo, automatic => automatation
The appeal of a scripting language is that "automatation and little applications" do not take a lot of friction to write, I'd say OCaml is less suited in this regard.
This might stem the tide for a while... Then we have pyston which maintains C api compatibility.
- Python3 currently exists, and there is a large push to get the majority of the "big" packages to support it (many of which do currently support Python 2.x and Python3).
- It's possible for a Python package to support both Python 2.x and Python3 at the same time or to program the Python 2.x version in such a way that converters like 2to3 can do the conversion for you. I'm aware of no such tools or capabilities between Perl 5.x and Perl 6.
- Python3 isn't as ambitious as Perl 6 is/was.
Edit: As to point #2, I recall that there may have existed (maybe it still does?) some project to use Perl 6's "reprogram the grammar" capabilities to turn Perl 6 into Perl 5. I'm not sure how I really feel about that though. There was also a time when there was some buzz around Parrot VM[1] that was associated with Perl 6 (I don't know if it was some official partnership or just some announcement of Perl 6 support in Parrot).
Heck, apart from few - even those which are not supporting Py3k now have alternative package in PyPi. So it's positive sign.
When a loved platform stops evolving, as python2 has, there is this lovely period when it continues to be awesome, while requiring you to learn nothing new. Python is here now. But come the day that my new Linux distro links to 3 over 2, I will get organised to move.
I'm sad about this, I loved programming Perl a decade ago but the last side project I wrote in Perl was all the way back in 2010.
It was mostly new things, not different things. I don't even remember the new object model being that hard to pick from the PHP4 one. I think lots of developers got more stuck on the 5.2 -> 5.3 transition.
Isn't Python 2/3 more about libraries and compatibility than hosting ? My personal anecdote is that it deferred me way too long to learn the language seriously. I didn't want to waste time learning an old version but too much things were on it, especially Django and Flask (being mainly a webdev).
PHP7 vs Hack could mirror that though.
Source: the manual page. http://php.net/mysql_connect
None of the other ext/mysql functions do so.
Ned Batchelder gave an excellent talk[1] that explains how the Python 3 approach to Unicode works. I think it makes a lot more sense once you understand it; the Python 2 way was clearly broken, and it looks like Perl 5 has the same problem but hides it better.
[0] http://search.cpan.org/~jhi/perl-5.8.0/pod/perluniintro.pod
Also according to perlunifaq the minumum version you should be using is 5.8.1 which the documents for 5.8.0 would of course not mention.
Really if you want good unicode handling you should probably use 5.16.0 or later. If you want the latest version of Unicode there are ways of changing which version of Unicode Perl is compiled with, but it is easier to just use the latest version of Perl, which is 5.20.
http://perldoc.perl.org/perluniintro.html http://perldoc.perl.org/perlunitut.html http://perldoc.perl.org/perlunifaq.html http://perldoc.perl.org/perlunicode.html
p.s. I noticed in the Python talk you linked that no one knew that the pile of poo symbol is in there because the japanese characters for luck and poo are very similar. ( I am unable to find a link to where I first read this ) The Japanese are also responsible for why we call them emoji (e means image, and moji means character. ) http://www.fastcompany.com/3037803/the-oral-history-of-the-p...
http://perldoc.perl.org/perluniintro.html
Anyways, Perl5's Unicode support is quite different from Python's.
Specifically, it doesn't have distinct "Unicode string" and "byte string" types; instead, it has a single unified string type. These strings may be internally stored as Latin1 or UTF-8, depending on how they were created, but they behave identically for almost[1] all purposes, and there are easy ways to force Perl to convert between the formats. It's still possible to create a nonsensical string if you do something silly like append Unicode characters to a string containing raw UTF-8 data, but that's not something the language can entirely protect you from.
[1]: The only exceptions I'm aware of are functions which explicitly operate on the utf8 status, like utf8::is_utf8(), and bitwise operations like &|^ and vec().
What's my hidden agenda in agreeing with this article over yours?
It's just that, well, it isn't legacy. It's more up to date and much more robust than many of the hip languages.
You need to assign to a variable named @ISA, you need to return 1; at the bottom of the file. And 'public' members have to be listed in the EXPORT variable.
It is really funny that Perl 5 OO need more boilerplate code than Java!
And here's the boiler plate for more modern perl:
package MyClass;
use Moose;
1;
You can define properties of the class using has 'property'; This will setup any accessors and also handle initializing them in the constructor that's created for you by default.And then, even if it was true and you really needed to "add public methods to EXPORT variable" that's no different than modern JavaScript, right? That's how modules work in JS. Having to "return" something at the end of a module is a requirement in Lua, too - again, it's just how the module system works.
Anyway, I don't know PERL, but knowing many other languages I find your claims suspicious. It reads as if you were a recent Java convert who tries to rationalize his decision to leave PERL or something like that.
I don't need to convince others to join any kind of cause.
As someone who cares about performance I still use Python for the non-performance critical parts of code, which is the vast majority.
I'm pretty sure that in the end this is just a matter of personal preference, but you make it sound as if there are objective arguments without actually presenting them.
Somehow you can already see it on the interwebs. The majority of Go and Julia users come from Python and Ruby, not from languages that have AOT/JIT compilers on their toolchains.[0]
This is just my gut feeling from almost 30 years watching similar technology transitions.
I have no data to back it up and may be completly wrong.
[0] There is PyPy, but I never saw it being deployed in production systems.
I'm not sure that theme is wrong even, but to many of us who lived through early java, golang's least common denominator approach to developer sourcing is eerily familiar.
Despite the taint Java left on it, it's actually a good idea! It's a common use case. After years of programming in Perl in a fairly large programmer environment I can see the virtue of the idea of using a simpler language helping keep a lot of programmers in sync in their code base, instead of living in a world where I can look at the source and virtually instantly tell both when and who it came from due to massive differences in dialect. But Java seems to have failed so badly that it soured everyone on the entire idea, and nobody has tried since.
I think Go actually has a better chance at this, not for any large reason but for a series of smaller ones. Defaulting to object composition, once you understand it, is a powerful-yet-simpler approach to putting objects together than inheritance, and makes it much easier to both use the objects of others and to create objects to use for others, because you don't need to worry about what will be F'ed up in the "child classes", as there is no such thing. Implicitly satisfied interfaces don't sound like they'd be a big change over Java, in practice it's night-and-day to be able to declare interfaces that are automatically satisfied by objects you don't control. Contrast how many ways there are to write the same Go function as there is to write it in, say, Scala. And writing some decent multithreading primitives into the core is probably a good idea for this use case, too.
It won't happen tomorrow or next year, but, arguably, rather than Rust or even Python, the language that Go is the biggest threat to in the long term is Java. And it's a threat for precisely the reasons that people on HN tend to complain about. Indeed, I personally have the same objections that most HN'ers do for personal usage, but right now bar none Go is the language I'd most like to work in, precisely because it was written for the Google use case which also happens to be the one I have.
Wind back 35 years or so and you could have said the exact same thing about COBOL.
An expressive language is good to work in, because reading 1 line of code instead of 100 is always better for readability and also verbosity is a cause of accidental bugs - one line of code that does the same work as 100 lines is much less probable to contain accidental bugs. Plus, the closer you have code that precisely models the business logic, the more readable it is (assuming that we aren't talking about a retarded, badly designed, non-composable DSL).
However Perl is a heavy language that also lacks common means for abstractions that people do use in Perl, like OOP. Therefore, not only are we speaking about a heavy language, but one in which you get a dozen libraries for doing things like OOP, all of them slightly incompatible with each other. Of course, Moose came along, but Moose was late (i.e. the damage was already done) and I'd argue that Moose is also overly complex. This goes over the principles outlined by Guy Steele in his "Growing a Language" presentation - either a language is very simple, with a core set of orthogonal and powerful features that allows you to build whatever you want on top (i.e. Scheme), or it's a more complex language that provides everything you need. Perl is neither of those. So one can argue that Perl is badly designed.
So you could say that Perl tainted the idea of using expressive languages, just like Java tainted the idea of using simple languages. And actually "simple" in this context is incorrect, because there's nothing simple about Java's flavor of OOP, it's just that people are familiar with Java's blend of OOP, but familiarity is not necessarily about simplicity. But I digress.
And it's a pity. For example right now my favorite is Scala. In my opinion Scala's expressivity is very different from Perl's expressivity, in that Scala's constructs are necessary and almost orthogonal and usually properly used and the abstractions are well defined. I also programmed in Perl and after 2 years of doing it I would still have problems reading code from other people, whereas this never happens to me in Scala and even if that would be the case, I have an IDE to help me out. And in my experience of training rookies to work with Scala, it's not the syntax that's problematic, but rather the design patterns and abstractions used and that have been imported from Haskell and hence are foreign to many developers. Yet in spite of this, I've seen many superficial opinions floating on the web that a language like Scala is too complicated and then when you ask those people why, it turns out that in most cases we are talking about misconceptions and unjustified fear coming from a superficial understanding of a language.
Going back to Go, the problem with Go it that it lacks the means for abstraction that I'm looking for. Go lacks generics for example, which means that building abstractions that involve higher-order functions is not feasible. And I'm sure that Go will get generics at some point, since it is inevitable, however Go is not the type of language to ever implement higher-kinded types and type-classes. I personally need type-classes, being a very different means for ad-hoc polymorphism, when compared with OOP, with different use-cases.
For example I want to work with monads or applicative functors, which in spite of their scary reputation, are just design patterns that aren't very hard to understand, their reputation being a direct consequence of them being explained by Haskell developers with a mathematical mindset. And I want to build generic functions that work over monads or applicative functors, because once you discover their power, it's very hard to go back and life is too short to reinvent the wheel every single time. And Go is not the kind of language that will ever appeal to my needs, whereas languages like Scala, Clojure and arguably Rust are such languages.
But here's the real problem that I'm seeing - scaling a software development team is done in two ways ... you either hire more people, or you hire really good people that can produce better abstractions. This is horizontal scalability versus vertical scalability. And the problem is, in a software development company, these 2 approaches are incompatible. The companies that want to scale horizontally are exactly the companies that prefer familiar languages, whereas the companies for which that isn't feasible (i.e. startups) are the companies that prefer powerful languages.
And of course, you would think that it's better to scale horizontally, depending on the problems solved, but therein lies another problem - the difference between really good people that can juggle with abstractions and juniors is not necessarily one of productivity, but rather in the range of problems they can solve. Given enough difficulty, you can hire how many juniors you want and they might still not be able to solve certain problems, whereas those same problems might be feasible for 2-3 people that are really good. Amdahl's law is also very relevant to software development. The more people you have, the more you introduce concurrency and points of synchronization, which in turn kills the parallelization possible and thus productivity.
What I'm talking about is the software crisis problem, which is still very relevant. And my personal bet is on vertical scalability, which implies working with better tools and abstractions. Because that's how we scaled math and that's how we went beyond the pyramids.
> to indicate successful execution of any initialization code
Other dynamic languages have problems with "half"-loaded code. This mechanism is a defense against that.
Also new versions of Perl allow you to define a package scope and skip the '1;' Most Perl programmers don't use this yet since the benefit is very small and the cost is losing some back compatibility. Maybe in a few years it will be more common:
package MyApp::Web { ... }
Like a lot of things in Perl it has a use that might not be immediately evident. Its also possible a more elegant solution could have been found as well. Generally when I write real code I never notice it (the 1; is drowned out by docs and real code.
I think maybe is the answer it managed to barely do just as much backwards incompat as it could get away with. (Barely, it drove a lot of people crazy). But it was quite possible to write code that worked in both ruby 1.8 and 1.9, quite intentionally, despite the backwards incompatibilities.
Combined with a commitment from key players (esp Rails) to move to 1.9 and stop supporting 1.8, forcing the issue. And that it happened at a point when ruby/rails were at the peak of their popularity, not already on the downslide (Perl). Which of course effected how much backward incompat you can get away with.
That's the trick, predicting how much backwards incompat you can get away with, of course.
But of course, there's another lesson here too, which the OP astutely calls out in the "greenfield" section -- if you focus too much on stability and supporting existing projects, that's just another way to make the ecosystem go stale.
Part of the lesson from Python 3 is that large numbers of people will only spend 3 years deciding whether a 5 year plan to make a major change to a 20 year old language succeeded or not.
I think is more about practicality. Incompatible releases are a huge hassle for users; the payout should be equally huge to make it worth the effort of porting.
As the post says, a language should try to be the best choice for new projects: easier and more powerful than other choices, delivering better results with less effort. An incompatible release starts from a position where it requires more effort, so it must deliver much better results in much less time or it will be discarded on practical ground (and all the while having the same feel and strengths as previous releases - you can't make Go, call it Python 4 and expect people will love it). That's very difficult to deliver.
When every major browser is moving in the same direction with a language, any server-side counterpart is best served moving in the same direction.
Without browsers, io.js would have likely ended up in the same place as all the examples above.
It seems too soon to tell what's going to happen with io.js. It was released just a few days ago.
what is considered good c++ has changed pretty dramatically from what I learned in the 90s. Though afaik none of those changes were breaking.
If you count big chunks of legacy python 2 code a "minor exception", I agree.
Anyway, the big difference between python 2 -> 3 transition and the Perl 5 and Perl 6 coexistence is that nobody within the Perl community tried to end-of-live Perl 5.
Yes, that means less incentives for migrating to Perl 6, but it also reduces the risk for Perl 5 users.
While this is true, it's possible to write a script that will run on both Python2 and Python3, so long as you have that goal in mind. The breaking of backwards compatibility is the breaking of several APIs and assumptions.
> to my knowledge everybody is still using Python 2
This is mostly because the release of Python 3 didn't see everyone stop everything and immediately start coding in Python 3. Conversion has to bubble up from the major libraries (e.g. Django, Flask, SciPy, etc) first, before people are able to convert.
Also, switching the default Python on Linux distros takes time because you have to go through all of the packages in the package manager looking for Python scripts and make sure that anything pointed at /usr/bin/python will work with Python 3[1].
Another point is that a number of libraries delayed conversion, and didn't consider Python3 to be "stable" until around Python 3.3. Some of other libraries (cough Flask cough) delayed support for a long time because the maintainer just didn't like Python 3.
[1] I know that these aren't always working well though. A while back I found out that Comix (installed via Ubuntu) had "/usr/bin/env python" in the shebang line instead. Launching it from a Virtualenv that doesn't have PyGTK doesn't work so well... :P
The big problem with Perl 6 has been that the implementation has trailed the ambitions of the design. But that's changing due to pieces like Inline::Perl5 falling in to place. (See my comments nearby for more details.)
In the unlikely event there's a module that doesn't work, then yes, you have to learn and wield a new language that isn't backwards compatible. But it is Perlish, and it is designed to coexist beautifully with Perl 5.
Perl 6 is for new projects. Perl 5 ecosystem continues evolve untouched. Unlike the Python 2 scenario, where 2.x won't be supported and 3.x series and its library ecosystem isn't ready anymore.
> I also programmed in Perl and after 2 years of doing it I would still have problems reading code from other people
> I've seen many superficial opinions floating on the web that a language like Scala is too complicated and then when you ask those people why, it turns out that in most cases we are talking about misconceptions and unjustified fear coming from a superficial understanding of a language
That's generally the same thing I see when talking to people about Perl. I don't know the level of knowledge you gained with Perl, so I don't know if it really applies the same, but from the outside, it does look the same.
I generally view this a a problem of language power AND complexity. Complex languages take longer to learn and be comfortable with, but if the complexity is because they provide more power, what you are really doing is front-loading work to make future work easier, which pays dividends in the end. I think this also fits your description of leverage quite well.
With a lot of leverage, like a requirement for sophisticated developers and powerful languages, you can get huge payoffs. The kind that are unlikely without it. But also like leverage, small, sometimes unavoidable problems can utterly destroy your efforts.
I'm not convinced that I've ever seen a big group of average developers be highly successful, and I have seen that with a small group of great developers. But I've also seen a medium sized group of above average developers completely submarined by the complexities of their language.
There's an awful lot of FUD and hate for Python3 on Hacker News, but I've found it's great for a green-field project. And folks with 500KLOC existing systems should know that their technology choices are basically locked in time to when they started the project, anyway.
As far as I can see, python 3 is there now; it's the default on my servers, all the libraries support it, and it's a nicer language to program in. And just as that became true, everyone started losing their minds.
I dunno. I'm new to Python (version 2 so far) and I easily spend 25-50% of my coding time fighting with ascii/unicode issues in Python. I wish Python 2.x just did something smarter.
Similar, but not quite as bad, is the need for me to put str() around non-string values in concatenation. Just f'ing doing it for me. I'll write a bunch of code, put together a message in a concatenation only to have it blow up at run-time because of this.
sigh I really miss Perl's implicit behaviors sometimes.
I dunno, maybe this all is making me a better programmer and person, forcing me to really deal with Unicode now, and breaking me of lots of Perl bad habits. But it's really one of the sucky parts of the language.
There's some days, after spending half the day fighting with this issue, that I almost decide to dump the whole thing and switch to Python 3.
I'd probably agree 3.x is more Pythonic in this regard, but I think it was an ill-advised move. Plenty of reasoning in my last response as to why.
Why not go ahead and use Python3, you may find it works for you. For me, there's a long tail of libraries that don't exist there, and frankly following the core dev teams' example- we should all act in our own best interests. I'm far more productive in 2.x.
I may eventually move to 3.x, but it will have to be based on its merits. Rather than dogma, salesmanship or propaganda. Today it isn't even close to 2.x and we're nearing 7 years since 3.0 was released.
Unlike most things in life such as updating some software package, the "latest version" of a programming language isn't always in your best interests. I think this is a hard mental barrier to break down, especially people coming into Python now.
But I would always recommend learning/using 2.x, not only is it easier to build cool things with it (the whole point), but you have to learn 2.x. You can avoid 3 entirely, without any issue whatsoever.
I hear a lot of complaints about Python 3, but in my (limited) experience, 3 is better than 2.X in practically every situation I've experienced. But I've never had to maintain anybody's old code in it, either.
So are you saying that it's clearly "pulled ahead" in the race? Or that Python 3.x is a significant regression? Your "technological churn" comment makes it seem like you think it's just treading water, which I would interpret to mean a lack of progress vs. a step forward (or back).
I never had too much of an issue with Perl's implicit behaviours, but it enables some really lazy programming, even from (otherwise) smart people that are gung-ho about Modern Perl. E.g.:
sub { map { "$_ $_[0]" } @{shift->[0]} }
(Note: I have actually seen people think that this was an ok way to code, even as they tried to champion things like MooseX::Declare.)There's also stuff like this[1] for Perl + Unicode. :^P
[1] https://stackoverflow.com/questions/6162484/why-does-modern-...
'%s %s' % ('hello', 'world')
Avoiding these implicit behaviors helps avoid bugs; it's worth it.I'd recommend going for Python 3 unless there's a specific reason (library) keeping you on 2.
'{} {}'.format('hello', 'world')
But yes - either way - it solves the need to do str() when concatenating.Yup, this was a gradual process, but by now everything I need is ported, even Django.
> now the bright idea from the core dev team is to focus on pushing Python3 as the default install on distros. They all failed. Python3 as default on most distros won't do anything either.
It worked on me: When Arch Linux made it the default I figured it was finally time to adopt it for my various everyday utility scripts, which resulted in me successfully pushing for it at work as the implementation language for several projects.
You are mistaken. See my nearby comment about Inline::Perl5.
> not without major contortions [can one convert].
One doesn't need to convert (due to Inline::Perl5).
That said there can be valid reasons (eg having fun and learning Perl 6) to want to convert existing Perl 5 code to a Perl 6 equivalent anyway. While some partial P5-to-P6 conversion tools already exist[1] (and I'd be surprised if more don't arrive in the future[2]), conversion of a well written Perl 5 module in to a well written Perl 6 module is mostly a manual exercise.[3]
> even basic tasks like defining a function are not the same.
sub foo ($foo, @bar) {
my $qux;
# do something
return $qux
}
This is the same in both languages.Could you provide some code to illustrate what you mean?
---
[1] http://www.perlito.org/perlito/perlito5to6.html Incomplete but better than nothing.
[2] https://github.com/rakudo-p5/v5/ is a project to create a Perl 5 compiler written in Perl 6. It parses Perl 5 code and spits out Perl 6 ASTs. It's obviously not a huge jump for it to spit out straight Perl 6 code. One day...
[3] http://jnthn.github.io/css-tiny-presentation/presentation/#/
sub foo {
my ($foo, @bar) = @_;
...
}
I'm not sure if that's valid syntax in Perl6 or not, but either way it's certainly not idiomatic.As a practical programmer, I have enjoyed signatures and run-time type checking for years, provided by libraries. Even now, these libraries are more featureful than core signatures.
So, to recap:
> Can one even use CPAN with Perl6?
Yes.
A Perl 5 coder might write:
use Data::Dumper;
print Data::Dumper->Dump([1]);
A Perl 6 coder can now use the same Perl 5 module, eg: use Data::Dumper:from<Perl5>;
print Data::Dumper.Dump([1]);
The Perl 6 "adverbial phrase" `:from<Perl5>` at the end of the `use` statement line tells Perl 6 what module loader to use.(Another important `from` option in Perl 6 that's currently being brought up to production grade is `:from<Java>`.)
The `.` rather than a `->` in the print statement line is another giveaway that this is Perl 6 code. And the `[1]`; is that a Perl 5 or a Perl 6 array literal? It doesn't matter. This line is a taste of how slick Perl 6 interop magic is. You barely notice it, but the language is automatically marshaling data and objects back and forth between languages as necessary.
Of course, the above is a trivial example. But that's not because complex examples don't work; within a few weeks of starting Inline::Perl5 its author Stefan Seifert was demoing a Catalyst app written in Perl 6. That needed fancy stuff beyond mere passing objects back and forth; in this case Perl 6 code had to subclass a class from another language, in this case Perl 5, and have Perl 5 accept objects made with the subclass as if they were Perl 5 objects made from a Perl 5 subclass.
Inline::Perl5 hasn't yet been smoke tested with all 130,000 CPAN modules, and it will no doubt fail with a few, and a similar story applies for the even more immature support for calling Java libs, but this tech ought to be a game changer, at least within the Perl community.
> Is it even possible to convert existing Perl5 CPAN packages?
There's no need. (See previous point.)
But if you really want to, then yes it is possible, and seems to be enjoyable. Reports I've read of P5-to-P6 conversion stories tend to express satisfaction that basic syntax is generally the same, the changes that are necessary make sense, and the final code is a lot shorter, often half the length, and is very readable.
It's not all roses with Perl 6. There's plenty to bitch about. (#1 is still speed.) But use of CPAN modules, and writing Perl 6 code alongside Perl 5 code, are quickly shifting over to the strengths column for Perl 6, not the weakness one.
While not quite the same as what was asked, it's clear that 'not at all' is not an informed answer
But Inline::Perl5 is a completely different animal. It handles modules using XS or whatever fine. See my nearby comments for further details.
P6's speed is still well behind Perl 5, but it's catching up very, very quickly.
And performance improvements won't stop there: https://fosdem.org/2015/schedule/event/perl6_beyond_dynamic_...
I won't guarantee that Go will experience wild success and become an A-list language, but I will guarantee that barring some major change in approach or leadership, it will not fail so spectacularly as to destroy the entire idea of trying to create a language for programming at scale. While HN bitches, Go's penetration into exactly the space I'm describing marches on and has passed critical mass.
If you go back and read what I said, notice that nobody could sensibly call Java a generalized "failure" either. It specifically failed to create a language that would be something that could be used by large groups of people easily, and to the extent it succeeded it did so with incredibly grit, perseverance, and tons of third-party tools and terribly abortive efforts over the years, and it also did it so badly that people entirely stopped talking about even trying it. This despite the fact that "how do we write programs in companies with hundreds of programmers working on tons of discrete projects" is by any measure a very large use case for programming languages, and that only Go is directly addressing this use case directly is in some sense a travesty. (Others address it indirectly, by claiming that their features that are really intended for code safety or power may also as a side effect have the ability to make big programming teams function well, if they even claim that.)
"%s %s" % blah
If a bug causes `blah` to be a string (rather than a tuple or a list), it will attempt to expand the string, possibly giving a confusing error.