Re:Perl 11
by AnimalMuppet on Wednesday October 24, 2018 @12:19AM
(#18289705)
The kind of quick scripts I use Perl for involve picking interesting bits out of text files. Honest question: Would you use Haskell for that? If so, why? And how?
[ Parent
| on HN ]
Re:Perl 11
by 3rdAccount on Wednesday October 24, 2018 @06:53AM
(#18291255)
I'm with you here. It's not that Haskell isn't a good language, but that scripting languages are really good at scripting :)
Haskell does have a good REPL and being able to distribute a binary when finished is really nice.
You can also run Haskell in interpreted mode, so it is actually a viable choice for scripting.
Re:Perl 11
by 3rdAccount on Friday October 26, 2018 @09:42PM
(#18313921)
It's viable, but certainly not designed for that sort of thing like Perl, Python, Powershell, Awk, & Bash. Many of those languages have built in niceties for scripting such as Perl's myriad of command line switches and well, everything about Powershell. They're optimized for shorter programs where Haskell is optimized for helping you write higher quality code.
Try the turtle library, after using it it would certainly feel for you like it was designed for scripting, it’s such a joy to use!
Re:Perl 11
by marcosdumay on Wednesday October 24, 2018 @04:39PM
(#18296147)
Are you kidding? Haskell is the language for picking stuff out of text files. Unless Perl got a complete transformation on the 5 to 6 change, it isn't even on the same league.
Re:Perl 11
by AnimalMuppet on Thursday October 25, 2018 @11:47AM
(#18301809)
Could you be a bit more specific about what makes Haskell the language for this? I'm not sure it's going to be more comprehensible than Perl, for those who don't write Haskell full-time. I'm not sure it's going to be easier to read through the lines of an input file than it is in Perl, and I'm not sure it's going to be easier to apply regexes to lines than it is in Perl.
Is one of those assumptions wrong? Can you state why it's wrong?
Or do I need to adjust my sarcasm detector?
You could argue that Perl 6's grammars are a complete transformation. Please see https://docs.perl6.org/language/grammar_tutorial for more information. Note that Perl 6's grammars are used to parse Perl 6 code itself, so it's powerful enough to build complete language compilers out of.
Re:Perl 11
by marcosdumay on Thursday October 25, 2018 @11:34AM
(#18301685)
Cool, Perl6 gained a native context-free parser. Yeah, that gets it in the league, I would have to compare it with Python parser libraries to decide what's better.
But not, Haskell and Prolog are still leaders here, with Haskell currently having the lead.