News for hackers. Stuff that matters.
Re:Rust as a gateway drug to Haskell by wyager on Wednesday June 14, 2017 @03:39AM (#14551230)
The benchmarks game falls squarely under the umbrella of "short, simple programs", not the sort of real-world stuff where you would benefit from having a language that scales well. That said, Haskell performs pretty well in the toy benchmarks anyway.

Your comparison between Haskell and Go is about market size, not language design. I suspect you would have a similarly hard time finding Rust devs as Haskell devs (i.e. mildly less convenient than a popular language like Python or Go).

Re:Rust as a gateway drug to Haskell by delhanty on Wednesday June 14, 2017 @04:21AM (#14551360)
> .. you can write vastly more complicated programs that are, say, 80% as fast as hand-optimized C for only 10% of the effort of hand-optimized C.

I don't mean to be personal, but your quantative claim smells a little like unsubstantiated BS. Do you have any data to back it up?

> That said, Haskell performs pretty well in the toy benchmarks anyway.

Currently, "pretty well" looks like GHC performance is 50% to 10% of hand-crafted C using perhaps 5 times as much memory. (If the GHC program builds at all that is.)

fannkuch-redux

Haskell GHC: 16.70 sec 7,628 mem

C gcc: 8.97 sec 1,660 mem

spectral-norm

Haskell GHC: 4.06 sec, 9,880 mem

C gcc: 1.99 sec, 1,824 mem

n-body

Haskell GHC: 24.48 sec, 6,468 mem

C gcc: 9.96 sec, 1,016 mem

reverse-complement

Haskell GHC: 1.39 sec, 132,176 mem

C gcc: 0.42 sec, 143,948 mem

mandelbrot

Haskell GHC: 11.64 sec, 41,180 mem

C gcc: 1.65 sec, 32,684 mem

fasta

Haskell GHC: 14.68 sec, 455,088 mem

C gcc: 1.33 sec, 2,856 mem

binary-trees

Haskell GHC: 26.28 sec 511,444 mem

C gcc: 2.38 sec 131,728 mem

k-nucleotide

Haskell GHC: Make Error

C gcc 0.06 sec ? mem

pidigits

Haskell GHC: Make Error

C gcc: 0.06 sec ? mem

regex-redux

Haskell GHC: Make Error

C gcc: 0.02 sec ? mem

Haskell GHC: The Glorious Glasgow Haskell Compilation System, version 8.0.2

C gcc: gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406

Re:Rust as a gateway drug to Haskell by Tarean on Wednesday June 14, 2017 @05:19AM (#14551525)
The make errors are a bit weird because the programs build on my machine no problem.

In parts haskells slowness seems to be because no one cares enough to work on it. Can't say for sure, though, so maybe I just should try a task and implement it to see how fast it'd be without amazing optimization foo.

Although of course these benchmarks aren't really representative of the real world because they'd just end up as a c ffi call in most languages if they actually were that performance critical.

Re:Rust as a gateway drug to Haskell by delhanty on Wednesday June 14, 2017 @08:28AM (#14552204)
I agree with all that, particularly the bit about the c ffi call. It's more relevant to compare Rust with C and C++, as Rust is a language that could reasonably display C for the ffi call.

But then remember that @wyager is claiming

>80% as fast as hand-optimized C for only 10% of the effort of hand-optimized C

If it's really only 10% of the effort then one shouldn't really have "to work on it" to get semi-decent performance.

A more modest claim of say:

50% as fast as hand-optimized C for only 20% of the effort of hand-optimized C

would have been more credible and still a big win for many use cases.

Re:Rust as a gateway drug to Haskell by Tarean on Thursday June 15, 2017 @04:39PM (#14564159)
Tried my hand at the knucleotide[1] one. Lifted the algorithm from the fastest rust solution. As optimization I dropped some Unpack pragmas and strictness annotations, used Data.Hashtable.Cuckoo for in-place updating hash tables because that seemed necessary for the task, and added naive parallelization via

   let outputs = map (exec content) tasks `using` parList rseq
That got around 24 seconds which seems acceptable for a fairly straightforward solution that is around half the size of the rust one I copied. Might try to optimize later.

[1]: http://benchmarksgame.alioth.debian.org/u64q/knucleotide.htm...

Re:Rust as a gateway drug to Haskell by igouy on Friday June 16, 2017 @05:05PM (#14572642)
Re:Rust as a gateway drug to Haskell by igouy on Wednesday June 14, 2017 @01:14PM (#14554195)
That pi-digits program does not "build on [your] machine no problem".

It cannot.

The line "main = putStr.pidgits.read.head =<< getArgs" has been commented out because the program author has optimised-away some of the work that must be done.

Re:Rust as a gateway drug to Haskell by Tarean on Wednesday June 14, 2017 @04:23PM (#14555821)
Fair enough, I only checked the two knucleotide programs which both failed because of missing dependencies.
Re:Rust as a gateway drug to Haskell by igouy on Friday June 16, 2017 @05:04PM (#14572639)
>> The make errors are a bit weird because the programs build on my machine no problem. <<

My fault (except for pi-digits and regex-redux).

I neglected to work-through the force-reinstalls that inevitably follow my update of the GHC compiler.

Done.

Re:Rust as a gateway drug to Haskell by delhanty on Wednesday June 14, 2017 @04:29AM (#14551389)
Language design choice pretty obviously relates to market size as my comment makes clear.

I referenced Rust because that was the article was about.

Swift and F# are languages that are not as basic as Go, but easier to find devs than Haskell.

That said, Rust has a lot going for it, even if there are a lot less devs than Swift.

Re:Rust as a gateway drug to Haskell by BigJono on Wednesday June 14, 2017 @08:22AM (#14552178)
"mildly" less convenient? Maybe in SV. I'll bet if I tried to hire a semi-experienced Rust developer here in Melbourne I'd be looking until Christmas at least haha.