callmecosmas's comments

callmecosmas | 12 years ago | on: Mathematicians Team Up on Twin Primes Conjecture

Actually at the bottom of page 2 of Maynard's preprint he states: "We emphasize that the above result does not incorporate any of the technology used by Zhang to establish the existence of bounded gaps between primes."

So it seems like it is actually a coincidence, though they were both building off of the same previous work (GPY) so maybe it's not that surprising.

callmecosmas | 12 years ago | on: Why the world needs Haskell

Haskell certainly has a big learning curve, but the experience will be much more rewarding than learning Clojure or F#. Haskell is a (relatively) uncompromising language and Clojure and F# are really just trying to take some of the features of Haskell and bring them into the mainstream. So if you learn F# or Clojure it may help you if you ever try to learn Haskell, but if you learn Haskell, F# and Clojure will be trivial to learn.

callmecosmas | 13 years ago | on: Functional Programming in 5 Minutes

You don't actually need the second lambda since all Haskell functions take one argument, so you can just do

  f = \x y -> x + y
and you'll have an implicit lambda before the y.

callmecosmas | 13 years ago | on: Functional Programming in 5 Minutes

Python implementations do not have tail call optimization but that doesn't really have anything to do with functional programming.

Common Lisp has mutable data structures by default and actually I think one of the most elegant parts of CL is the setf macro http://www.lispworks.com/documentation/HyperSpec/Body/m_setf..., which is a very clean interface to changing state.

The best functional lisps to use right now would be Clojure and Racket. They both use immutable data structures by default, though neither is "pure". Clojure if you want all the good JVM bits and maybe actually convincing your manager to use it and Racket if you just want to learn using a language that's more beginner-friendly (http://htdp.org/ and the DrRacket IDE) or (mostly) compatible with Scheme (SICP, Little Schemer, etc.).

I've found there aren't really any widely used purely functional languages out there except Haskell (which needs it due to laziness).

callmecosmas | 13 years ago | on: Writing a Vi-like Graphics Editor in Racket

I'm a grad student that works in Racket and fwiw I find that I prefer emacs for editing but DrRacket for testing and debugging. It has great tools for documentation, locating errors and macro expansion and of course it all works out of the box. I also use Geiser, but I've found it buggy and unreliable (including instantly shutting down my OSX machine if I tell emacs to kill it when I quit, plus I still haven't figured out how to limit its memory consumption).

callmecosmas | 13 years ago | on: Introducing Clochure: a better Clojure

Racket allows for (), [] or {} in code and it seems that in practice [] is used to distinguish some syntactic forms that have nested parens from normal function calls such as the let and cond forms. So instead of

  (cond ((...) (...))
        ((...) (...)) 
        (else ...)) 
you get

  (cond [(...) (...)]
        [(...) (...)]
        [else ...]) 
which seems to me to be more readable. See here for an example http://docs.racket-lang.org/reference/if.html?q=cond#%28form...
page 1