Live data from Hacker News

Why I’m Learning Perl 6

evanmiller.org

111–120 of 380 posts

Re: Why I’m Learning Perl 6

#111
post #73
post #65

I 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…

I looked quickly through the slides and saw that perl has now grammar build in the language... Truly an interesting feature

It 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/C...

Re: Why I’m Learning Perl 6

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

https://perl6book.com/ gives an overview of Perl 6 books, and how they differ. Enjoy!

Re: Why I’m Learning Perl 6

#113
post #88

Earlier quoted context omitted.

PyPy has a GIL : http://doc.pypy.org/en/latest/faq.html#does-pypy-have-a-gil-...

Ok, but ZipPy, Jython and IronPython do not.

Have Jython and IronPython reached compatibility with Python 3 yet? Last I checked they hadn't, or it was still in alpha.

Re: Why I’m Learning Perl 6

#114

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?

If I move out of shell for scripting, I go to Tcl. I also write little utilities with Tcl/Tk to do repetitive tasks that I do often.

Re: Why I’m Learning Perl 6

#115
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?

For me, other than the fact that I don't need yet another Algol reimplementation in my life, I'm also not interested in code littered with error handling. Also strongly prefer FP.

I don't understand how some other language would not need to handle all the errors ?

I have written code in go/java/php/python/js and error handling has been a majority chunk of lines in most if not all cases(in other cases the errors are just not handled). The best ideal case flow is always easiest to build.

Re: Why I’m Learning Perl 6

#116

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. A lot of the territory it covered well is now better covered by other things.

One of its great strengths was being extensible. It's pretty easy to bake some functionality into Tcl and provide a new shell with it. This is what expect (http://expect.sourceforge.net/) is, for instance.

Another early advantage of Tcl was Tk, which provided Tcl extended with GUI stuff. Tk was cross-platform and established very early on, so if you wanted to provide one GUI for Unix, Mac and Windows, it was a good choice. It was very ugly for a long time; I hear it has gotten better lately but I don't know that myself. Tk is still built-in to Python as Tkinter. This is another specialty shell provided by Tcl, wish ("window shell").

Tcl was supposed to be good for embedding. The original author was supposedly using it for robotics. I haven't seen much energy there; I think Tcl's lunch probably got eaten by Lua some time ago. Lua is smaller, more like a modern programming language and easier to embed, but Tcl is more like shell scripting, so I guess there might be style reasons why you might prefer Tcl despite Lua's advantages.

Tcl is easy to disparage, but there's a lot of misinformation out there. At one time, it really only had one data type (strings). Quotation is a big topic in Tcl, but like Lisp, you can supply your own control structures. Everything is a command and commands have a lot of freedom about how to interpret their arguments. It is rather Lispy, unlike Lua. Tcl does have modern data structures and it does pretty snazzy things behind the scenes to optimize access to them while making things still seem to be strings for the cases where that matters.

Tcl is still around in some surprising places. I wouldn't expect there being a lot of new development starting with Tcl but it's kind of a fun language to know about. I got the newest edition of the book and it's a neat book, but I confess I haven't found ideal use cases for it.

Re: Why I’m Learning Perl 6

#117
post #21
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?

Tongue-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)

I 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 ?

Re: Why I’m Learning Perl 6

#118

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…

M:N threads exist because the operating system threads are too expensive (despite decades of development, OS threads operated at the wrong abstraction layer). If operating system threads scaled reasonably well, there would be (virtually) no need for M:N threads.

Re: Why I’m Learning Perl 6

#119

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've done some neat things with Tcl and Python.

Python comes with a C module for interacting with an embedded Tcl interpreter (Meaning Tcl and Python interpreters are running within the same process). It's mainly used for GUI programming from Python but the interface is generic enough to be able to write some nice iterop code.

For example, I have a library that seamlessly lets you use Python classes and objects from Tcl and vice versa.

From there we merged the Tcl and Qt event loops so that we could have PyQt widgets playing nicely with Tcl/Tk widgets.

This was all part of an effort to migrate from a Tcl/Tk codebase to Python/PyQt.

I wish I could share the code because it's kind of neat. Only around 600 lines of Python code to do all that magic.

Re: Why I’m Learning Perl 6

#120
post #9

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

Does Haskell have thread multiplexing?
Post reply on HN