Can Your Programming Language Do This? (2006)
joelonsoftware.com
joelonsoftware.com
What’s next? My predictions are:
- expression orientated
- algebraic effects
I remember this came up a lot in late-aughts functional programming discussions. But is there any language where this actually works? Where map is just parallel because of course it is?
https://news.ycombinator.com/item?id=2476440 - April 23, 2011 - 110 comments
https://news.ycombinator.com/item?id=2209970 - February 12, 2011 - 1 comment
Couldn't find more, but I thought it had come up more times.
Mainly due to not cribbing from other older languages like Lisp and Algol 68.
function Cook( i1, i2, f )
{
alert("get the " + i1);
f(i1);
f(i2);
}
Cook( "lobster", "water", PutInPot );
Cook( "chicken", "coconut", BoomBoom );
(or worse) Cook("lobster",
"water",
function(x) { alert("pot " + x); }
);
Cook("chicken",
"coconut",
function(x) { alert("boom " + x); }
);
This to me looks like a great example of The Wrong Abstraction. You're removing a tiny bit of code duplication at the cost of creating a weird, hard-to-read, inflexible, limited-use helper; he's taken something straightforward and turned it into, honestly, a bit of a hash.