Live data from Hacker News

Haskell to Perl 6

docs.perl6.org

21–30 of 136 posts

Re: Haskell to Perl 6

#21

Earlier quoted context omitted.

No, it's designed. It's just not designed the way everyone expects a computer language to be designed. It was designed by a linguist. He produced a language with some of the flexibility (and messiness) of human languages, which is completely foreign as a goal to other languages. One of the places this shows up to me is being able to say "it" (in essence). That is, we humans, when talking to each other, we say things…

Except the resulting code will look nothing like “the humans say it”, and instead will be a cryptic charade requiring a ton of knowledge to decipher - ending up being neither natural language nor machine code.

Why would Perl repeat the same mistake as others, of trying to treat a programming language too much like a natural language? It's optimized to be read as a programming language, not anything else.

Also, "cryptic charade" could be a good name for what all non-Perl 6 languages call "regular expressions". It would make an even better name for a prog rock band.

Re: Haskell to Perl 6

#22
The lack of maybe or nullable types in perl6 with the need to check for definedness at run-time (Int:D) is one of its major design blunders. Also this syntax!

In cperl I rather use proper maybe types as in every other language. ?Int is (Int | Undef) you cannot use Int? as this would confuse the parser to look for the matching :

Re: Haskell to Perl 6

#23

I'd like to hear opinions on how the use of sigils and the other syntax oddities like Int:D, Int:U, given, when, etc improves the codabliity/readability of Perl 6 vs other languages. The examples vs Haskell are not helping me understand. Personally I don't think the added verbosity is helping in any way.

If Perl is too verbose for you, you can always go to APL.

Re: Haskell to Perl 6

#24

Earlier quoted context omitted.

No, it's designed. It's just not designed the way everyone expects a computer language to be designed. It was designed by a linguist. He produced a language with some of the flexibility (and messiness) of human languages, which is completely foreign as a goal to other languages. One of the places this shows up to me is being able to say "it" (in essence). That is, we humans, when talking to each other, we say things…

Except the resulting code will look nothing like “the humans say it”, and instead will be a cryptic charade requiring a ton of knowledge to decipher - ending up being neither natural language nor machine code.

A lot of that "cryptic charade" comes straight out of the UNIX environment. To those familiar with this, it was/is hardly "cryptic".

Re: Haskell to Perl 6

#25
post #4

It seems to me that Haskell programmers are the least likely to need something like this.

To be interested in programming languages generally, I think, is an inherent feature of a passionate programmer.

Being neither a Haskellian nor a Perlist, I found the article interesting and I think you nailed the reason why.

Re: Haskell to Perl 6

#26
post #14

Earlier quoted context omitted.

I've never used Perl6, but it took me about 30 seconds to figure out what 'say' and 'gist' do from the linked docs? 'gist' prints a string representation of an object aimed at being human-readable at the expense of not necessarily being a complete representation (e.g. the doc page gives an example that an array has only its first 100 elements printed followed by a '...'). 'say' is a version of 'put' that does this fo…

So, I sort of took that away from it, but there's stuff in the gist page like: > The default gist method in Mu re-dispatches to the perl method for defined invocants, and returns the type name in parenthesis for type object invocants. Many built-in classes override the case of instances to something more specific that may truncate output. And I have no idea how anyone that isn't already fluent in Perl 6 is expected t…

I have no problem reading that. Sure, I dont understand it in fine technical detail (what's Mu? An implementation of Perl? A codename for Perl 6?) But I believe I understand enough of it to start using it.

This specific example seems similar to the __repr__ vs __str__ thing in Python, and not very alien at all.

Re: Haskell to Perl 6

#27
post #14

Earlier quoted context omitted.

I've never used Perl6, but it took me about 30 seconds to figure out what 'say' and 'gist' do from the linked docs? 'gist' prints a string representation of an object aimed at being human-readable at the expense of not necessarily being a complete representation (e.g. the doc page gives an example that an array has only its first 100 elements printed followed by a '...'). 'say' is a version of 'put' that does this fo…

So, I sort of took that away from it, but there's stuff in the gist page like: > The default gist method in Mu re-dispatches to the perl method for defined invocants, and returns the type name in parenthesis for type object invocants. Many built-in classes override the case of instances to something more specific that may truncate output. And I have no idea how anyone that isn't already fluent in Perl 6 is expected t…

My takeaway from that is it’s basically Go’s Stringer() but with a default method so even objects without String method can still return a string.

Quite a few languages have that kind of feature though I believe. PHP has print_r and var_dump, Perl 5 had Data::Dumper, Python has tools too which I forget the name of.

I like how Perl 6 has baked it into the language though rather than making it a part of the standard library.

Re: Haskell to Perl 6

#28
Not to be trollish, but is anyone actually using Perl 6 for more than just for kicks? It is a super interesting language, but has it been battle tested over the years similar to Perl 5?

Re: Haskell to Perl 6

#29
post #4

It seems to me that Haskell programmers are the least likely to need something like this.

Right. This is like saying "Hello most elite gamers, here is an entry level tutorial to Duke Nukem Forever..."

Duke Nukem Forever jokes, really? Look, Perl 6 can either be a "crazy complex" language that is "over-designed" and "hard to read", or it can some sort of toy with laughable complexity (your supposition is that Perl 6 is to elite programmers as Duke Nukem Forever is to elite gamers).

So which is it? Complex enough for only elites to grasp? Or just some toy language with no real capabilities, let alone unique features of interest to elite programmers?

Re: Haskell to Perl 6

#30
post #26
post #14

Earlier quoted context omitted.

So, I sort of took that away from it, but there's stuff in the gist page like: > The default gist method in Mu re-dispatches to the perl method for defined invocants, and returns the type name in parenthesis for type object invocants. Many built-in classes override the case of instances to something more specific that may truncate output. And I have no idea how anyone that isn't already fluent in Perl 6 is expected t…

I have no problem reading that. Sure, I dont understand it in fine technical detail (what's Mu? An implementation of Perl? A codename for Perl 6?) But I believe I understand enough of it to start using it. This specific example seems similar to the __repr__ vs __str__ thing in Python, and not very alien at all.

Thanks for pointing out this Python similarity!
Post reply on HN