Earlier quoted context omitted.
My argument was just that it has nothing to do with significant whitespace, which is what you were complaining about. Python could be changed to have non-significant whitespace but retain its crippled lambda.
>>My argument was just You made specific claims (regarding map recommendations in Python and that white space has nothing to do with one instruction lambdas). I asked for references. I assume you have none? Note that with significant white space a usable syntax for multi-instruction lambdas seems... non-trivial. It seems to me as an unusually stupid fan boy position. But a few well argued references, which you lack,…
The Perl Renaissance
121–130 of 130 posts
Re: The Perl Renaissance
#122Earlier quoted context omitted.
Python's niche is that it's a general purpose language that is also good for scientific programming.
my theory is that Python ended of being used so much in scientific computing because of what it lacked :) I mean weird stuff that put off "brilliant non-professional programmers" (ie. scientists, engineers and other domain experts that thought themselves how to code). All other languages have tons on these things: Ruby has blocks that make people write functionalish code, Perl has ...tons of weirdness. Python just lo…
Re: The Perl Renaissance
#123Earlier quoted context omitted.
I've used both Perl and Python. When using Perl I use anonymous functions all the time. When writing Python, I don't. There are instances where in Perl I would use an anonymous function, but in Python I define a local function an pass the reference. Each language has it's own style. If you're trying to fight the language's style, then you will obviously run into friction. I'm sure there are plenty of people coming fr…
>>Ruby code to Haskell Uh... different paradigms. The scripting languages, which we are talking about here, are generally very similar. >> I welcome examples of where anonymous functions are unable to be replaced by local functions passed by reference. Where did I write "unable" -- did I disprove some Turing machine theorem and forget about it? :-) In this specific case it was a declarative data structure with some d…
| >>Ruby code to Haskell
|
| Uh... different paradigms. The scripting
| languages, which we are talking about here,
| are generally very similar.
Different languages are different, no matter how
many similarities that they have. You are going
to run into issues porting between languages.
Expecting anything else is setting yourself up for
disappointment.C++ and ObjC are both 'C-based', so there should be zero issues porting code between them, right? French and Spanish are both Latin-based, so they are practically the same language, right?
| >> I welcome examples of where anonymous
| >> functions are unable to be replaced by
| >> local functions passed by reference.
|
| Where did I write "unable" -- did I disprove
| some Turing machine theorem and forget about it?
| :-)
Poorly worded on my part. | In this specific case it was a declarative
| data structure with some data next to code. It
| was well suited to have a dozen or two short
| functions next to the data structures.
|
| You could rethink the whole thing and do
| something different in Python to keep it
| readable. But among the normal languages (in
| the same paradigm), Python is the odd man out,
| just because of the lack of multi line lambdas.
1. The inclusion of multi-line lambdas in a
language is what makes it 'normal'? This just
seems more like a personal opinion than anything
objective. I could easily say that Ruby is the
odd-man out and Perl/Python are the 'normal'
languages, because of this: a = 0
if a
puts "Evaluates to True"
end
Or Perl is the odd-man-out and Ruby/Python are the
'normal' languages because they have a GIL.2. If keeping the data structure and functions together was the best use-case, then maybe Python wasn't the tool for the job. Just like I wouldn't talk about how crappy Ruby is because it doesn't have SciPy/NumPy.
Re: The Perl Renaissance
#124Earlier quoted context omitted.
>>Ruby code to Haskell Uh... different paradigms. The scripting languages, which we are talking about here, are generally very similar. >> I welcome examples of where anonymous functions are unable to be replaced by local functions passed by reference. Where did I write "unable" -- did I disprove some Turing machine theorem and forget about it? :-) In this specific case it was a declarative data structure with some d…
| >>Ruby code to Haskell | | Uh... different paradigms. The scripting | languages, which we are talking about here, | are generally very similar. Different languages are different, no matter how many similarities that they have. You are going to run into issues porting between languages. Expecting anything else is setting yourself up for disappointment. C++ and ObjC are both 'C-based', so there should be zero issues…
All the scripting languages are very, very similar (see data structures, etc).
In short, you don't argue against my point.
My point was that Python stops multi-line lambdas for some weird purity argument re white spaces (I haven't found any other motivation).
This hurts quite a few use cases (for a 2nd -- copy paste and automatic indentation of code is at least more complex, and so on) and makes it necessary to learn weird syntax (list comprehensions), which incidentally is touted as the next coming of Christ...
And the inability to admit a wart on Python is quite typical -- didn't Guido tell you guys to stop trolling recently, because you were getting bad reputation..?
>> Or Perl is the odd-man-out and Ruby/Python are the 'normal' languages because they have a GIL.
These three are all similar -- avoid threading. :-(
Not that it is relevant for my original point, either.
Re: The Perl Renaissance
#125Earlier quoted context omitted.
>>My argument was just You made specific claims (regarding map recommendations in Python and that white space has nothing to do with one instruction lambdas). I asked for references. I assume you have none? Note that with significant white space a usable syntax for multi-instruction lambdas seems... non-trivial. It seems to me as an unusually stupid fan boy position. But a few well argued references, which you lack,…
I should rest all this rip, but I can't help it: reference to multi-line lambdas in languages with Python-like syntax: http://cobra-language.com/trac/cobra/wiki/AnonMethod , http://boo.codehaus.org/Closures (yep, you're right, having multiple closures on a single line with offsite-rule syntax is "non-trivial" and no one solved this yet, but even one per line would be enough to make map and fold bearable, and ftr, I w…
Please relax... no tool is perfect for all situations. It is always a trade off.
Re: The Perl Renaissance
#126Earlier quoted context omitted.
The superb community is one of Python's biggest assets, especially when compared to the Ruby community. The Python community is made up of some very smart and talented experts. Their emphasis is on developing high-quality software, and doing things properly. Egos are kept in check, and there are always many people willing to offer a helping hand to those who are new to Python. The Ruby community is generally quite di…
>>Egos [among Python programmers] are kept in check [compared to the Ruby community] That is a really fun -- and typical! -- claim when your GP is a Python troll arguing that another open source language should just die... :-) Frankly, I've never seen so much language trolls as Python trolls. (And no one needs multi line lambdas and hence real map functions, anyway...) I don't know much about the Ruby community, but…
Re: The Perl Renaissance
#127Earlier quoted context omitted.
| >>Ruby code to Haskell | | Uh... different paradigms. The scripting | languages, which we are talking about here, | are generally very similar. Different languages are different, no matter how many similarities that they have. You are going to run into issues porting between languages. Expecting anything else is setting yourself up for disappointment. C++ and ObjC are both 'C-based', so there should be zero issues…
>>The inclusion of multi-line lambdas in a language is what makes it 'normal'? All the scripting languages are very, very similar (see data structures, etc). In short, you don't argue against my point. My point was that Python stops multi-line lambdas for some weird purity argument re white spaces (I haven't found any other motivation). This hurts quite a few use cases (for a 2nd -- copy paste and automatic indentati…
Perl gets a bad rep on threading because it's threads don't map to what many people consider the strong points of threads, which is light weight processes. Perl fails spectacularly in that regard, but if you want multi-process programming with a standard, well understood set of primitives for IPC, it's really quite nice. That is, the 'threads' module isn't all that great by itself, but when paired with 'threads::shared', it's really quite nice (as long as you are pre-spawning workers or don't require quick thread spawning).
For example, I love how locks are scope based, which makes the following possible:
my $local_var = do { lock($lock_var) }
as well as: {
lock($sync_var);
$sync_var = "start!";
cond_broadcast($sync_var);
}Re: The Perl Renaissance
#128Earlier quoted context omitted.
>>Egos [among Python programmers] are kept in check [compared to the Ruby community] That is a really fun -- and typical! -- claim when your GP is a Python troll arguing that another open source language should just die... :-) Frankly, I've never seen so much language trolls as Python trolls. (And no one needs multi line lambdas and hence real map functions, anyway...) I don't know much about the Ruby community, but…
Seriously. Python has plenty of good points to cite in its favor, but "lack of fanboys" is not one of them...
Second, this trolling attitude seems built in with the Python purity philosophy. It reminds me more of islamists and other religious fanatics than of anything else.
Re: The Perl Renaissance
#129Earlier quoted context omitted.
That question can be turned around: Why should someone use Python (or Ruby) instead of Perl? For someone who hasn't used any of those, I'd say give each of them a few hours and see which style suits you best. Of course, try to find modern examples to learn from. When it comes to Perl that means: * Mojolicious [1] (or Dancer [2]) as the web framework * DBIx::Class [3] as the ORM (maybe with some sugar [4]) * Moose [5]…
Python and Ruby both have garbage collectors and can deal with reference cycles. Perl only has reference counting, leading to programs that leak memory due to reference cycles and needing to hunt down where in the code you're creating them. It's the only high-level language I know of that only has reference counting for memory management.
Re: The Perl Renaissance
#130Earlier quoted context omitted.
For most use cases where you want map/filter/etc, you can chain list comprehensions using generators.
You have no relevant comment on what I wrote either, I take it? Here I asked for references about the GP's claims. Also, welcome to HN (or are the prepared troll accounts with a few hundreds of Karma running out? :-) ).
You asked about multi-line lambdas in python and I gave you a valid Python syntax for multi-line anonymous functions. Here is PEP 202, which simply says list comprehensions are more concise than for loops and map/filter etc.
http://www.python.org/dev/peps/pep-0202/
RE: accounts - I delete all of my accounts on social websites once a year.