News for hackers. Stuff that matters.
Re:Rust as a gateway drug to Haskell by chongli on Wednesday June 14, 2017 @07:30AM (#14551970)
super slow for no obvious reason

Obviousness is hard to pin down. What may be completely obscure to a Haskell beginner is obvious to a veteran. Is it really fair to count people's strict-language preconceptions against Haskell? I don't know.

GHC provides a wealth of profiling tools that an expert Haskell user can employ to find space leaks. Heck, experts generally know where to look (excessive use of lists, spine-nonstrict data structures) so that the profiling tools become a last resort.

Re:Rust as a gateway drug to Haskell by whatshisface on Wednesday June 14, 2017 @08:27AM (#14552198)
A sufficiently smart [compiler | developer] can [make it so that | think] anything is easy.

Since performance is exactly a measure of the number of imperative steps that need to happen in a program, low level imperative langauages are going to win in performance-obviousness every time. (Rust probably beating C in terms of avoiding memory problems, C probably beating rust in terms of not supporting language constructs that can make a single line worse than O(1).)

"Accidentally" asking the language to do something time-expensive is as impossible in C as forgetting a free() in Haskell.

Re:Rust as a gateway drug to Haskell by cesarb on Wednesday June 14, 2017 @09:47AM (#14552641)
> "Accidentally" asking the language to do something time-expensive is as impossible in C as forgetting a free() in Haskell.

Unless you use GCC's cleanup extension (which runs an arbitrary function when leaving a scope, similar to Rust's Drop trait). Or evil macros which turn innocent-looking code into something else (a well-known project, in some compilation modes, redefines the "if" keyword to track how many times each branch is taken). Or both at the same time (like hiding GCC's cleanup extension with a macro).

Re:Rust as a gateway drug to Haskell by xwvvvvwx on Wednesday June 14, 2017 @09:48AM (#14552645)
Since performance is exactly a measure of the number of imperative steps that need to happen in a program

This is an oversimplification. Writing fast code for modern processors is all about how much time you spend waiting for memory.

Re:Rust as a gateway drug to Haskell by FullyFunctional on Thursday June 15, 2017 @01:39PM (#14562518)
This is an oversimplification. Some compute intensive parts can get significant speed ups through careful use of data parallelism (such as SIMD). Others needs parallelism at the thread level. Etc. Optimizing for memory patterns is important as is trying to keep the working set within a near-level cache.
Re:Rust as a gateway drug to Haskell by saosebastiao on Wednesday June 14, 2017 @11:25AM (#14553406)
Cache locality will never beat algorithmic complexity as a performance factor. Don't exaggerate its importance.
Re:Rust as a gateway drug to Haskell by falcolas on Wednesday June 14, 2017 @12:18PM (#14553765)
It can, when the constant portion of the algorithm chosen is high and the number of items being pushed through the algorithm is low.

e.g. bubblesort will beat quicksort for tiny lists or large lists which are already sorted.

Or, put another way, 1000 operations against 1ns latency memory (L1) has the same performance as 10 operations against 100ns latency memory (RAM).