Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Haskell, by its lazy evaluation, is basically a macro-only language, and people seem to be doing fine in that end of the world.

Granted, space leak issues are pretty difficult to analyse, so it makes the language seem hard to use in practice, but that's because all the low-hanging fruit like type errors are solved by how the language is designed, so you only end up with the hard bugs.



> Haskell, by its lazy evaluation, is basically a macro-only language

This is not correct. To understand why, please see Ryan Culpepper's answer to this SO question:

http://stackoverflow.com/questions/7046950/lazy-evaluation-v...


>Haskell, by its lazy evaluation, is basically a macro-only language, and people seem to be doing fine in that end of the world.

They aren't that many to begin with, so it could just be (self-)selection bias.

Forth people do fine using Forth too, but I don't see that as a point that it's an appropriate language for most projects and/or people.


There are more people in the #haskell channel on Freenode IRC than #clojure, #scala, #lisp, #racket, or #ruby.


didn't even know that.

BTW the people on #haskell are quite active, and nice :)

(maybe a pointless counter-example, I once went onto #ruby, and asked about an easy way to make a function name refer to a function( to be able to do things like list map f easily, without the superflous do |x| f x end ), and I got yelled at because I was trying to write "non-ruby code".


The Ruby community is very close-minded. I've been a victim of that behavior in #ruby as well. If you asked an equivalent question on #ror (the Rails channel) you'd get more than yelled at - no one would take you seriously from that point on.

To answer your question, because methods aren't first-class in Ruby, you can't pass them around the way you want to. I've decided I don't want my languages telling me what I can or can't do when I know what I want to do is a simple matter of making more types of pointers first-class.


You can pass Ruby methods around; the syntax is just ugly, and it isn't really used:

    def call_on_two fn
      fn.call 2
    end

    call_on_two 1.method(:+)      #=> 3
The problem with [1, 2, 3].map(:function_name) is just that map requires a block, and not a method or proc.

A method like that could be easily enough created, though it'd be kind of ugly:

    module Enumerable
      def map_fn fn
        map { |i| method(fn).call i }
      end
    end

    def foo num
      num + 2
    end

    [1, 2, 3].map_fn :foo #=> [3, 4, 5]
I don't know why there isn't an easy way to freely convert between methods, procs, and blocks; it's definitely something the language is missing.


I figured that out later on, that I should probably not think of ruby as functional ( my brain hardwires no parentheses languages to functional languages I think). After which the experience becomes slightly less frustrating


>There are more people in the #haskell channel on Freenode IRC than #clojure, #scala, #lisp, #racket, or #ruby.

Which doesn't mean a thing. How many of them are employed developers working in the language, as opposed to dabblers?

Very few professional developers I've known hang on IRC. It's 2014 already.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: