Underscore's indexOf seems designed to give a JIT conniptions: isSorted arg can be undefined, a boolean, or an index to start searching at.
-
-
Replying to @really_bz
@bz_moz Overloaded API front-ends can be abused but are an ergonomic win with a long history in JS.2 replies 0 retweets 0 likes -
Replying to @littlecalculist
@littlecalculist Also, this API doesn't allow fast indexOf on a sorted array with a nonzero start index? Not convinced it's the best API.1 reply 0 retweets 0 likes -
Replying to @really_bz
@bz_moz Sure. I just wouldn't judge the API by its JITability. IMO JS engine optimizations should pay more attention to JS idioms.2 replies 1 retweet 1 like -
Replying to @littlecalculist
@littlecalculist Sure, as long as people realize that type-stable code is pretty much guaranteed to end up compiled to faster machine code.1 reply 1 retweet 0 likes -
Replying to @really_bz
@bz_moz IMO it'd be reasonable to provide overloaded convenience entry points that dispatch to monomorphic fn's that are also exported.1 reply 0 retweets 0 likes
@littlecalculist Yeah, that seems pretty reasonable.
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.