you know, this is a common kind of refrain that i hear but i only hear it about especially bad shit in procedural languages >_
-
-
Replying to @beka_valentine @ManishEarth
like, yes, its old, and its C. so lets consider the reason someone writing C in 1995 would have made this decision: "Context switches are expensive! Don't call a function if you don't have to, b/c of the cost!"
1 reply 0 retweets 1 like -
Replying to @beka_valentine @ManishEarth
which is a fair point, except, it's a new language, its interpreted, and its 1995. this is a canonical case of very premature optimization, and putting performance above readability and maintainability
3 replies 0 retweets 1 like -
Replying to @beka_valentine @ManishEarth
also couldn't the C compiler inline functions
1 reply 0 retweets 2 likes -
Replying to @mountain_ghosts @ManishEarth
that would make it even worse if that were true. i was giving C the benefit of the doubt that it can't inline
1 reply 0 retweets 1 like -
Replying to @beka_valentine @ManishEarth
(idk I was not writing c in 1995 but it can these days?)
2 replies 0 retweets 2 likes -
Replying to @mountain_ghosts @ManishEarth
i would be unsurprised if this is the influence of Haskell backwards on C, tbh
1 reply 0 retweets 2 likes -
Looking at some papers, it sounds like inlining is from the 80s, so it's older than Haskell
2 replies 0 retweets 1 like -
Replying to @porglezomp @beka_valentine and
A lot of classic C compilers didn’t inline back then, or inlined very badly. For example the inlining heuristic of Go’s initial compiler was “is the function one source line of code”.
2 replies 0 retweets 7 likes -
Replying to @pcwalton @porglezomp and
To illustrate how bad the situation was, “An Inlined Function Is As Fast As a Macro” was one of GCC’s main selling points for a long time, and was considered an advanced compiler feature.
2 replies 0 retweets 6 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.