27 ms·
Why I’m Learning Perl 6
- aduitsis 9y agoRead the article, very informative. Pleasantly surprised to find out that it doesn't mention at all language traits like syntax, but focuses on the features of Perl6's underlying VM, specifically MoarVM.
- agumonkey 9y agoIndeed, a GILless bytecode VM is worth a look.
- rurban 9y agoGIL less yes, but not lockless. The previous perl6 VM, parrot, had lockless threads, scaling linearly per native core. MoarVM even needs to lock on hash or array accesses, which is certainly not state of the art.
- oconnor663 9y agoHow did parrot write arrays from multiple threads without a lock somewhere in there?
- bigleagueposter 9y agoThe parrot threads didn't communicate with each other and you could wait until all of them finished. They provided a tiny subset of the functionality real threads offer but in a more efficient way.
- rurban 9y agoYou deferred updates to the owner via scheduler, with high prio, and continue. parrot threads are lock free but not wait free. The NQP compiler needed to know about threaded writes and schedule the update, with a semaphore, while the other threads continue. What MoarVM got better was everything else. The GC, the calling convention, the OO (6model), the jit. I was on my way to fix all the parrot damage done from the previous decade, because this would have enabled all architectures and proper threading for perl6, but then perl6 decided to kill it and go with Moar. And spread a lot of lies on threads.
- pierrebai 9y agoI fail to see how using a semaphore to schedule work in another thread is "lock-free."
- rurban 9y agoBecause you wait but you don't lock. And the wait is not 100x of an instruction, normally it's the same time as for one single instruction. Writes are fast and atomic, because there's no lock. Only the writer needs to wait a bit, not any other thread. Google for lock-free vs wait-free
- petre 9y agoWell, it should have mentioned Perl6 uses rational number math instead of floating point. I think this is a big advantage, since you can do more precise calculations using just the core language.
- ricardobeat 9y agoCrystal (http://crystal-lang.org http://crystal-lang.org) has fibers and channels. Current implementation isn't multi-threaded but it's being worked on. So you'll get that concurrency + nice syntax + types + a wonderful stdlib. EDIT: as seen in other responses, options abound: Python 3, Elixir, D, Dart and more all have built-in concurrency primitives, not to mention that discarding nodejs because of "callback hell" is at this point laughable.
- giancarlostoro 9y agoNot sure about channels but D has fibers. It is one reason / benefit of why vibe.d[0] was made. [0]: http://vibed.org/features http://vibed.org/features Note: Vibe.d is a web frameworks as well as a networking stack for D. If you're even remotely curious about D or do any web development I recommend you check out Vibe.d it is quite impressive (at the very least to me). Edit: There's apparently jin.go / Go.d: https://github.com/nin-jin/go.d https://github.com/nin-jin/go.d
- holydude 9y agoI am really,really excited about Crystal. I wish it success but I am afraid if the rails shops and big companies do not start using it it will be too little too late.
- goatlover 9y agoThat would be unfortunate. I really like Crystal as a fast, typed alternative to Ruby, but I also prefer Ruby as a language to Go or even Elixir, which not everyone does.
- _pmf_ 9y ago> Concurrency is hard and if you want M:N thread multiplexing (i.e. WEB SCALE CODE, where application threads aren’t pinned to pthreads) your options today are precisely Erlang, Go, .NET, and Perl 6 Why mention .NET here? Async code in .NET works with a dispatcher thread (-pool) under the hood, which is nothing like the greenish threads that the other systems offer. Am I missing something?
- pjmlp 9y agoTPL, tasks are the greenish threads you mention. You can also just call Windows fibers directly, if feeling adventurous.
- poooogles 9y agoI mean core async in Clojure works the same, would you say it's the same? It might not be under the hood, but as perceived to the programmer it is?
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- throwaway7645 9y agoPerl6 is indeed a very nice language that I've been watching for a few years. As soon as the performance beats Python and the stability is solid I'll probably switch over from Python...there's just a lot there.
- b2gills 9y agoI have seen examples where the naive Perl 6 implementation is faster than the equivalent C code. (The one I'm thinking of is probably owing to Spesh and the JIT, but I forget what it was about) Here's an example where a naive Perl 6 version is going to beat the pants off of the naive version in another language: Find the sum of all integers from 10 to 1000000 inclusive. In Perl 6: say [+] 10 .. 1000000 the [+] is a left fold using the &infix:«+» operator (&infix:«+» is left associative) This finishes almost immediately. (It also does so if the endpoint is 10¹⁰⁰⁰ or more) The reason is if you use the built in version of the &infix:«+» operator, it calls the sum method on the Range object. That particular method knows how to calculate the sum on the Range without iterating through the values. If you modify the &infix:«+» operator lexically it won't take that shortcut. This also works the same if you wrote it like this: say Range.new(10,1000000).reduce(&[+]) (There is syntax to omit either or both endpoints with both ways to create a Range) There are plenty of areas where Rakudo Perl 6 is slower than I would like, but for many uses it is fast enough.
- slackersc 9y agoThat's pretty cool! I started trying to learn perl6 and write my first interesting program. I have a copy of 'ray tracing in a weekend' and am trying to translate the basic ray tracer from c++ to perl6. It's remarkably slow right now.. It takes 1.5 minutes to generate an image. I tried to do the same thing in Julia and it takes 1.5 seconds. So I guess I must be doing something wrong!
- raiph 9y agoMaybe it'd be fun to hack on https://github.com/raydiak/pray https://github.com/raydiak/pray?
- IceDane 9y ago> Why is this important? Concurrency is hard and if you want M:N thread multiplexing (i.e. WEB SCALE CODE, where application threads aren’t pinned to pthreads) your options today are precisely Erlang, Go, .NET, and Perl 6. I guess the author doesn't know about Haskell? The concurrency story for Haskell is great, and using the right library, you can literally just define types for the routes for your backend and then ask it to generate JS for your frontend.
- aaron-lebo 9y agoedit: dumb snark, but the replies are useful
- IceDane 9y agoNo need for the snark. This isn't fanboyism, though I gladly admit that I'm fond of Haskell. I'm not just namedropping Haskell "just because". He claims those languages are the only one that have green threads. He's wrong. I corrected that.
- aaron-lebo 9y agoYou're right, that was overly snarky, but your post does come off as use Haskell -> magic. The concurrency stories for Erlang and Go are front and center, very well defined, and obvious. How do you get similar functionality in Haskell (specifically, what libraries do what you are talking about)?
- IceDane 9y agoThe library I was referring to is called servant[1]. It's a library for writing backends and clients in Haskell. I mentioned it because he said something about "webscale", but it doesn't have anything to do with concurrency. The go-to library for nice Haskell concurrency is probably async[2], which you can combine with stm[3] for very nice guarantees. If you're interested, there is a very nice, free book[4] on the subject. [1] https://haskell-servant.github.io/ https://haskell-servant.github.io/ [2] https://www.stackage.org/package/async https://www.stackage.org/package/async [3] https://www.stackage.org/package/stm https://www.stackage.org/package/stm [4] http://chimera.labs.oreilly.com/books/1230000000929/index.html http://chimera.labs.oreilly.com/books/1230000000929/index.ht...
- SeanDav 9y agoWithout a "Major" sponsor, or a "Rails" type killer application, Perl 6, or indeed any language, will struggle to get significant traction. It is of course possible to gain slowly over time, but with numerous languages competing, that path may be a dead-end.
- forinti 9y agoPerl 6 still has to overcome Perl 5, which is everywhere and is a great language. I never get around to using Perl 6 because 5 is already there in every Linux distribution.
- bjd2385 9y agoI wish Linux distros shipped with more recent language versions, e.g. Python 3.6 and Perl 6 in addition to just 3.4/5 and 5. I understand that it's not their job to try and push people to update their language skills, but it'd be nice to have access to them right off the bat if they feel like it.
- riffraff 9y agopython3.x vs 2.x is nowhere near the jump from perl5 to perl6. It's basically a different language that shares some things, with few users. It would be nice to see it shopped, but you might as likely wish distribution shipped with crystal or nim.
- bjd2385 9y agoHey, it was a wish lol. I know we live in the real world here
- chriswarbo 9y agoThe difference between Python minor versions (e.g. 3.4 to 3.6) is tiny compared to the difference between Perl 5 and 6. From what I've seen, the difference between Python 2.x and 3.x is tiny compared to the Perl 5/6 change.
- mapcars 9y agoIt's terrible that you put Erlang on a list with other languges/VMs. >There’s no GIL, so unlike Those Other Languages There is no GIL in EVM as well, but playing with the words you make it look like "all are the same". This does not deserve top HN and just stupid. If your Perl6 VM is _so_ great, why didn't you mention anything about what's really important like preemptive scheduling which has been Erlang's unbeatable feature since the beginning? Less hype and more details, please.
- macintux 9y agoFWIW, the author is very well-known and respected in the Erlang world for his work on Chicago Boss. Any perceived slights against Erlang are likely unintentional.
- b2gills 9y agoThe author of the article likely hasn't dug much into the VM code yet. https://github.com/MoarVM/MoarVM/#feature-overview https://github.com/MoarVM/MoarVM/#feature-overview
- jypepin 9y agowhy is everybody saying they are put off by Go? Did we pass the "trend" phase and now it's cool to say go sucks?
- kalekold 9y agolol no generics
- notamy 9y agoTongue-in-cheek answer: lol no generics :) To be serious, in my circle of developer-friends, we feel that it tries to be TOO simple, and disagree with some of the decisions of how the language works (ex. seemingly endless `if err != nil { return nil, err }` type things)
- codegladiator 9y agoI always find it a bit funny when dev's try to put a label of "too simple" on a language. How would your friends label "brainfuck" ? Too simple because it has very limited number of identifiers or Too hard because accomplishing anything is nightmare ?
- kazagistar 9y agoSimple is not the opposite of hard. The opposites are complex and easy.
- FungalRaincloud 9y agoI don't know about others, but I personally have always seen Go as an internal language for Google. This made me feel like it was appropriate for projects that I personally control, but unlikely to be useful in a career. That's really just a feeling, though, and I recognize that if everyone felt like I do, it would make Go a niche language that was actually probably pretty lucrative to know. So I wouldn't say I'm put off by it, so much as the balance of factors hasn't tipped in favor of learning it yet.
- 9y ago
- rastapasta 9y agothanks for touching the heart of an old perlmonk :)
- krylon 9y agoCan anyone recommend a good book on Perl 6? Are there any (even bad ones)? Right now I feel the major reason that keeps me from investing time in Perl 6 - besides adoption by distros - is the lack of a good book, like the Lama and the Camel book for Perl 5. It's kind of frustrating after having waited so long.
- totalperspectiv 9y agoThis one is 'in progress' https://www.learningperl6.com/ https://www.learningperl6.com/ Looking at the Perl 6 website, there are a few more coming along as well. https://perl6.org/resources/ https://perl6.org/resources/
- sigzero 9y agohttp://greenteapress.com/wp/think-perl-6/ http://greenteapress.com/wp/think-perl-6/
- perlgeek 9y agohttps://perl6book.com/ https://perl6book.com/ gives an overview of Perl 6 books, and how they differ. Enjoy!
- krylon 9y agoTo all who answered: Thank you very, very much!!!
- _delirium 9y ago> adoption by distros This has improved, and I think most distros now ship Rakudo (Perl6 on MoarVM). At least: Debian, Ubuntu, Fedora, and Arch do.
- StevePerkins 9y ago> Concurrency is hard and if you want M:N thread multiplexing (i.e. WEB SCALE CODE, where application threads aren’t pinned to pthreads) your options today are precisely Erlang, Go, .NET, and Perl 6. Putting aside the "web scale" jokes (http://www.mongodb-is-web-scale.com/ http://www.mongodb-is-web-scale.com/), this statement is still absurd. Every major language, or at least the ones that matter for backend development, has support for thread multiplexing / coroutines / fibers, whatever. Perhaps not in the core language syntax or standard library. But it's easy to implement with native code, and so SOMEONE has implemented it in a library if the language has an FFI. Java, and all of the other JVM-based languages in turn, have Quasar (http://docs.paralleluniverse.co/quasar/ http://docs.paralleluniverse.co/quasar/). Ruby has support for primitive fibers baked into the standard language (https://ruby-doc.org/core-2.1.1/Fiber.html https://ruby-doc.org/core-2.1.1/Fiber.html), and likewise community gems with more robust functionality like Quasar. Python 3 likewise has this out of the box (https://www.python.org/dev/peps/pep-0492/ https://www.python.org/dev/peps/pep-0492/). The list goes on and on: https://en.wikipedia.org/wiki/Coroutine#Programming_languages_with_native_support https://en.wikipedia.org/wiki/Coroutine#Programming_language....
- rootlocus 9y agoI'd like to know why people are downvoting this.
- dragonwriter 9y agoProbably because it treats a high-level feature (M:N threading) as equivalent to a lower-level feature (coroutines) and then compounds that by treating as equivalent languages where the former is built into the core with ones where the latter is available as a third-party library, all as a way of dismissing the value of languages where the former feature is built in to the core, and layered with scorn and derision on top of being doubly wrong. Now, I preferred correction to downvoting, but I can easily see why others would choose downvoting.
- thehardsphere 9y agoPeople often downvote anything that's remotely negative, even if it is true or merely a critical question.
- fundabulousrIII 9y agoI'll stick with Tcl if I'm going to use a glue language that has green thread like functionality and an event loop. early choices were tcl or perl: went Tcl and never looked back. As far as web development in perl..well have fun convincing everyone on the node.js and python bandwagons to move 'back' to perl. Glad it works for you.
- totalperspectiv 9y agoI hadn't heard of Tcl before but it looks awesome! What do you find its ideal use cases to be?
- forinti 9y agoI use Tcl/Tk from time to time and it always seems the easy choice when I need a simple GUI and also need to make an executable for Windows (which is trivial with Freewrap). Some of the things I've written are: a simple standby order input app, a Forms/Reports compiler (sends file to server, waits for response and informs user), and a Ghostscript wrapper for merging lots of PDFs into one file.
- totalperspectiv 9y agoAwesome! I'm definitely going to be keeping it in mind as little projects come up that could use a GUI.
- williadc 9y agoTCL is really great for throwing syntax errors at runtime, having no real data structures, and an inconsistent API!
- logicchains 9y agoBetter than throwing syntax errors at compile time; saves the programmer time. By the time errors happen, it's the customer's problem instead.
- 9y ago
- ainar-g 9y agoCan Perl6 merge all of its generated VM code into one "package"? One of my favourite things about Go is that you can statically compile everything and then deployment basically becomes scp.
- rlpb 9y ago...and then deployment basically becomes scp. And security updates for your deployment become...what?
- sherr 9y agoRebuild and scp the whole lot again? Not necessarily a big deal.
- rlpb 9y agoRebuilding by pulling in all your dependencies from the Internet again? That's not something I want to do when the clock is ticking to get a security update out. What if some random third party dependency is hosted somewhere that is down, or has been pulled? And how do I know I have to rebuild in the first place? You'll probably tell me that there are tools to help deal with this. I'm sure there are. My point is that it isn't as simple as "scp".
- xutopia 9y agoOr doing patches. Copy the file locally... apply the patch... restart process.
- hpcjoe 9y agoI find it somewhat humorous that more than 25 years on, we are effectively reverting to static linking and bundling [1]. Way ... way back in the day, the argument was it would save memory, encourage reuse, etc. While some of this may have been true, it also gave rise to dynamic library hell. Reuse was overshadowed by incompatible versions, or API changes between versions that became the stuff of legends. This would make a great study in how the ROI was completely overshadowed by risk considerations not considered at the outset. Of course, saving memory was a huge issue in the days when 1GB RAM was considered gigantic. So maybe the cost was worth it. [1] https://scalability.org/2017/03/what-is-old-is-new-again/ https://scalability.org/2017/03/what-is-old-is-new-again/
- pmontra 9y agoOn a sidenote > or Nginx or Node.js without the callback cacciatore. What's a cacciatore in this context? It means hunter in Italian. Probably something messy if it means the same as callback hell.
- credit_guy 9y agoI read it as a short version of chicken cacciatore, which is a dish with an appearance that may look messy.
- Sean1708 9y agoThat makes sense I suppose, it's a cacciatore made with callbacks instead of chicken.
- dagw 9y agocacciatore is a style of rustic stew in Italian cooking.
- riffraff 9y ago"alla cacciatora" is the name of the style in Italian, that somehow got mangled in english. Kinda like "gabagool" which is effectively an american only name for an italian product we call "capocollo". pmontra is italian, hence the confusion.
- pmontra 9y agoI would have bet that cacciatore was about food. To be pedantic, that's "alla cacciatora" but I won't be picky with Italian food terms outside Italy, it's good advertising anyway (I'm an Italian in Italy.)
- orbitur 9y ago> To be pedantic, that's "alla cacciatora" but I won't be picky with Italian food terms outside Italy It's good that you won't be picky, since you're arguing against decades of "cacciatore" for Italian Americans. ;)
- Rjevski 9y agoMy personal issue with Perl is how much of a mess the syntax is (10 different ways of doing the same thing), and the lack of a standard library (CPAN is not a viable replacement).
- IslaDeEncanta 9y agoWhy is CPAN not a viable replacement? It has always been perfectly viable for me.
- Rjevski 9y agoCPAN packages are written by thousands of different people with varying styles (cf. the issue with 10 different ways of doing the same thing), quality standards and maintenance schedules. In Python I can expect the standard library to be consistent and be maintained as part of the core language. Now I don't mean that everything has to be in the standard library (I'm fine with the database access libraries being third-party for example), but in Perl even the most basic stuff like exceptions is only on CPAN and there are again multiple packages to choose from..
- b2gills 9y agoUnfortunately for Python is that many/most of the modules that are included were written when the language was fairly new, so at a time when nobody was an expert in the language. Which means that perhaps for many of them there is a better module out in the ecosystem that almost nobody uses because they have one extra step to install them. If you want something close to that in Perl 6, just install Inline::Python and you can use all of those “batteries included” with Python as if they were modules written in Perl 6. Exceptions in Perl 6 are much easier to deal with than they are in Perl 5.
- yellowapple 9y agoI'll take 10 different ways to do the same thing with different approaches over one "true" way with no flexibility any day. Perl gives the programmer a lot of rope to work with. Whether one ties that rope into a drawbridge or a noose is the programmer's choice. Also, CPAN is fantastic and widely supported. I really wish more languages would follow its example, especially when it comes to package namespaces.
- grondilu 9y ago> Guess what it outputs? Nothing! Just kidding, you’ll see a lot of distressed messages from tasks that passed out wait for the phone to ring, and woke up wearing someone else’s OS thread. Well, as a matter of fact I really got no output at all :(
- libeclipse 9y ago> Actually, the program will output nothing if you’re using a release of Perl 6 prior to Rakudo Star 2017.07; a caching bug previously caused $*THREAD.id to report an out-of-date value.
- pvdebbe 9y agoI like writing bash scripts a lot and perl is a natural step-up with powerful libraries to use. As others have said, the major obstacle for me has been the lack of great literature.
- yellowapple 9y agoThere's lots of literature out there for Perl 5 (like the so-called "Camel Book"). Perl 6 literature is pretty scarce, though.
- throwaway7645 9y agoThere is 2 out now and many in development. So really not that bad.
- cygx 9y ago2? It's 5 now! https://www.apress.com/us/book/9781484228982 https://www.apress.com/us/book/9781484228982 http://shop.oreilly.com/product/0636920065883.do http://shop.oreilly.com/product/0636920065883.do https://deeptext.media/perl6-at-a-glance/ https://deeptext.media/perl6-at-a-glance/ https://deeptext.media/migrating-to-perl6 https://deeptext.media/migrating-to-perl6 https://www.amazon.com/Learning-program-Perl-Getting-programming-ebook/dp/B07221XCVL https://www.amazon.com/Learning-program-Perl-Getting-program...
- throwaway7645 9y agoNo idea the other ones came out so fast :)
- dmytrish 9y agoFor small tasks I enjoy aesthetics of small dedicated Unix tools (grep, sed, awk, cut, sort) working together much more. Perl tries to be everything at once, still mysteriously lacking interactive REPL out of the box. Yes, Python is more heavyweight for scripting, but it pays in the long term with better maintenance and tooling for big scripts.
- libeclipse 9y agoThing that really gets me about perl is the syntax, it's horrendous. No other reason, that's all. Just the syntax.
- tankenmate 9y agoBlame Aho, Weinberger, and Kernighan. Oh and Larry :)
- tannhaeuser 9y agoWhy are the awk guys to blame for Perl syntax?
- tankenmate 9y ago> (It's sorta like sed, but not. It's sorta like awk, but not. etc.) Guilty as charged. Perl is happily ugly, and happily derivative. Usenet article <1992Aug26.184221.29627@netlabs.com> (1992) -- Larry Wall
- vgy7ujm 9y agoI don't see the problem here... those are good tools and Perl have those tools power in the core language++ Good stuff if you ask me.
- fnord123 9y agoThe good thing about awk is that it's limited. So you know when to stop using it and move to use a different language when your requirements exceed the comfort zone of awk. Larry Wall came and made a language inspired by awk that doesn't give feedback on when you're out of the comfort zone. This lets you make a mess before you know what you've done (aka technical debt). The same problem 'that killed Smalltalk and could have killed ruby' too (thanks, Bob Martin).
- Scarblac 9y agoIt's _different_. But working for a few years with Perl 5, it really grew on me. It could use a good "Perl: The Good Parts" book, I guess. I haven't looked at Perl 6 yet, don't know if that's better or worse. Too many other things to do, and I don't think I'll ever work with Perl professionally again, that ship has probably sailed.
- contingencies 9y agoGreat quote on perl5... In #devops is turtle all way down but at bottom is perl script. - @devopsborat
- tripa 9y agoI like how the original was agnostic, yet you interpreted as perl5 :-)
- contingencies 9y agoI think it's common knowledge that perl6 is basically rare in deployment, whereas perl5 scripts are everywhere in legacy systems. Former CPAN author myself.
- Steeeve 9y agoI hate perl6. I hate it because I tried to get involved in the project early on, and it led me down the Haskell rathole. I don't know what Haskell looks like today, but a decade or more ago it was the hardest language to pick up that I had ever experienced. It was as if I had a solid background in latin languages and I was trying to pick up Chinese based on a handful of tutorials written by a tourist on the back of a napkin. But it has been a decade and I am truly impressed with what it has turned into. Unfortunately, it has to re-gain mindshare as if it was starting from scratch. It might be a little bit harder actually, because there are a variety of scripting languages these days that are easy to learn, and there are still more than a few people who actively don't like Perl. I really liked this slideshow: http://tpm2016.zoffix.com/#/ http://tpm2016.zoffix.com/#/ It gives a good review of Perl6 from early 2016. The video is an hour and a half, but it only takes a few minutes to scan through the slides and find the interesting pieces. (left and right arrow to navigate the slides)
- txdv 9y agoI looked quickly through the slides and saw that perl has now grammar build in the language... Truly an interesting feature
- perlgeek 9y agoIt is. You can build recursive descending parsers with a declarative syntax, and all the benefits from having it in OO (role composition, inheritance). Here is a working grammar for INI config files: https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm#L5 https://github.com/tadzik/perl6-Config-INI/blob/master/lib/C...
- dmytrish 9y agoIs the language itself a good place for parsing/grammar handling? I could not even find in the standard documentation which kind of parsers it supports, is it LR(k)? LL(k)? Any CFG? What parsing method does it use: recursive descent, shift-reduce, something more general like CYK/Earley algorithms? How does it handle ambiguities? It turns out that `grammar` keyword generates recursive descent parsers and anything even a bit fancier still requires a dedicated parsing library.
- Verdex_2 9y agoFor some reason, when I started my software engineering career I got it into my head that I needed to learn as much as I could about programming languages. I learned ruby, perl5, python, lisp, forth, ml, ocaml, scheme, haskell, r, c#, java, lua, c++, factor, idris, asm, erlang, prolog, rust, d. But that wasn't quite enough because haskell and idris kept on talking about complicated type theory stuff. So I also learned lambda calculus, type theory, set theory, domain theory, topology, category theory, information theory, sub-structural logic. What I'm trying to say is that I'm not afraid of learning new things. Even if they seem hard or esoteric. When I heard that perl6 was ready, I took a look. I like the idea of a lot of what is present in the language (hey look, a grammar engine, that's neat). But ultimately, I decided that it was too much stuff that I would have to learn. Maybe that's just a perception problem on my part, but I have to think that they have some sort of problem if someone like me feels overwhelmed by all of the things that you have to grok in order to understand the language.
- throwaway7645 9y agoThink of it as incorporating many of the features in all of the languages you mentioned above, but in one language that is designed to grow. The language can easily be enhanced both officially and by the end user. So not too many new concepts for you, just a different syntax.
- lixquid 9y agoThat's understandable; if you look at the slides and see all of the integrated features in one big blast, you're going to think "holy moly this was not meant for mortal men". In a way that's correct, because ultimately Perl6 is designed as the ultimate "kitchen sink" language; it has all the little features you could think of already baked in, which will include a lot of features you won't use. The main reason for this stems from the overarching design philosophy; "There is more than one way to do something". The language ultimately tries to be as flexible as possible, going so far as to support modification the the core grammar, the object system, etc. This is meant to make the developer as comfortable as possible, but it can lead the common case of perl-itis, also known as "write-once, read-nonce" code.
- Thaxll 9y agoPerl is pretty much dead, I don't anyone still using that beside legacy code.
- ue_ 9y agoNobody's using P6 for legacy code.
- Thaxll 9y agoWhat kind of sane person who would use Perl ( 6 or older ) on a new project nowdays.
- ue_ 9y agoMe, albeit a small project, it was really fun to work on; it was an interactive blog.
- nocman 9y agoLots of "sane" people would (at least for Perl 5). I know it's not "the new hotness", but Perl 5 is still an incredibly useful language that a lot of people know (present company included). There are extensive libraries available for doing a lot of things that need to be done in day-to-day business. There are plenty of perfectly legitimate places to use it in new development. The Perl 5 porters development list has a decent amount of traffic ( http://www.nntp.perl.org/group/perl.perl5.porters/2017.html http://www.nntp.perl.org/group/perl.perl5.porters/2017.html ). And Perl 5 still has a good number of active contributors ( https://www.openhub.net/p/perl/contributors https://www.openhub.net/p/perl/contributors ). Also, The CPAN has plenty of modules with daily activity ( http://search.cpan.org/recent http://search.cpan.org/recent ). Even if you would not choose to do new development in Perl 5 (because of other language preferences, or whatever), that does not mean it is unreasonable (or "insane") for others to do so. Whether Perl 6 will ever catch on, I don't know. The language has a lot of features that look interesting, and I think it could also be very useful. I personally have not had time to look at it much yet, but probably will when I don't have higher priority things in life preventing me from doing so.
- 9y ago
- joosters 9y agoMaybe it's because I'm old, but I don't see the appeal of M:N multiplexing in a programming language (i.e. 'green threads' or some other user-level context switching) For long-running tasks, if they are I/O bound you can use non-blocking I/O and event loops. If they are CPU bound, then use threads or separate processes. The two techniques can be combined to scale well across multiple cores. The OS is designed to schedule workloads, it has decades of development in doing this, and has all the system-wide information needed to schedule tasks well across the CPUs. why re-implement the wheel in your programming language?
- le-mark 9y ago> For long-running tasks, if they are I/O bound you can use non-blocking I/O and event loops. If they are CPU bound, then use threads or separate processes. The two techniques can be combined to scale well across multiple cores. One might suppose this to be the case, but to my knowledge only network IO is truly non blocking, although there are async io api's in some languages for disk reads/writes, they're still blocking behind the scenes. One of the coolest things about go (imo) is it's scheduling of many go routines onto relatively few machine threads (and processes) for blocking IO. I'm not clear if Perl 6 has such a facility.
- j_s 9y agoI'm not an expert, but I think you're right for POSIX. Windows does apparently offer the necessary building blocks; this is the most relevant HN sub-discussion: https://news.ycombinator.com/item?id=9584269 https://news.ycombinator.com/item?id=9584269
- deleted 9y ago[deleted]
- lederhosen 9y agoaio - POSIX asynchronous I/O overview http://man7.org/linux/man-pages/man7/aio.7.html http://man7.org/linux/man-pages/man7/aio.7.html
- athenot 9y agoI'm glad Perl6 finally went the route of MoarVM. I always felt that ParrotVM (which was supposed to also run Python and Ruby) was a terrible distraction and scope creep. The idea was laudable but it would have required buy-in from the other communities. As much as I like Perl, I don't think that would have been fair to them, as Python and Ruby have evolved into their own respective identities.
- krylon 9y ago> The idea was laudable but it would have required buy-in from the other communities But imagine how cool it would have been - write a class in Python, sub-class it from Ruby, use that subclass in a function written in Perl, call that function from Lua code... Okay, I see it now. It was just too awesome for its time. Maybe in a hundred years or so...
- bigleagueposter 9y agoJVM is now becoming what Parrot was intended to be with Graal/Truffle.
- deleted 9y ago[deleted]
- mempko 9y agoBest argument to use Perl 6 is that it's fun. Like really fun. Whatever language you are using is boring. Perl 6 is just damn fun. It's like your favorite language but with dollar signs, and funner.
- qbaqbaqba 9y agoPerl5 is also fun. Until you have to work with others' people code, or even your own older code.
- raiph 9y agoMany P5 folk claim that it remains fun if the P5 code is well written. But regardless, having fun with P6, which is specifically designed to be readable, maintainable, composable, refactorable, etc. is fundamentally different from having fun with a language like P5.
- nige123 9y agoPerl 6 is indeed fun - it's even optimised for it [1]! I'm enjoying using it for command-line tools and web applications - it's expressive and scales with the problem space. 1. https://perl6advent.wordpress.com/2015/12/20/perl-6-christmas-have-an-appropriate-amount-of-fun/ https://perl6advent.wordpress.com/2015/12/20/perl-6-christma...
- jonbarker 9y agoDoes this not help with handling this issue in python or is this considered a hack? http://effbot.org/zone/thread-synchronization.htm http://effbot.org/zone/thread-synchronization.htm
- spion 9y agoNeeds a correction re: node.js. It does have await and does switch context now.
- saysorry 9y agoI ctrl+F searched these comments for the word "hipster", 0 matches. If this was about JavaScript though...
- hardwaresofton 9y agoIt's pretty cool to see Perl adding this feature. My rubric for the three big scripting languages (once upon a time?) was: Perl: Good at regular expressions, and proper per-processor core threading, Bad because what you wrote will be indecipherable to future you Python: Very expressive (without being too much), lots of library support, good drop-to-c/do-stuff-fast support, sensible support for object and functional programming paradigms that evolved over time, super useful stdlib. Bad because GIL Ruby: ???? at least it's beautiful? seems to only be used in codebases that are rails-based which is basically a red flag for me now due to personal preference It looks like Perl just got another killer feature
- b2gills 9y agoPerl 5's base object system was based on Python's Ruby has been referred to as Perl 5 with a better object system. Perl 5 also has Moose an object system based on Perl 6's which has been ported to Python and to Ruby twice. The way to allow calling into C with NativeCall is almost seamless most of the time. It has also been used to make using modules/libraries from other languages even more seamless. (usually the only way you know the module is from a different language is the :from<Python> in the use directive.)
- deleted 9y ago[deleted]
- 16bytes 9y agoEven though this could more properly be called, "Why having language support for M:N thread multiplexing is important", I thought it was a refreshing article on why I might actually use a bit of perl6. Last year I attended a conference and saw Larry Wall speak. It was an overview of Perl 6 and I was completely underwhelmed. Larry spent about half the time talking about unicode support. It wasn't a boring talk, but I never felt a moment when I said, "Awesome! This is a pain point in some other languages and I would pick up perl6 if this ever happened again." I don't want to write perl6 completely off, but I have found that perl6 advocates have not done a great job on why you would actually want to use it. It's hard to justify learning "different" syntax just because someone says, "hey, it's fun!".
- jxramos 9y agoI had saw an old coworker at a Python meetup group session the other week and I started to remember he and others had to support all these Perl scripts. Since leaving that place and seeing so much of Python everywhere I thought the other day where Perl wound up in the mix of things several years later. Seems like the community kept going.
- raiph 9y agoExtending Evan's analogy, perhaps trying to explain the joke ruins the joke?
- cutler 9y agoBetter math is one good reason. Grammars are also a great feature of Perl 6.
- 16bytes 9y agoI've never faced a problem in another modern language where math became a big problem. Even using something like numpy made never made me frustrated with, say, python's numerical types. From what I've seen perl6 makes some operations more convenient. Cool, I guess, but not a great reason to reach for perl6. Grammars are really cool, and one reason I might reach for perl6, but you also have really great special-purpose tools like Antlr. I suppose I don't feel the need grammars that often to need them reified in my language of choice, but next time I need to do some parsing, however, I will probably play around with perl6.
- Paul_S 9y agoThis would've been so much easier if they just called Perl 6 something else. Would've saved them so much aggravation.
- daotoad 9y agoYou aren't alone in thinking that. http://blogs.perl.org/users/zoffix_znet/2017/07/the-hot-new-language-named-rakudo.html http://blogs.perl.org/users/zoffix_znet/2017/07/the-hot-new-... https://github.com/perl6/marketing/blob/master/TablePosters/Rakudo-Concise/Rakudo-Concise--72ppi.png https://github.com/perl6/marketing/blob/master/TablePosters/...
- kazinator 9y agoAll I think about when I hear M:N thread multiplexing is "1992 is calling to have its stupid threads hacks back". M:N is what you do when you don't have real kernel thread support. You hacked N user space threads per process (N:1) but then 1990 rolled in and cheap SMP with M processors started to spread across the land, so you needed N:M to take a bit of advantage of that.
- deleted 9y ago[deleted]
- b2gills 9y agoPerl 6 has M:N thread multiplexing along with normal thread support. It's just that M:N thread multiplexing is easier to use because all of the hard work is done for you.
- cutler 9y agoPerl 6 carries 2 pieces of baggage from its predecessor - prefixing variables with "my" to create lexical scope and the obligatory "use v6;" at the top of every script. Why can't an advanced language like Perl 6 scope variables without littering "my" everywhere? You don't see it in any other mainstream language I can think of.
- kbenson 9y ago> prefixing variables with "my" to create lexical scope Some people (such as me), prefer designating variable scope and easily identifying where a variable was defined. By the way, that isn't required by Perl 5. It was decided by the community that it was beneficial in that it solved far more problems debugging than the small bit of extra effort required, so the common refrain to "use strict;" was adopted because with that pragma it then is required. > Why can't an advanced language like Perl 6 scope variables without littering "my" everywhere? It could, but the community has decided it's not really beneficial. Have you actually examined why you think it's better? > obligatory "use v6;" at the top of every script That's not obligatory. You can omit at your leisure. If you do in include it and your script is accidentally called from a Perl 5 interpreter, you will either get an error, or if supported it will try to load a Perl 6 interpreter to parse the code.
- cygx 9y agoprefixing variables with "my" to create lexical scope I strongly disagree: From a languge design perspective, block-level lexical scoping with explicit declarations is superior to all alternatives I'm aware of.
- petre 9y agoHow is this different than prefixing variables with var in JavaScript?
- dugword 9y agoJust to be pedantic ;) var creates variables that are function scoped. my creates variables that are block scoped. let in JavaScript would be pretty much the same as my. Both are good things as they prevent typos from being new variables.