News for hackers. Stuff that matters.

calopetreep

Re:Chess CAPTCHA on Sunday March 10, 2013 @09:51AM (#5351898)
The captcha seems very easy (I am not a chess player)- I tried three times and always got a board to solve in one move, so I doubt anyone that knows the rules of chess is going to be excluded. That's probably not a problem for this forum :)
Re:Things Java Programmers can learn from Clojure on Thursday March 07, 2013 @04:43AM (#5336890)
Do you mean you have trouble with seeing what's going on inside a long function composition? I wrote a cool function to examine it with almost no code changes:

  module TraceCompose where

  import Debug.Trace

  -- | Trace a value, resulting in the value itself
  idTrace :: Show a => a -> a
  idTrace x = trace (show x) x

  traceCompose :: (Show a, Show b, Show c) =>
    (b -> c) -> (a -> b) -> a -> c
  traceCompose f g = h f . h g . h id
    where h f x = idTrace (f $ seq x x)

  -- Replace "normal" function composition using traceCompose.
  test = (+1) . (*10) $ 4
    where (.) = traceCompose
When you run "test", it will print:

4 40 41

(i.e., the outputs of each function at each point in the composition in order of execution.)

Re:Don't Be Distracted by Superior Technology on Tuesday March 05, 2013 @10:11PM (#5329097)
> If the end result is symbolic differentiation (...)

Ah, I see the problem- automatic differentiation is not the same as symbolic differentiation- see wikipedia: http://en.wikipedia.org/wiki/Automatic_differentiation This certainly isn't a moot point :)

> Also, we've left the original topic (...)

No- again, I've been saying the same thing all along. In fact I'm only using Haskell as an example. There are things which cannot be expressed in Haskell, too- for example dependent typed programs as you might find in Agda or Idris.

> In a larger sense, wouldn't it be more praiseworthy to say that Haskell does exactly what other languages do, but much better?

This is a separate conversation entirely. My aim is not to "praise Haskell". I have used Haskell and Java only as examples.

Re:Don't Be Distracted by Superior Technology on Tuesday March 05, 2013 @12:10PM (#5325697)
Ah I see- sorry to've misinterpreted that! I definitely agree- brainfuck being the best example in favour of that argument :)
Re:Don't Be Distracted by Superior Technology on Tuesday March 05, 2013 @07:31AM (#5324088)
This isn't really relevant to the thread of discussion.
Re:Don't Be Distracted by Superior Technology on Tuesday March 05, 2013 @06:49AM (#5323989)
> Java can produce any result that Haskell can produce. End of story, full stop.

Yes, I'm not disputing this- I'm fully in agreement that all turing-complete languages can compute all turing-computable computations. I've never been trying to argue against that. I'm sorry if I haven't explained myself clearly enough- let me give it another shot.

In Haskell, I can write a function operating on numbers like this:

    f x = x**2 + x + 1
The AD library means I can do this:

    g = diff f
and g will behave as if I'd declared

    g x = 2 * x + 1
As far as I'm aware, it's not possible to write this code in Java- you can't get the differentiated version of a Java function this way.

You can compute the same results, of course. You just can't write a library that will accept a function and give back its differentiation.

You can write a function that takes some representation of a mathematical function, for example as a string, and build a function from that to compute the same results, but you can't pass in an actual Java function- so you can't write the library. You can write a library which differentiates string-representations-of-functions, but you can't write one that differentiates first-class-Java-functions (well, objects with functions on, but you get the idea. I hope.)

Re:Don't Be Distracted by Superior Technology on Tuesday March 05, 2013 @04:36AM (#5323716)
> So you're saying Alan Turing was wrong?

Nope! The Turing-completeness of Haskell and Java means they can both compute the same functions. However, there are certain things which are just not possible to express directly in some languages. Possible to compute, but not express directly.

Instead of Java, consider Brainfuck. It's a turing-complete language and certainly has no notion of what a function is. There's simply no way in Brainfuck to directly express that idea.

Another example, this time with Java and Haskell. In Haskell, I can write a function to add any two numbers (regardless of their type) like this:

add' :: Num a => a -> a -> a

add' x y = x + y

As far as I'm aware in Java, there's no way to write a function with a signature that says "Take two numeric arguments of any type". Certainly pre-generics, this is impossible.

Edits: markup

Re:Don't Be Distracted by Superior Technology on Tuesday March 05, 2013 @03:06AM (#5323490)
> you spend less time reinventing the wheel

I've found this to be totally the opposite: my time in Java is much less productive. There are many libraries in Haskell which aren't even possible to write in Java (automatic differentiation, parser combinators, lenses, etc.)

> very few haskell programmers that are interested in doing boring work

Nobody is interested in doing boring work, or it would be interesting work. Nothing to do with Haskell programmers.

Hiring (good) Haskellers is easy because there's a demand for jobs. It's as simple as that.

Re:HelloFlo Launches a Tampon Subscription Service on Monday March 04, 2013 @11:58AM (#5319089)
Actually I think the parent poster is male- I certainly read it the same way you did at first!
Re:Don't Be Distracted by Superior Technology on Monday March 04, 2013 @04:55AM (#5317512)
Actually, I've found that Haskell libraries are absolutely fantastic- For me, its ecosystem is superior to other languages I've used, and I find libraries tend to be better designed and easier to pick up and use.

> And how many are willing to stay at your company when it becomes bigger and more boring?

I feel like this is an argument that could apply to any set of programmers- I'm not sure I see how it's relevant to Haskellers in particular.

> Many Haskell programmers come from academia, how many are willing to do boring business logic?

I don't know, but it's almost certainly non-zero. I know of a few Haskellers with PhDs working in startups.

Re:Don't Be Distracted by Superior Technology on Monday March 04, 2013 @12:24AM (#5316807)
> Haskell is a bad choice for business simply because you limit yourself to a very small talent pool.

Actually, there are many more Haskell programmers than jobs available, so it's possible to pick and choose when hiring.

Re:Stanford Female CS Student: I Fight Impostor Syndrome on Monday February 25, 2013 @01:38PM (#5280730)
If the article did indeed say "this experience applies to women (...)", it now appears to've been edited for clarity.
Re:Tesla’s Earnings Indicate Some Customer Cancellations on Wednesday February 20, 2013 @10:52PM (#5255260)
A more cynical person might suggest the tone of this article was related to recent events elsewhere in the NYT. The real meat of the article is buried halfway down:

"(Update: The Tesla spokeswoman Shanna Hendriks later said the company had 1,500 cancellations in the fourth quarter). Many customers were in line but pulled out when it became time to make a substantial down payment in cash."

I'd imagine this is fairly standard for reservations of any product that don't require purchase, it only remains to ask whether this is more than one might expect, and if so, whether it's related to the "cold weather" debacle. That certainly seems to be the implication here.

Re:Show HN: completeme, 't' in Github for Bash on Wednesday February 20, 2013 @12:03PM (#5251597)
I find tiling window managers to alleviate the pain of GUI windows. I use XMonad, and I love it!