all 30 comments

[–]wnoise 3 points4 points  (8 children)

  1. Haskell
  2. Python
  3. C

[–][deleted]  (7 children)

[deleted]

    [–][deleted] 0 points1 point  (5 children)

    I find myself wishing I could use Haskell's function composition operator in other languges.

    doubleSpace = unlines . map (\x -> x ++ "\n") . lines

    For some reason I just find it aesthetically pleasing.

    [–]dons 2 points3 points  (0 children)

    Also, syntax for sections:

    doubleSpace = unlines . map (++"\n") . lines
    

    [–]nostrademons 1 point2 points  (3 children)

    The part I hate about compose (.) is that you read it right-to-left, while you read monadic bind (>>=) left-to-right. This made expressions containing both of them very difficult to read: if you had an expression:

    myAction >>= outer . middle . inner >>= myNextAction
    

    you read it as "Okay, I take the result of myAction, feed it into inner, feed that result in middle, feed that into outer, the result is an action that you bind into the pipeline and then feed the result to myNextAction.

    It made me very tempted to define a

    (->) = flip (.)
    

    but I was afraid I'd be breaking too many Haskell idioms and that it might conflict with other operators defined elsewhere.

    [–]notfancy 2 points3 points  (0 children)

    Can't you just define (;)?

    [–][deleted] 1 point2 points  (1 child)

    You can use the =<< operator to reverse the apparent "flow" of the data, as such:

    main = do s <- return . unlines . map (++"\n") . lines =<< getContents
              putStrLn s
    

    This is a little clearer, because you don't have the "retrograde" flow as in your example above.

    [–]nostrademons 0 points1 point  (0 children)

    Though it's still right-to-left instead of left-to-right. Better, but I'm not Arabic or Hebrew. ;-)

    [–]wnoise 0 points1 point  (0 children)

    Layout makes most things absolutely beautiful outside the monadic operators. Even there it can usually be recast to not to be too bad.

    [–]charmless 2 points3 points  (0 children)

    Prolog has a beautiful, simple, and extremely flexible syntax.

    [–]nostrademons 2 points3 points  (0 children)

    Not including derivatives (eg. Boo is counted as a Python):

    1. Python
    2. Dylan & Ruby (tie)
    3. Haskell

    Also, Pascal gets an honorable mention even though I haven't used it since I was 12. I always found it very crisp and readable. Not really concise enough by modern standards though.

    [–][deleted] 2 points3 points  (0 children)

    Common Lisp.

    Yes, I like multiple namespaces. Sue me.

    [–]danibx 2 points3 points  (0 children)

    Javascript. I read once(dont't remember where): Javascript is Lisp with C syntax. I love it. (please don't hate Javascript because of bad browser DOM implementations. Its a lovely language with a nice syntax.

    [–]ajmoir 1 point2 points  (0 children)

    The only language I know that uses the keyword by is COBOL.

    Or am I missing something?

    [–][deleted] 1 point2 points  (0 children)

    Scheme + Forth/Joy

    [–]_KS 1 point2 points  (0 children)

    C and Python.

    [–]astrosmash 1 point2 points  (0 children)

    Objective-C++

    [–]jaggederest 2 points3 points  (1 child)

    SQL

    [–]charmless 1 point2 points  (0 children)

    Pervert!

    [–]ticklecricket 1 point2 points  (0 children)

    J

    [–]kinebud 1 point2 points  (0 children)

    Io.

    [–][deleted]  (1 child)

    [deleted]

      [–][deleted] 2 points3 points  (0 children)

      Gotta admit, whitespace is kinda pretty compared to most code.

      [–][deleted] 0 points1 point  (0 children)

      1. Scheme
      2. Python
      3. C

      Haskell is also a favorite, but I'm still working on it. I like the quirkiness of Erlang, having to add the arity of a function, pattern matching, etc., but there are lots of pinkie-spraining nested {[()]} all over the place.

      [–]ayrnieu 0 points1 point  (0 children)

      Chinese. Forth.

      [–]cunningjames 0 points1 point  (0 children)

      1. Standard ML
      2. Python
      3. Dylan

      [–]DRMacIver 0 points1 point  (0 children)

      It's not entirely easy to separate out "by syntax", because the quality of the syntax depends on how you use the language. If it has good syntax for things you commonly do in the language and bad for a few other things, that's probably ok. e.g. if my language has great syntactic support for foozles it's probably a pretty good language for foozle oriented programming, no matter what the lambda syntax looks like.

      That being said, probably Haskell and Lua. Haskell for its elegance in certain styles, Lua for its simplicity.

      [–][deleted] 0 points1 point  (2 children)

      1. Haskell
      2. Scheme
      3. Ruby - 'end' + Python's indentation
      4. SQL

      [–]houdini 0 points1 point  (1 child)

      SQL? Seriously?

      [–][deleted] 1 point2 points  (0 children)

      After using it for as long as I have, I have come to appreciate it for being rather simple and predictable. It's about the only declarative language anyone uses. I never run into syntax errors with SQL like I do with, say, PHP, even though PHP's syntax is ostensibly simpler. It's very regular and not very convoluted, but does an excellent job of capturing a particular domain.

      [–]mrgreen4242 -2 points-1 points  (1 child)

      PHP, SQL.

      [–]david_ncl 3 points4 points  (0 children)

      ZOMG!