3 ms·
IDK, some of your criticisms seem a bit over the top. For example, compiling 1000 files with 1200 printfs results in ~80mb (according to my poor math skills) w
by UncleEntity 6y ago
IDK, some of your criticisms seem a bit over the top.
For example, compiling 1000 files with 1200 printfs results in ~80mb (according to my poor math skills) worth of static strings and then you state they aren't doing a very good job of creating small binaries because, dunno? Sure, some fancy whole program optimizations should be able to figure out the 1.2 million functions are basically the same and just compile one version -- which, honestly, you'd think the C++ compiler could also be able to figure out but seems to not be doing either.
Not that I think they should be banning people for things like this.
--edit--
Actually...thinking about this a bit it seems a particularly hard optimization problem since the functions only vary by the address of the string they print so the optimizer would need to know this detail while determining the function hash (or whatever is used for equality testing).
--edit2--
Yep, saw the downvotes coming...perfectly fine to bash on someone else's hard work on a new language though.
In all actuality, if I were working on an optimizer I don't even think I'd bother with something like this because if you program like this (duplicate functions) in The Real World™ then you get what you deserve.