Hacker News new | comments | show | ask | jobs | submit login

  | >>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"
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.

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


> These three are all similar -- avoid threading. :-(

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:

    $sync_var = "start!";


Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact