News for hackers. Stuff that matters.
Re:The New Haskell.org by rimantas on Sunday February 15, 2015 @06:01AM (#9052325)
Tell me more about preventing 404 at compile time. I call http://www.yesodweb.com/bullshit
Re:The New Haskell.org by grey-area on Sunday February 15, 2015 @06:30AM (#9052363)
Presumably the idea is that you can prevent your site having broken internal links by constructing links with data types and checking the links when creating them at compile time. You could actually do something similar in most languages, even dynamic ones, so I don't see what is specific to haskell about it, e.g. rails has link_to and friends which require you to have a route set up in order to link to it (though not compile time). Golang has similar protection for XSS and reverse routes on routers if you require it so again not specific to Haskell.

Clearly you won't be able to prevent (nor would you want to) links like yours above from being a 404, so perhaps no more internal 404s would be more accurate.

Re:The New Haskell.org by dmit on Sunday February 15, 2015 @11:20AM (#9052997)
Let's be fair here, while you can detect invalid internal links in dynamic languages at runtime, the end result is basically the same for the user - a 404 or a 503 are equally bad in this case.

That's the advantage of compiled languages over dynamic ones in these kinds of scenarios: you sacrifice immediate feedback during development to gain a guarantee from the compiler that all invariants you embedded in the application uphold. And the more powerful the language/compiler combination, the more compile-time guarantees you can specify.

Re:The New Haskell.org by grey-area on Sunday February 15, 2015 @04:26PM (#9054190)
Users of dynamic languages tend to use tests to check for errors that stronger types might catch (like broken links), but I agree having a formal guarantee is a slight advantage, though not specific to Haskell. Golang for example could easily provide similar checking.

The linked website is beautifully done, and the language does look interesting, I just find the hyperbole about static types making websites magically secure a little over-egged - it's still easy to mess up security or create subtle bugs even if you have strong guarantees about some parts of your code at compile time provided by types.

Re:The New Haskell.org by rimantas on Sunday February 15, 2015 @03:57PM (#9054090)
Well, for me broken internal links and a claim that some framework magically avoids 404 errors are worlds apart.
Re:The New Haskell.org by chrisdotcode on Sunday February 15, 2015 @06:14AM (#9052337)
http://www.yesodweb.com/book/shakespearean-templates#shakesp...

If you're used to only programming in dynamic languages, it can be a shock, but yes, a good type system can do things you never thought possible.

If you were the downvoter, I'll take my vote back now.

Re:The New Haskell.org by theoh on Sunday February 15, 2015 @12:46PM (#9053310)
I don't know who the downvoter is but I think it's a silly claim to be proud of. Anything more complex than a simple template system can enforce referential integrity of internal links by making the programmer refer to other pages on the site with some kind of handle. It's not rocket science and doing it with the (elaborate) type system isn't necessarily a selling point, in my opinion.