432 points · by e15ctr0n · 10y ago · 185 comments
It would take a ridiculously advanced language to counter that turning of the tides. Luckily (or, I guess, not due to luck but because Perl 6 developers realized they had to deliver something amazing to justify the time lost in the wilderness), Perl 6 is a ridiculously advanced language.
I haven't started a new project in Perl in several years (though my primary projects, which have existed for 9-17 years, are in Perl), but I'm strongly considering making my next project a Perl 6 project. It looks like a really fun language. All the stuff I like about Perl, with almost none of the stuff I don't, plus some advanced stuff that I don't even know enough to know why I might want it. But, I know that Higher Order Perl for Perl 5 (which I actually read while I was mostly working in Python) was a lot of fun and made me a better programmer, so I assume Perl 6 and its new paradigms will be similarly eye-opening.
There was a time when going into a large project, you could choose between Java, C/C++, or Perl. There were outliers (even some with significant footholds in some industries, like TCL), but those were the options I saw in front of me at every junction. Today, we can choose to work in so many languages, and get good results, find good community, find good library and tooling and cross-platform support, and enjoy all the stuff we found so nice about Perl way back when.
Some of the worst code I've seen was written by people who think the choice of programming language matters all that much (the rest was written by beginners or physicists).
We got a contractor in who was a Perl guru, he wrote one of the popular web frameworks but even he couldn't put forwards a good case for using it over PHP.
And now in the company my brother works for (a cloud hosting provider) they are currently switching from Perl to Python.
Meh, all the dynamic languages are basically the same. They're all basically things that manpipulate strings and C pointers. For perl/python/ruby/js here's what I'd sort of recommend:
* Pick from your team's strength, unless:
* Lots of turnkey logic, code quality and debug tools are not a priority, and you want to be able to hire fast and cheap: PHP.
* Lots of turnkey logic, per-performance isn't a problem and you want some higher order programming capability: Ruby.
* You want to manage a java-like large team for not so trivial logic, and you prioritise uniformity over expressivity. Python. Also python is a good environment for academic work as it helps the academic programmers not shoot themselves in the foot so much and academic code is a mess. Which is why python is such a good extension language for other tools.
* Async greenfield stuff where you don't need to worry about external libraries much: javascript. Also the only game in town for web front ends (plus its transpiling friends). Javascript is like a syntatically impoverished perl in this regard.
* You've got a whole bunch of mess in business logic and/or systems logic that you need to encapsulate, and you've got a small highly capable team who want to prioritise expressivity over uniformity. Perl excels here. So does python, but it'll make you do even more horrible things papering over the mess.
Regarding the last point, I believe if it reaches a tipping point perl 6 will be a good thing for async, multicore and parsing related stuff, and should be long-term productive and reduce the requirement for having as highly capable and a disciplined team that is really a requirement for non-trivial perl5 code bases.
Also perl5 is second to none for programming language back compat. I had a decent sized non-trivial project I'd written for internal (research) purposes, then neglected for several years. Then I had to look at the running code again. I'd been through several minor OS upgrades, moved to a completely different OS and gone through at least three major versions of perl. Aside from a couple of missing CPAN modules that I had forgotten about in the Makefile.PL, everything was fine out of the box.
Of course, PHP makers made their share of mistakes with their decisions - register_globals, safe_mode (which was not), inconsistent function naming in standard libs, myriad of weird bugs (like syntax error (still) throwing HTTP response 200),...
> debug tools are not a priority, and you want to be able to hire fast and cheap: PHP.
The only debug tools that we found that were better than XDebug or NuSphere were Studio And C#. Perl, Python and Ruby were all a bit rubbish in comparison.The track record for PHP in recent years has been pretty good.
I was under the impression that it's just another dynamic scripting language semantically equivalent to Perl5, Python, Ruby, JavaScript, and so on.
And obviously new languages of this kind aren't going to be very successful or interesting because knowing and using JavaScript is going to be mandatory forever due to browsers and with Babel and ES6/7 it's as good as any other such language.
Plus in addition to JavaScript, Ruby, Python and PHP have a lot of momentum as well.
WebAssembly will offer many options as browser adoption happens and cross-compilation with support for source maps is becoming very common as well.
I'm a fan of JS and ES5/7 in particular... that doesn't mean that other options won't take root. JS has plenty of advantages in that it's the same code client/server, less disconnect in objects, serialization constructs built in (JSON), easy translation to/from dbms (no ORM needed), etc. Just the same, a decade ago, everyone avoided JS like the plague.
I first remember learning about rumors around the development of Perl 6 about the time I picked up Perl 5 for the first time. I had been doing a bunch of C and C++ code (and a smattering of Java) up to that point, but coding in Perl was like hitting the idea accelerator. At the time (programming resources on the Internet were few and far between) I didn't even know where to look to find resources to do things in C++ that were quick one-off scripts in Perl. Need CGI? No problem. Mucking around with a database, here ya go.
I jettisoned C++ and dove heavily into Perl for years after that. I'm pretty sure that Perl made me a much worse programmer (it turns laziness into a kind of opiate), but a better conceptual developer -- I now had a much better idea of what computers could do, and didn't have to reinvent an entire civilization every time I wanted to do something (not a joke, where and when I worked, I was partially responsible for working on a pre-STL String library for C++, that's where we were in the world). Perl was really the first time I had encountered the productivity benefits a true high-level language could bring.
I've since abandoned Perl and have moved onto Python for day-to-day. There's lots of electrons spilled by many former Perlers who've made similar transitions. I've never really liked Python in the same way I liked writing Perl. With Python I've always felt like I'm assembling Tinker Toys or an erector set into a thing. It's quick to build and it works in the end but there's not much passion in it. With Perl I always felt like I was writing poetry -- code just sort of fell out of me.
I thought about checking out Go, but there's something about the sort of terse opinion the language designers have about the language that's made me feel like the entire language is a premature optimization that's going to go stale quick.
Perl 6 feels like we've just entered a new evolutionary period, where we've been given all new tools, where the opinion is careful inclusionism. It's like being stuck writing couplets and haiku in Perl 5 and now we can write anything.
Congratulations Larry et. al. This has been a long time coming, and I hope this is an amazing start!
Seeing Perl 6 release notes like "Use of EVAL now requires a declaration of ‘use MONKEY-SEE-NO-EVAL’" and "Non-digit unicode characters with a numeric value (½ and such) can now be used for that numeric value" reminds me of the nerd coolness of Perl, so different from the straightforward sensible air of Python. I don't see many deep-hacker sysadmins these days, but I hope the excitement of Perl 6 can inspire some inefficiently marvelous coders...
I always loved how simple it was to do simple things in perl... I've been hoping to find something I need go for, so I can actually dig into it... far more likely to find an excuse to use perl 6 sooner.
Is that a Freudian slip? Do they really only have one user? :-)
Thanks Larry and co! So this Christmas it did happen :)
I really liked the post that precedes the submitted one, in which Perl 6 is described as a teenager being adopted into a family, "An Unexpectedly Long-expected Party" https://perl6advent.wordpress.com/2015/12/24/an-unexpectedly...
EDIT: security as in, no similar-looking but different characters to confuse users etc...
http://unicode.org/reports/tr36/ http://unicode.org/faq/security.html https://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA...
#`(
Multiline comments use #` and a quoting construct.
(), [], {}, 「」, etc, will work.
)
This level of flexibility in how you make comments seems a bit... oddFor example all of the literate style POD6 comments are accessible within a variable as a fully structured tree in the $=pod variable. The 'q' quoting context in the main language allows you to use any matched quote/bracket from unicode as the markers of the start and end of a string or regex, or comments as you've picked up on.
This is super helpful if you want all sorts of weird quotes and brackets inside of a string and still have it interpolated for variables for example.
say q⧚This string has a "'weirdly quoted bit in'"!⧛;
Will print out: This string has a "'weirdly quoted bit in'"!
To see some examples of how extreme you can have these characters be from unicode check out http://xahlee.info/comp/unicode_matching_brackets.htmlSame here. But recently I had to convert a strange proprietary file format from a poll into CSV for a personal project of mine, and I decided to use Perl (5) just for nostalgia sake. I got a solution in minutes despite not having used Perl in years and I enjoyed programming on it, I'd say more than Python and sometimes bash which are my go-to scripting languages. Perl is the kind of language that you enjoy using for quick but effective hacks, maybe because it doesn't get in your way. Definitely I'm going to use it more.
What a time to be alive!
So who knows, maybe we'll see Hurd 1.0 before, say, 2020. ;-)
Grunt and gulp have huge plugin ecosystems, which is both a blessing (you can find ready-made plugins for a lot of tasks) and a curse (everything moves very rapidly, plugins get abandoned, blacklisted and superseded all the time - if you want to compile TypeScript files, half the blogposts will recommend gulp-tsc .. but wait, it's been blacklisted, you should use gulp-typescript instead ).
Grunt: ~5400 plugins: http://gruntjs.com/plugins
Gulp: ~2000 plugins: http://gulpjs.com/plugins/
Gulp's list of blacklisted plugins: https://github.com/gulpjs/plugins/blob/master/src/blackList....
gulp-autoprefixer -- CSS vendor prefixes
gulp-concat -- concatenates multiple files into one
gulp-cssmin -- CSS minifier
gulp-imagemin -- image optimizer/minifier
gulp-rename -- renames files produced by other streams
gulp-ruby-sass -- transpiles SASS to CSS
gulp-template -- interpolates some variables, e.g. environment settings or external dependency URLs, into a file (basically lodash's .template )
gulp-typescript -- transpiles TypeScript to JS
gulp-uglify -- JS minifier
gulp-util -- provides things like access to environment variables, console.log replacement, Gulp-specific throwable errors
gulp-watch -- automatically recompiles when source files change
gulp.spritesmith -- converts images to CSS spritesBut ya know, 15 years is a long time. in fact i was around 16 at the time, and am 30 now, and remember talk about perl 6.
I'm a ruby guy now, and I don't see how I could ever go back to perl. Is perl 7 going to take another 15? or 30?
Despite whatever features came about; i should not need to wait half my life to get them. That I think reflects poorly on the perl culture, or its momentum. And it's not that perl 5 was without issues (though they were rare for me)
Maybe a revival will come about from this, and maybe a change of pace and approach; but as it stands the 15 years it took to release feels closer to failure than to a success, and to tie my code to such neglected foundations does not jive with me. Or maybe I just really like ruby now.
Honestly, I hope something good comes of it. Even if its just new features that other languages go on to adopt or take cues from.
Perl 6 is a different language.
The REPL is one of the features that hasn't gotten as much attention as it should. It was much more important to spend the time getting the rest of the language into shape.
That said I use the REPL for 90% of my coding. Including temporarily replacing parts of the runtime while trying to fix them.
Then how do you know what this means:
users=users-churn-rate*time
oh, i see ... they are prefixed with $. so it's: $users=$users-$churn-rate*$time
Hm... still a bit confusing. But ok. It can be avoided by avoiding dashes in variable names. x = 2 * y
x = 2*y + 5
This is pretty readable. In fact I think it is more readable than the usual convention of "spaces around every binary operator," but it would be untenable without the existence of gofmt. The most common argument against a convention like this is, "subtle bugs will be introduced if the actual precedence is different than the one implied by whitespace," which is why it's great to have a benevolent formatting overlord telling you when or not your formatting is consistent. your first example would be a parse error about undeclared users-churn-rate
What if users is 10 and churn-rate is 3 and i want to substract the churn-rate from users?sub Σ(@array_to_sum) { return [+] @array_to_sum; }
say Σ (1,2,3,4); # It will display 10
No risk, no fun.
If I chose Perl 6, what's a nice Sinatra-esque thing, and is there an ORM? And how do I deploy it and run it in production (copy it into cgi-bin?!)?
But unfortunately it seems that Perl6 is Rakudo and they've developed a Rakudo specific VM. Maybe that's best for Perl6 the language, but it also makes it less interesting for me.
You're correcting people, but sort of wrong yourself.
Rakudo is written in NQP and Perl 6 AFAIK, but NQP can be implemented for different VMs. A while back it worked on Parrot, MoarVM and JVM. I'd say keep Rakudo, but add more backends such as CLR/.NET, WebAssembly/LLVM.
However, systems management, deployment, provisioning, data aggregation, log/event analysis, etc. on a large scale becomes more important by the day, and if there is an area where Perl is still quite popular, it is in those back end tasks. There are trendy tools in newer languages, but you'd be hard press to find very large deployments (at least on Linux or other UNIX) without a few hundred thousand lines of Perl running some elements.
Perl 6 with concurrency built-in, grammars and the most advanced regular expression engine in the world, seems very well-suited for that future. Being somewhat familiar for old school sysadmins who've always relied on Perl for their scripting tasks is a bonus (Python has made some inroads in that space in recent years, particularly with Red Hat and Ubuntu/Debian shipping many system utilities that are written in Python).
Anyway, on the web front, I think we need a reasonable database abstraction layer (e.g. Perl DBI/DBD), at the very least, before it gets elevated to "always available" on hosting providers. I'd say give it another year, and we'll have a pretty good Perl 6 web development ecosystem to work with.
The first major implementation of Perl 6 back in the early/mid 00s was Pugs written in Haskell where Perl 6 picked up a tonne of functional heritage both in the compiler at the time and the language spec. The more recent Rakudo compiler has a lead architect who often works in C# where the compiler and the language spec picked up and redefined a reactive programming concurrency model with lots of nice new syntax like the react/whenever block.
Rakudo Perl 6 and Pugs and the host of other early implementations have been around a while and released often when they were worked on, monthly in the case of Rakudo with the first publicised release in 2010. Rakudo is also releasing a version of the compiler compliant with the newly frozen and released specification.
https://news.ycombinator.com/item?id=10793029
which already made the front-page.
This release is about nailing down the language with a compiler that passes a test suite. Next comes a focus on improving what they have -- nailing bugs, speeding it up and expanding the test suite while making sure it continues to pass the test suite and keeps users' code running.
I'd expect some benchmarks to be published on #perl6 in the next few weeks.
Is the multi-vm approach anything more than a novelty or is this expected to be a feature, i.e. a common spec and intermediate layer with support for different backend VMs?
The JVM's JIT is pretty awesome once it gets well warmed up. MoarVM's JITing is much less impressive so far but it's early days.
The JVM will almost certainly always underperform relative to MoarVM in these two ways:
* Much poorer startup time (unless an evalserver "cheat" is used)
* Using much more RAM (I recall a report of something like 5x or so for typical code running on recent versions of the JVM backend compared with the MoarVM backend)
My understanding is that the multi VM approach is strategic for Perl 6, for the Rakudo Perl 6 compiler, and for the underlying NQP compiler toolchain.
The cherry on top of the public relations disaster that the introduction of Perl6 has been...
So there :p
WhatsApp had clients written in Java against J2ME.
JaneStreet is (apparently) killing it with OCaml.
iOS apps were written in Objective-C when the rest of the world hardly even heard of that language.
This site is written in a niche dialect of Lisp.
https://www.google.com/search?q=top+50+programming+languages
I came into programming little too late to even consider perl5. It's just something I've read through as part of setting up irssi script(s).
To me Perl6 seems fun based on the few things I've read and I don't see any reason not to give it a go. Sure I won't be using it in any "production" build anytime soon, but hey maybe its setup beats the hassle that ruby/rvm brings with it and maybe it's more fun than python.
How are they feeling about that decision now?
> WhatsApp had clients written in Java against J2ME.
Sure, because Java is the only option on those platforms.
> JaneStreet is (apparently) killing it with OCaml.
OCaml hasn't hit its peak yet, it's still on the way (slowly) up.
> iOS apps were written in Objective-C when the rest of the world hardly even heard of that language.
Again, because it's the only option on the platform.
> This site is written in a niche dialect of Lisp.
How're they feeling about that decision now?
There is a thing called a Slang where you can replace the Perl 6 grammar with a different one entirely. So you could write a Ruby slang and write Ruby in Perl 6. Unfortunately the design for slangs wasn't quite good enough yet for the Christmas release of ROAST the specification testsuite.
* Oh you're sticking with that confusing % for hashes, @ for arrays then $ for everything else... maybe maybe classes have been sorted out though.
* Hmm, why is the syntax for defining a class totally different to defining functions and variables everywhere else
* Well they can't have made anything WORSE. Oh fields can have minuses in them?? Packages exist and you can define them but you're not supposed to anymore?
* Well at least you can't totally rewrite the language in some arcane way which means every bit of perl you come across is totally different and unreadable for 45min while you work out what the custom DSL does. looks at phasers, Meta operators, fix'es sigh
Great that this has finally been released, but it really doesn't solve the problems that Perl always had that it is TOO expressive and too customisable, meaning it'll always be vastly different project to project. On top of that it doesn't have the things that people are really excited about now, which is channels, selects and other things that make async easy. I think that this would have been an amazing release when Ruby was getting popular, but I think it's a few years too late.
The claim is something like:
Some folk like distinguishing singular ($foo) and plural (%dict, @array) nouns even if some others dislike it.
Many human languages make the same sorts of distinctions to good effect which may give you pause for thought, especially given recent neuroscience emphasizing the apparent central role of natural language processing rather than math processing when folk comprehend code (the study I saw involved Java code fwiw).
Note that you can bind a name to avoid sigils:
my \foo = %; # bind foo to an empty dict
foo = :bar, :baz # foo now has two key/val pairs
> why is the syntax for defining a class totally different to defining functions and variables everywhere elseThe claim is something like:
Perl / Perl 6 are more serious than most other langs about variable scoping. Classes aren't closures and object lifetimes are different from lexical variables'.
> Oh fields can have minuses in them??
The claim is something like:
Many folk love that, eg lispers, and Perl isn't about telling experienced coders that they can not do things they consider elegant or useful.
> Packages exist and you can define them but you're not supposed to anymore?
The claim is something like:
You generally don't need to use the 'package' keyword because keywords like 'class' and 'module' are themselves variants on 'package' and do the necessary work of the 'package' keyword for you.
Perhaps you've read some doc that was written by someone who was learning Perl 6 and for whom English is a second language such as the learnXinY?
> Well at least you can't totally rewrite the language in some arcane way which means every bit of perl you come across is totally different and unreadable for 45min while you work out what the custom DSL does. looks at phasers, Meta operators, fix'es sigh
The claim is something like:
Perl 6 is a granularly malleable language. The features for empowering users to use this have been carefully designed to be sane but they can be abused.
> On top of that it doesn't have the things that people are really excited about now, which is ... things that make async easy.
The claim is something like:
Perl 6 has the things that people are really excited about now, including things that make async easy.
Perl 6 includes sweet concurrency, parallel, and async constructs.
I think you've read poor material or misinterpreted it.
> I think that this would have been an amazing release when Ruby was getting popular, but I think it's a few years too late.
Fair enough. Time will tell.