News for hackers. Stuff that matters.
Re:Beating Decades of Optimized C with 80 Lines of Haskell by bonzini on Wednesday October 16, 2019 @02:44AM (#21267704)
Also, when counting words the C code is actually handling multibyte sequences, which is one of the biggest sources of improvement for the Haskell code (8s to 3.5s).

Having to use a syntax extension explicitly to forgo laziness feels like cheating to me... But then I have never used Haskell so perhaps that's actually normal.

Re:Beating Decades of Optimized C with 80 Lines of Haskell by unhammer on Wednesday October 16, 2019 @02:51AM (#21267742)
If you're talking about BANGPATTERNS, that is completely normal in Haskell.

Pretty much any non-trivial Haskell program (and many trivial ones too) will have !'s in various places to force something to be strict, and to use the ! syntax you do need to add a pragma. Those pragmas are what let Haskell evolve new features without breaking backward compatibility, so Haskell programs tend to have a lot of them. Perhaps one day we'll have a new standard (it's been 19 years since the last one) which will include some of the pragmas by default. In the meanwhile, it's possible to turn the common ones on project-wide and just forget about them.

Re:Beating Decades of Optimized C with 80 Lines of Haskell by klodolph on Wednesday October 16, 2019 @04:57AM (#21268385)
> …it's been 19 years since the last one…

Does Haskell 2010 not count?

Re:Beating Decades of Optimized C with 80 Lines of Haskell by unhammer on Wednesday October 16, 2019 @03:45PM (#21274660)
doh! 9 of course, thanks
Re:Beating Decades of Optimized C with 80 Lines of Haskell by pcstl on Wednesday October 16, 2019 @10:22AM (#21270617)
Haskell is a lazy-by-default language and the most practical way to disable laziness is that syntax extension.

You can do it without the extension, but it'll turn ugly really quick (lots of uses of the "seq" function everywhere).

In general, the Haskell community is very tolerant of language extensions (people will recommend you enable about a dozen of them in every project), so this is pretty standard.

Re:Beating Decades of Optimized C with 80 Lines of Haskell by tome on Wednesday October 16, 2019 @03:03AM (#21267814)
> Having to use a syntax extension explicitly to forgo laziness feels like cheating to me... But then I have never used Haskell so perhaps that's actually normal.

The `seq` function achieves the same end and is in the standard library. There's nothing cheating about it. The bang patterns extension just provides some nicer syntax for it.