These are chat archives for ramda/ramda

11th
May 2015
Asaf
@asaf-romano
May 11 2015 02:10
Hey all, I did some naive measurement of "native" uniq (Array.from composed on top of Set) vs. ramda's implementation, and as I suspected, the native implementation seems faster. Is it worth filing, or is it a priority to keep uniq implemented by uniqWith?
(I'm testing in Firefox)
Not going to work in chrome, because it doesn't have Array.from, but it can be easily polyfilled
Scott Sauyet
@CrossEye
May 11 2015 02:35
@asaf-romano: There's a button near the top of the REPL that gives you a short link.
Asaf
@asaf-romano
May 11 2015 02:37
oh sorry
didn't notice
Scott Sauyet
@CrossEye
May 11 2015 02:37
I don't think we'd spend too much time worrying about performance numbers like that. We optimize our code where we can, when it's not too intrusive. But we almost never fall back on native versions of incompletely implemented specifications. (Anything other than keys?)
The lodash-Underscore differences demonstrate some of the futility of assuming that the native implementation will be a panacea.
Scott Christopher
@scott-christopher
May 11 2015 02:38
After running it a few times, your example stays pretty close to 1 for me, even showing uniq as faster on occassions
Asaf
@asaf-romano
May 11 2015 02:38
Set is implemented across the board, and that's the key here. Array.from can be simulated easily.
Scott Sauyet
@CrossEye
May 11 2015 02:39
Ramda works in ES3 environments. :smile:
We won't struggle too hard to keep that, but if it's not a struggle, it's kind of nice to stay as backwardly compatible as possible.
Asaf
@asaf-romano
May 11 2015 02:40
Yes, I know this, even if integrated, wouldn't replace the current implementation
Scott Sauyet
@CrossEye
May 11 2015 02:40
We try to avoid that sort of branching, although we don't skip it altogether. There would have to be a pretty strong reason.
Asaf
@asaf-romano
May 11 2015 02:41
understood
Scott Sauyet
@CrossEye
May 11 2015 02:41
My ratio has varied between 0.65 and 0.7. I don't think that's enough to worry about. In raw numbers, this means that the operation can only be done 7.6 million times per second rather than 12.2. These simply are not numbers that make me want to clutter up the source code.
If we were looking at 10:1 ratios or some such, I'd be more receptive.
Asaf
@asaf-romano
May 11 2015 02:42
hold on, this uses Performance.now :)
it's not like Date.now, you cannot "translate" to seconds.
Scott Sauyet
@CrossEye
May 11 2015 02:43
oh, ok, never actually used it.
Asaf
@asaf-romano
May 11 2015 02:43
I admit that I expected worse results. I filed this after doing this on my own in my project
I use destructing-like import, so it's uniq(map()) and you cannot even tell if you're using ramda or not :)
Scott Sauyet
@CrossEye
May 11 2015 02:45
I like to use Ramda the same way.
Switching to new Date() gave the same sorts of numbers.
Asaf
@asaf-romano
May 11 2015 02:47
what's ramda's algo like? does it generate a hashable string form of some sort or does it rely on indexOf?
Scott Sauyet
@CrossEye
May 11 2015 02:47
Looks like performance.now() should be interchangeable with new Date() when used for these calculations. It's just got higher precision.
Asaf
@asaf-romano
May 11 2015 02:48
oh sorry for misleading. I was confused by another tick-API I'm using.
Scott Sauyet
@CrossEye
May 11 2015 02:49
Asaf
@asaf-romano
May 11 2015 02:50
in REPL am I using the uniqWith version already? I noticed that was fixed just a few days ago
Scott Sauyet
@CrossEye
May 11 2015 02:52
The REPL so far has only published versions. For some reason, you're using an older one, v 0.11.0. That's in the first query parameter. Most recent tag is v 0.13.0
If you don't supply it, this defaults to latest.
Asaf
@asaf-romano
May 11 2015 02:53
just autocomplete nonsense.
Scott Sauyet
@CrossEye
May 11 2015 02:54
I don't remember the recent change to uniq. Getting lost in everything that's happening.
gtg
Asaf
@asaf-romano
May 11 2015 02:55
thanks for your time.
Asaf
@asaf-romano
May 11 2015 04:09
I just realized that an indexOf check would be fine in the previous example, because it's just four items.
at 0-3
with 300 uniq objects*1000, I get 0.18 ratio
and at 500, you are at 0.1.
it gets worse as you go on.
Asaf
@asaf-romano
May 11 2015 04:22
filed ramda/ramda#1077
Asaf
@asaf-romano
May 11 2015 05:57
I'm having an somewhat embarrassing problem here, which I'm sure is a common scenario: I would like to use compose a function (with composeP/pipeP), but the function that should be taking the argument is not the last (/first) function. something like promiseValueFor = composeP(prop, promiseMap) (where promiseMap takes no arguments and prop takes the argument passed to the new function)
I could probably hack something with converge, but it doesn't smell right.
Asaf
@asaf-romano
May 11 2015 06:09
I guess converge+call would work find if only this didn't involve promises :-/ (Edit: converge+flip(call)... again, feels wrong)
Asaf
@asaf-romano
May 11 2015 06:22
Without promises: http://bit.ly/1IvI6f6
mac10688
@mac10688
May 11 2015 19:02
I would love to hear some of you guys talk about this project on a podcast. Such as javascript jabber. Any plans for that?
Michael Hurley
@buzzdecafe
May 11 2015 21:10
@mac10688 how and to whom do you pitch that idea?
Michael Hurley
@buzzdecafe
May 11 2015 21:34
just published 0.14.0
David Chambers
@davidchambers
May 11 2015 21:35
Excellent!!
Michael Hurley
@buzzdecafe
May 11 2015 21:35
@davidchambers xyz makes it very easy
David Chambers
@davidchambers
May 11 2015 21:35
That’s the idea. :D
Scott Sauyet
@CrossEye
May 11 2015 21:36
wow, I was just getting online to look into it!
Michael Hurley
@buzzdecafe
May 11 2015 21:36
gonna update docs now
Chet Harrison
@ChetHarrison
May 11 2015 21:37
@buzzdecafe thanks!
Michael Hurley
@buzzdecafe
May 11 2015 21:37
@ChetHarrison my pleasure
Chet Harrison
@ChetHarrison
May 11 2015 21:39
when pulling from cdn does it attach to the window?
Michael Hurley
@buzzdecafe
May 11 2015 21:40
yes, should expose window.R
Chet Harrison
@ChetHarrison
May 11 2015 21:40
k thx
Scott Sauyet
@CrossEye
May 11 2015 21:40
This message was deleted
This message was deleted
Michael Hurley
@buzzdecafe
May 11 2015 21:41
This message was deleted
Scott Sauyet
@CrossEye
May 11 2015 21:41
This message was deleted
Chet Harrison
@ChetHarrison
May 11 2015 21:42
If only all my questions would be answered in real time :wink2:
Scott Sauyet
@CrossEye
May 11 2015 21:42
They will... for some definition of "real time".
Michael Hurley
@buzzdecafe
May 11 2015 21:50
just keep timing your questions for when we're all hanging out
Michael Hurley
@buzzdecafe
May 11 2015 21:58
0.14 docs published
Scott Sauyet
@CrossEye
May 11 2015 22:08
Very nice! The man's a machine! I have to go finish mowing the lawn and do something about dinner. When I get back, I expect all open issues to be resolved, all right?
Jethro Larson
@jethrolarson
May 11 2015 22:53
It's really hard to find anything on js futures that isn't talking about jquery promises. They're very different, right?
I found this and I'm trying to wrap my head around it https://github.com/ramda/ramda-fantasy/blob/master/src/Future.js
Raine Virta
@raine
May 11 2015 23:17
neat
$ cat latest.json | R 'pluck \name' | R 'take 7' | R 'map to-upper >> (+ \!)' | R 'join " "'
"__! ADD! ADJUST! ALWAYS! APERTURE! APPLY! ARITY!"
Jethro Larson
@jethrolarson
May 11 2015 23:19
You made a Ramda cli?
Jethro Larson
@jethrolarson
May 11 2015 23:20
Sweet :)