News for hackers. Stuff that matters.
Re:Perl - the Detroit of scripting languages by fusiongyro on Wednesday July 31, 2013 @12:48PM (#6135072)
I'd say the onus is on Perl to be the best language for a niche, rather than on me to provide a list of niches with languages better than Perl.

Besides that, language appropriateness is necessarily subjective. I love Prolog and Haskell and use them all the time. My passion for them makes their thorns seem small and easily avoided, but the reality is that those thorns are sufficient to keep out a lot of curious people. I didn't really figure out how to write a Prolog program that handled command line arguments until a month ago. Prior to that, I would just run Prolog, consult my script and run my function. Simple enough barrier, but one that would have kept most of my friends away.

I think you took my "real X, Y, Z" list as a literal insult, which isn't what I meant. I don't know Perl. I was just referencing the presentation, not trying to sling arrows at Moose or whatever.

I do think that providing multiple options where most languages have one option built-in is unnecessary cognitive load. One doesn't "choose" an "object system" for Python--what benefit would one hope to gain? That the options are compatible is nice, but it's indisputably more work for everyone than just having one.

Having what are essentially language built-ins elsewhere available instead on CPAN is worth complaining about, because if you're going to do things differently from others, the difference should be motivated by something. That something in Perl is backwards compatibility and the desire to provide lots of options. The former is an explanation, not a rationale, and the latter implies, again, a cognitive cost. When you spend my attention and brain power, I had better get something in return. "Options" are only worth something if the alternatives are worth choosing between. In the case of OO, complete intercompatibility between them suggests the differences are minor; in that case, why have them?

Re:Perl - the Detroit of scripting languages by Mithaldu on Wednesday July 31, 2013 @01:30PM (#6135404)
The onus on one making broad statements and presenting them as fact is on the one making them. Note, i'm not really asking you to prove your statement. Just that you refrain from making such statements when you don't already carry the proof and provide it along with the statement.

Also, no, i did not take it as an insult, just as a false statement from someone with little knowledge of the subject matter.

> I do think that providing multiple options where most languages have one option built-in is unnecessary cognitive load. One doesn't "choose" an "object system" for Python--what benefit would one hope to gain?

That question is actually understandable and easily answered. Two benefits:

1. More expressive power for example. Perl has Roles that function in a way unmatched by most other languages (i say most because i don't know all languages, i honestly don't know one that has roles as good as perl). They make it possible to share methods among classes without needing to resort to base classes and diamond inheritance issues, while still retaining full introspection capabilities. Another system implements most of the sugar, but leaves out some really complicated features in order to make it much faster. Yet another provides the most speed by implementing the core in C. This makes it a bit harder to debug, and less portable, but if you need massive speed, there you go.

2. The ability to try out different things and work out in real life situations which features are needed and which ones are dead ends. This ability is amplified by the ability to simply extend your object system by writing more Perl. In comparison, Ruby has an ubiquitous one, but when they desire to change it, they cannot easily test the changes large-scale in real situations, and even if a change is undoubtably positive, they still have to convince Matz first, and then implement it in C.

> indisputably more work for everyone than just having one.

Actually that is disputable. In the past it was the case, yes. But nowadays they have converged on the same syntax and present themselves identically to consumers. That means porting between different systems is trivial, and people using a class don't even notice changes. And that is not just fluff. The perl community has been doing this actively, for example here:

https://github.com/rjbs/Email-Sender/compare/52fcbbb9b6a1c4a...

I'm not going to comment on your last paragraph because you wrote it while having decided that what you wrote before is actual fact and it is thus very flawed. Please stop doing that and use more question marks.

Re:Perl - the Detroit of scripting languages by fusiongyro on Wednesday July 31, 2013 @01:59PM (#6135609)
You imagine that programming is more objective than it actually is. Time will probably sort that out.

I appreciate your examples. I do think they would have been a better place to begin.

As for cognitive load, it is a thing. Converging on a single syntax will certainly reduce it, but as long as there is choice there is some. I do wonder to what extent you can have meaningful variation within the same syntax. Clearly it works for Perl and Perl users--I'm not trying to argue from first principles that it is impossible or stupid, only that it has a cost and that costs must have benefits or they are unnecessary. You apparently see some logical fallacy in that, but there isn't one. You just know the benefits and see the costs as reasonable. There's nothing wrong with your position on that, but you should have taken my words as an invitation to share what you know rather than blandly issue orders, a singularly unhelpful kind of discussion. An invitation was my intention, and I am sorry that I failed to convey it adequately.

Re:Perl - the Detroit of scripting languages by berntb on Wednesday July 31, 2013 @01:14PM (#6135251)
>>I do think that providing multiple options where most languages have one option built-in is unnecessary cognitive load.

(I'll assume you're not a troll despite acknowledging that you talk about a subject you don't know.)

You are seriously arguing against flexibility and configurability of your programming environment? I guess you don't like Lisp either?

To answer your specific point, re OO system: Today the de-facto Perl OO system (Moose with relatives) is better than the alternatives among other scripting languages. Without language extensibility, that wouldn't have happened.

Exactly where the optimum is for sizes of std libs can and should be discussed. IMHO, after a few work years, a week or two extra to learn an environment is worth it when you get things like Moose. YMMV, but since you acknowledge that you don't know the environment, well...

Re:Perl - the Detroit of scripting languages by fusiongyro on Wednesday July 31, 2013 @01:48PM (#6135534)
I'm arguing that flexibility has a cost, and unless you can show me a tangible benefit, it's unnecessary cost. That you can build an OO system comparable to what other languages have built-in is a compelling demonstration of the extent of the flexibility, but it isn't a compelling demonstration of the need for the flexibility. Surely you have better examples of the extensibility of the language than stealing well-understood ideas from other languages. The best time to bring those out would be when wooing new users. In other words, your Prolog-style unification engine, your LINQ, your dependent-typing system, etc. would be better demonstrations of the vitality and power of your language's flexibility and extensibility than things I get for free by typing "python" at my shell prompt.
Re:Perl - the Detroit of scripting languages by Mithaldu on Wednesday July 31, 2013 @01:53PM (#6135558)
> comparable

Not comparable. Better.

> your LINQ

DBIx::Class. I don't want to go to the effort of going into massive detail here, but in short: It allows you to write SQL access code under which you can use ANY database (SQLite, MySQL, MSSQL, Postgres, what have you), without changing a single line of your code. It will not only deploy your schema onto the database server, but also optimize your queries, so that for anything of slight complexity, it will likely be faster than your hand-written queries.

Re:Perl - the Detroit of scripting languages by TylerE on Wednesday July 31, 2013 @01:57PM (#6135596)
That's one tiny slice of what LINQ can do. It can also query native objects, XML, CSV files, and a wide variety of web APIs.
Re:Perl - the Detroit of scripting languages by Mithaldu_ on Wednesday July 31, 2013 @02:19PM (#6135779)
DBIx can do these things too. Anything you can write a DBI driver for, it can handle.
Re:Perl - the Detroit of scripting languages by berntb on Wednesday July 31, 2013 @02:21PM (#6135790)
>>That you can build an OO system comparable to what other languages have built-in

My explicit point was that it is better [edit: which was an answer to your question about value from flexibility, compared to the cognitive cost], don't do straw man attacks please. (Are you trolling?)

Edit: Thanks for the downvote. :-)

Edit 2: As answer to the next long, long comment with parts going all over: Of course complexity has costs. if you really just want a good reference on Moose to see exactly what it is, ask Mithaldu. He probably has better sources than me. This is what I give people (it is getting old): http://rjbs.manxome.org/talks/moose/Moose.pdf

Edit 3: And to avoid being called a "troll" -- don't write shit like "In 2013 nearly every problem has a language more appropriate than Perl." while you acknowledge you don't know the subject...

Re:Perl - the Detroit of scripting languages by Mithaldu on Thursday August 01, 2013 @02:33PM (#6142387)
Actually, the Moose PDF is still the one i link to when necessary. However lately i've switched to simply linking to http://perl-tutorial.org and pointing out the relevant bits.
Re:Perl - the Detroit of scripting languages by fusiongyro on Wednesday July 31, 2013 @03:28PM (#6136245)
When someone says two systems are comparable, it is a different claim than that two systems are equivalent. In order for something to be better than something else they have to be comparable. Dynamic typing can be better than static typing only because they're both approaches to typing (please don't confuse this example with an opinion); static typing cannot be better than lexical scope because they're not comparable.

We're talking about the cost/benefit of flexibility as evidenced by systems like Moose. It's quite irrelevant to my point whether Moose is better or not, so it is quite a stretch to accuse me of a straw man attack. For that to be the case, I'd have to have said that Moose is worse than (say) Python's OO therefore flexibility is bad and Perl is bad by extension. What I'm actually saying is that flexibility isn't free, it has a cost, and that the cost must be offset by other benefits. If Moose is better, that's a benefit that might outweigh the cost, but nobody seems to be interested in telling me how it's better when they could instead attack the argument, by, for instance, hauling out the well-worn stack of logical fallacy accusations. If I sound irritable, it's only because I start conversations on HN in good faith expecting, you know, a conversation, and these kinds of vitriol-powered slamfests are not what I have in mind. Am I a troll indeed.

Edit: One need not know a language to find oneself in a niche where that language might be more appropriate. I didn't mean that remark to offend and I regret my wording. I certainly wasn't out to troll. That said, surely you do not believe one must learn a language inside out before knowing whether it is appropriate to a domain. I know many languages and work in several domains and never find myself thinking Perl would be better. I might not be in the right domains, but if we were having this conversation about C++, Java or Haskell it would be easier to rattle off a few example domains rather than scoff at the question.

Re:Perl - the Detroit of scripting languages by berntb on Thursday August 01, 2013 @06:19AM (#6139421)
>> surely you do not believe one must learn a language inside out before knowing whether it is appropriate to a domain.

You had a hard opinion about something you admitted you don't know. That is just not a serious position.

>>We're talking about the cost/benefit of flexibility

Of course it has a cost with flexibility. The same goes for lisp variants, which have an even larger flexibility than Perl in the macro system. Since you claim to know many other systems than Python, you should know this...?

Every design choice have costs/benefits. You don't need to repeat that trivial point as if it is news.

(That you think another OO system is better without knowing both says more about you than anything else.)

And now you argue that because you (allegedly) know other stuff, your opinion is relevant?

(Why don't you go argue that the flexibility of easily reprogrammable syntax is bad with Lisp people instead? If Perl is bad according to you, their life must be Hell?)

(And fyi, re niches, all the scripting languages are very similar in capabilities and fill mostly the same niche. That is why we see so many language wars trolls from the aggressive language communities. But I think you know this.)

Re:Perl - the Detroit of scripting languages by fusiongyro on Thursday August 01, 2013 @10:46AM (#6140636)
All this discussion is doing is illustrating your rescue-dog mentality. Don't worry, I won't waste another second on Perl. Enjoy your Detroit, you guys have earned it.
Re:Perl - the Detroit of scripting languages by berntb on Thursday August 01, 2013 @02:10PM (#6142219)
Your "classy" insults aren't exactly screaming non-troll.

If you really are a non-troll wanting to seriously discuss a subject's pro/con, don't start with insults and then act innocent. I was polite to the first dozen language war trolls on HN claiming things were shit they have no clue about. That was a long time ago.

(Also, the net is full with Moose info -- I gave you my favorite reference and suggested you'd ask others. If you really wanted to read about roles, typing of attributes etc and build a serious opinion.)

PS For the third time: Have fun explaining to Lisp people your theories about flexibility's cost being too high. I'd love to see your insults to their reaction... DS