Live data from Hacker News

Why I’m Learning Perl 6

evanmiller.org

101–110 of 380 posts

Re: Why I’m Learning Perl 6

#101

I'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.

I hadn't heard of Tcl before but it looks awesome! What do you find its ideal use cases to be?

TCL is pretty old school and doesn't get a lot of attention nowadays. The main use I'm aware of is in BigIP F5 config files. There are some really interesting things about it though, for example how control flow constructs (if/else, while) are implemented as commands, using built in uplevel and upvar[1] commands to control the scope of the currently executing code. Some people say it's lisp-like, that's one of the things they mean.

TCL has an interesting history, it's creator is also known for Ousthout's Dichotomy[2] which is useful when disambiguating between "scripting" and "other" languages (an argument that occurs frequently on the internet).

Antirez has written about TCL, if you're an admirer of him or his work (redis) you may find his take on it interesting[3].

[1] https://en.wikipedia.org/wiki/Tcl#Uplevel

[2] https://en.wikipedia.org/wiki/Ousterhout%27s_dichotomy

[3] http://antirez.com/articoli/tclmisunderstood.html

Re: Why I’m Learning Perl 6

#102

Earlier quoted context omitted.

I hadn't heard of Tcl before but it looks awesome! What do you find its ideal use cases to be?

TCL is really great for throwing syntax errors at runtime, having no real data structures, and an inconsistent API!

Better than throwing syntax errors at compile time; saves the programmer time. By the time errors happen, it's the customer's problem instead.

Re: Why I’m Learning Perl 6

#103
Maybe 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?

Re: Why I’m Learning Perl 6

#104

I'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.

Yup, Tcl is a really nice little language.

Re: Why I’m Learning Perl 6

#105
post #18

Can 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.

This one is 'in progress' https://www.learningperl6.com/ Looking at the Perl 6 website, there are a few more coming along as well. https://perl6.org/resources/

Nice, thank you very much!

Re: Why I’m Learning Perl 6

#106
post #94

Earlier quoted context omitted.

The 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.

I'm not extremely familiar with Perl 6 to be able to draw a comparison. From what I know about Python 2/3, it's that you can write maybe 90% on average/in general of your code the same way without much thought about the differences. However, if you do wish to adopt the new features, there's plenty to keep you busy writing scripts for at least a few months, maybe even a year.

Perl 6 is a different language from Perl 5. It's considered next in the "Perl family of languages". There are various things you can do to get interoperability between them, and run code from one in the other's interpreter, but the changes are much more pronounced that Python's 2->3 changes. It's closer to the difference between PHP and Perl 5. People familiar with Perl 5 will find a lot of the design decisions and concepts similar in Perl 6, but it will still be like learning a new, but similar, language to Perl 5.

Re: Why I’m Learning Perl 6

#107

Maybe 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 sche…

> 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.

Re: Why I’m Learning Perl 6

#108
post #15

why is everybody saying they are put off by Go? Did we pass the "trend" phase and now it's cool to say go sucks?

When a language is too popular it's being hated by HN / Reddit. If you want to stay cool you have to use a niche language.

Re: Why I’m Learning Perl 6

#109
post #18

Can 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.

http://greenteapress.com/wp/think-perl-6/

Re: Why I’m Learning Perl 6

#110

Earlier quoted context omitted.

For Python there is no native support for threads because of GIL. You can get around this through multiprocessing etc but these are hacks

There is native support for threads, it's just that they don't run concurrently.

While we're being pedantic, they do run concurrently (for example, dispatching a dozen concurrent HTTP requests), they just the GIL prevents most CPU work from executing in parallel.
Post reply on HN