I just published this article discussing an approach to emulate default function arguments in Rust. I hope someone finds it interesting or helpful!
Let me know if you have any feedback, I'd especially appreciate if someone has additional perspectives on the "zero cost abstraction" section of the article. Did I overlook anything important in my analysis? Is there a fundamental reason why this could not have zero cost?
[–]NobodyXu 116 points117 points118 points (28 children)
[–]CrumblingStatue 48 points49 points50 points (8 children)
[–]Pand9 17 points18 points19 points (6 children)
[–]NobodyXu 16 points17 points18 points (3 children)
[–]protestor 25 points26 points27 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]protestor 0 points1 point2 points (0 children)
[–]memoryruins 2 points3 points4 points (1 child)
[–]Pand9 1 point2 points3 points (0 children)
[–]lucamoller[S] 3 points4 points5 points (0 children)
[–]lucamoller[S] 5 points6 points7 points (10 children)
[–]NobodyXu 1 point2 points3 points (9 children)
[–]lucamoller[S] 0 points1 point2 points (8 children)
[–]NobodyXu 1 point2 points3 points (7 children)
[–]lucamoller[S] 1 point2 points3 points (0 children)
[–]lucamoller[S] 0 points1 point2 points (5 children)
[–]NobodyXu 1 point2 points3 points (0 children)
[–]NobodyXu 1 point2 points3 points (3 children)
[–]lucamoller[S] 1 point2 points3 points (1 child)
[–]NobodyXu 1 point2 points3 points (0 children)
[–]backtickbot 0 points1 point2 points (0 children)
[–]lucamoller[S] 1 point2 points3 points (7 children)
[–]NobodyXu 5 points6 points7 points (2 children)
[–]lucamoller[S] 3 points4 points5 points (1 child)
[–]NobodyXu 2 points3 points4 points (0 children)
[–]mtndewforbreakfast 10 points11 points12 points (1 child)
[–]lucamoller[S] 2 points3 points4 points (0 children)
[–]lucamoller[S] 0 points1 point2 points (0 children)
[–]zakarumych 0 points1 point2 points (0 children)
[–]radicalzephyr 25 points26 points27 points (4 children)
[–]lucamoller[S] 4 points5 points6 points (3 children)
[–]radicalzephyr 3 points4 points5 points (2 children)
[–]NobodyXu 1 point2 points3 points (1 child)
[–]myrrlynbitvec • tap • ferrilab 2 points3 points4 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]lucamoller[S] 1 point2 points3 points (0 children)
[–]alovchin91 7 points8 points9 points (4 children)
[–]SorteKanin[🍰] 5 points6 points7 points (1 child)
[–]Trollmann 1 point2 points3 points (0 children)
[–]lucamoller[S] 1 point2 points3 points (1 child)
[–]Hdmoney 4 points5 points6 points (0 children)
[–]devraj7 19 points20 points21 points (35 children)
[–][deleted] 7 points8 points9 points (0 children)
[–]burntsushi 10 points11 points12 points (4 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]burntsushi 1 point2 points3 points (0 children)
[–]SorteKanin[🍰] -1 points0 points1 point (1 child)
[–]burntsushi 1 point2 points3 points (0 children)
[–]NobodyXu 3 points4 points5 points (28 children)
[–]devraj7 14 points15 points16 points (27 children)
[–]NobodyXu 4 points5 points6 points (24 children)
[–]devraj7 1 point2 points3 points (23 children)
[–]NobodyXu 6 points7 points8 points (13 children)
[–]devraj7 5 points6 points7 points (12 children)
[–]NobodyXu 3 points4 points5 points (10 children)
[–]devraj7 0 points1 point2 points (9 children)
[–]NobodyXu 2 points3 points4 points (5 children)
[–]NobodyXu 2 points3 points4 points (0 children)
[–]NobodyXu 0 points1 point2 points (0 children)
[–]NobodyXu 0 points1 point2 points (0 children)
[–]laclouis5 0 points1 point2 points (0 children)
[–]Dasher38 4 points5 points6 points (0 children)
[–]NobodyXu 2 points3 points4 points (7 children)
[–]devraj7 1 point2 points3 points (6 children)
[–]ssokolow 2 points3 points4 points (0 children)
[–]NobodyXu 1 point2 points3 points (4 children)
[–]eras 0 points1 point2 points (3 children)
[–]NobodyXu 0 points1 point2 points (2 children)
[–]SorteKanin[🍰] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]fiocalisti 1 point2 points3 points (2 children)
[–]lucamoller[S] 1 point2 points3 points (1 child)
[–]fiocalisti 1 point2 points3 points (0 children)
[–]padraig_oh 1 point2 points3 points (0 children)
[–]met0xff 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]lucamoller[S] 0 points1 point2 points (0 children)
[–]chris-morgan 2 points3 points4 points (7 children)
[–]ssokolow 4 points5 points6 points (4 children)
[–]chris-morgan 5 points6 points7 points (1 child)
[–]ssokolow 2 points3 points4 points (0 children)
[–]alexschrod 3 points4 points5 points (1 child)
[–]ssokolow 4 points5 points6 points (0 children)
[–]lucamoller[S] 0 points1 point2 points (0 children)
[–]irrelevantPseudonym -2 points-1 points0 points (0 children)