Live data from Hacker News

The New Haskell.org

haskell.org

51–60 of 110 posts

Re: The New Haskell.org

#53

This redesign appears to take the position: the first page on haskell.org is for people who are brand new to the language, not for people who are already learning the language or currently use the language. I don't like that choice. I think the page should be trying to be the most useful for users of the language with a link to an About or Getting Started page that is geared toward new users. To me, a user of the lan…

So basically you are saying "Don't be geared towards new users, because I am too lazy to set a bookmark to the pages I need and I want to save clicks..."

Re: The New Haskell.org

#56
post #8

Out of curiosity: Who has written Haskell & deployed to production in the last 24h and if yes for what kind of app?

My company, FanJam.com, is built using Haskell for our backend stack & Ember on the frontend

Re: The New Haskell.org

#57

I don't understand why they want to use this code primes = sieve [2..] where sieve (p:xs) = p : sieve [x | x As their first example of Haskell. It's a prime generator based on trial division. And not even trial division up to sqrt of the number you test, but all the way up. I like the idea of a small snippet showing of the power of haskell, but there are many much better examples imho. Perhaps the website could just…

If the point is to show the power and elegance of the language, why would they complicate the expression with optimizations? The sqrt example is obvious to anyone who understands that line anyway.

What is the point of demonstrating the power an elegance with an example that will (hopefully!) never appear in any real world code? Better to show how the language is still powerful and elegant when taking into account the edge cases and common optimizations.

Writing elegant non-real-world code is much easier (in any language!) than writing real code.

Re: The New Haskell.org

#58

This new, awesome site is using the framework Yesod[0], which is kinda like the Rails of the Haskell world, only it can do rad stuff like prevent XSS and 404s at compile time . Yes, you read that right. [0] http://www.yesodweb.com/

You know what is REALLY cool? Almost all haskell web frameworks use the Web Application Interface[0]. Which is a unified interface for haskell web applications. This means you can mount web applications written in OTHER frameworks under your routes and vica versa. [0] http://www.stackage.org/package/wai

Is WAI that popular? I thought Yesod/Scotty used it, but Snap/Happstack did not.

Re: The New Haskell.org

#59

I don't understand why they want to use this code primes = sieve [2..] where sieve (p:xs) = p : sieve [x | x As their first example of Haskell. It's a prime generator based on trial division. And not even trial division up to sqrt of the number you test, but all the way up. I like the idea of a small snippet showing of the power of haskell, but there are many much better examples imho. Perhaps the website could just…

It's the Sieve of Eratosthenes, which is a fairly classic algorithm.

No it's not. It is only superficially[1].

The sieve of Eratosthenes goes like this:

1) Mark 2 as prime. Let it be n.

2) Mark all numbers of the form i times n as composite, where i is a positive integer. (We can do this by stepping over multiples of n. No multiplication needs to take place.

3) The next unmarked number is prime. Let it be n. Goto 2

Notice how this alogorithm does not use division. Division in modern CPUs is slow.

The algorithm presented uses the `mod` operator, which does division. This algorithm is equivalent to the Trial Division Algorithm. Instead of "deleting" multiples of n as composite, this algorithm tests all numbers greater than n for divisibilty by n, and then only does it "delete" the number.

For a more detailed explanation, see http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf

[1] https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Trial_di...

Post reply on HN