On Saturday, 21 September 2013 at 10:53:17 UTC, Peter Alexander
wrote:
On Saturday, 21 September 2013 at 10:29:35 UTC, Dicebot wrote:
Lot of code bloat comes from stuff which is unnecessary in the
big picture but compiler has to means to decide it during
compilation. There is no real reason why
`[1, 2, 3].map!(a => a*2)().reduce!((a, b) => a + b)(0)`
can't be reduce to single loop and inlined, leaving no traces
of actual std.algorithm usage.
There's no theoretical reason, but plenty of practical reasons.
bearophile linked to a talk by Chandler Carruth that explains
the difficulties encountered by inlining optimisers.
Either you are confusing with me (
http://forum.dlang.org/thread/mvbqiwajntrivndyl...@forum.dlang.org?page=8#post-mqcwjbgxildixehsxthe:40forum.dlang.org
) or I missed that post by bearophile.
Also, Dicebot have some very good points. Function can't be
stripped from the executable if they are exported by default.