I still believe that having the words "map", "filter", and "reduce" in source code is beneficial, in that it lets you reason about your program as a series of data transformations. But providing those transforms via actual generic functions/methods is not ideal.
https://github.com/lukechampine/ply … finally reached 100 stars after 2 years. Would be fun to revive someday, if I could figure out how to implement concise function literals (https://github.com/lukechampine/ply/issues/3 …). But surprisingly, I've found that my enthusiasm for map/filter/reduce methods has cooled...
-
-
Show this thread
-
First, it's impossible to write a single generic implementation that satisfies everyone's needs. In particular, if your "map" function takes an opaque function as an argument, you've immediately ruled out key performance optimizations. No one's gonna use "map" to write memset.
Show this thread -
Second, chaining map/filter/zip etc. efficiently requires a sophisticated compiler. And sophisticated compilers suck if you care about performance, because it's difficult to know when and why they will produce efficient code. Systems programmers want DUMB compilers!
Show this thread -
So I think treating transforms like normal functions is actually a mistake, at least if you want to get performance-conscious people to adopt them. What I really want is a way to *denote* a block of code as "a map piped into a filter" and have lots of nice tooling around that.
Show this thread -
(Macros, I think, are not the right choice here either: it's still difficult to chain them efficiently, and they tempt you to reuse a single generic-but-suboptimal implementation of each transform.)
Show this thread -
I guess there's a fundamental trade-off here: if you merely *denote* a block of code as a map transform, you might be mistaken, whereas a map function will definitely be a map function.
Show this thread -
At any rate, it seems like like there's an opportunity for a new systems language to provide dataflow-style constructs without having to compromise on performance; and perhaps this could be accomplished via tooling moreso than syntax.
Show this thread
End of conversation
New conversation -
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.