« first day (118 days earlier)      last day (433 days later) » 

00:04
9 mins ago, by Cᴏɴᴏʀ O'Bʀɪᴇɴ
where can I find your version?
@Downgoat
@CᴏɴᴏʀO'Bʀɪᴇɴ oh good idea
will add soon
@CᴏɴᴏʀO'Bʀɪᴇɴ idk, can yuo paste the contents of stdlib.es6 here?
import API from './api';

let STDLIB = new Map();
STDLIB.Item = (Name, LIB) => STDLIB.set(Name, API.var(LIB(API)));

/** Global Libraries **/
STDLIB.Item("cheddar", require('./ns/cheddar'));

STDLIB.Item("Math", require('./ns/Math'));

// Interface Libraries
STDLIB.Item("Encoding", require('./ns/Encoding'));
STDLIB.Item("Buffer", require('./ns/Buffer'));
STDLIB.Item("IO", require('./ns/IO'));
<<<<<<< HEAD
STDLIB.Item("HTTP", require('./ns/HTTP'));
STDLIB.Item("fn", require("./ns/fn"));
=======
//STDLIB.Item("HTTP", require('./ns/HTTP'));
@Downgoat
00:22
import API from './api';

let STDLIB = new Map();
STDLIB.Item = (Name, LIB) => STDLIB.set(Name, API.var(LIB(API)));

/** Global Libraries **/
STDLIB.Item("cheddar", require('./ns/cheddar'));

STDLIB.Item("Math", require('./ns/Math'));

// Interface Libraries
STDLIB.Item("Encoding", require('./ns/Encoding'));
STDLIB.Item("Buffer", require('./ns/Buffer'));
STDLIB.Item("IO", require('./ns/IO'));
STDLIB.Item("fn", require("./ns/fn"));
//STDLIB.Item("HTTP", require('./ns/HTTP'));

/** Primitives **/
@CᴏɴᴏʀO'Bʀɪᴇɴ make it that
then do git commit -a
kk
now what @Downgoat
@Downgoat does cheddar have random yet?
@CᴏɴᴏʀO'Bʀɪᴇɴ Math.rand() is same as js's rand Math.rand(n) is math.rand integer 0-n Math.rand(a,b) is math.rand integer a-b
cool !
@Downgoat ideas: random ascii char, random choose, etc.
seeded randomness
 
2 hours later…
02:09
@CᴏɴᴏʀO'Bʀɪᴇɴ perhaps I'll do random from array. and then you can just do String.ascii.rand
@CᴏɴᴏʀO'Bʀɪᴇɴ idk how 2 do
02:48
const rand = (seed) => {
    let mw = 987654321 + seed;
    let mz = 123456789 - seed;
    let ms = 0xFFFFFFFF;
    return () => {
        mz = (36969 * (mz & 65535) + (mz >> 16)) & ms;
        mw = (18000 * (mw & 65535) + (mw >> 16)) & ms;
        return 0.5 + (((mz << 16) + mw) & ms) / 0x100000000;
    }
}
seeded randomness
@Downgoat
Is it unicorn?
*uniform
roughly, I think
lemme test
er
how do I test ? :P
OH WAIT
I built one of these things a while ago
a = [for(x of Array(1000))r()]
Array [ 0.41048587462864816, 0.45823797723278403, 0.6290974749717861, 0.9111813141498715, 0.4994967714883387, 0.45124117634259164, 0.2888823819812387, 0.6092420683708042, 0.4516223641112447, 0.9090371436905116, 990 more… ]
a.reduce((p,c)=>p+c)/a.length
0.4691773514065426
(r = rand(42))
night now tho
 
18 hours later…
20:27
@Downgoat does it look uniform to you?
@CᴏɴᴏʀO'Bʀɪᴇɴ yeah. I'll merge the string branch and then work on stdlib
 
1 hour later…
21:40
@CᴏɴᴏʀO'Bʀɪᴇɴ question: what timezone are you in?
@Downgoat idk, but it's 17:40 / 5:40 PM right now.
probably EST
you?
@CᴏɴᴏʀO'Bʀɪᴇɴ PST
-3 than EST
oh, same with irk
cool
Easterly is also CA IIRC
21:43
>_>
you are ninja confirmed
ninjagon
beautiful 10/10
22:10
@Downgoat BTW from where does the cheddar npm install get its material? develop?
22:21
@CᴏɴᴏʀO'Bʀɪᴇɴ it gets its material from NPM. Do you know about Github's "releases"?
@CᴏɴᴏʀO'Bʀɪᴇɴ okay well basically behind them are git "tags". In git, you can tag a specific commit with a tag. These are almost always used to specify which commit is what version. Currently the "release-1.0.0" branch is set as the deploy branch. When you push any commit(s) to github, travis will run tests on those and see if they are borked and all that stuff, if the tests pass, and the commit happens to be on the deploy branch and tagged, it'll "npm publish" and deploy to npm.
so if you want to publish to npm just commit yuor changes. git tag -a v1.0.0-beta.whatever -m "changes" && git push --all --follow-tags.
22:25
though usually use a PR instead of directly commiting to release-1.0.0
What do you think of shorthand: a.map(i->i.b) -> a.map(*.b)
it's interesting
I don't know how often it would be used
that said I want it to be more powerful:
Maybe like str.lines.map(*.chars)
a.map(*-1)
@CᴏɴᴏʀO'Bʀɪᴇɴ yeah
why not have:
str.lines.map((.chars))
idk
22:36
hm
then one couldn't have .map((.0))
also
*.0
could be interpreted as the monadic * of 0.0
or the operator *. on 0
There is no unary * atm iirc, but yeah, doing that would not let that happen
@Downgoat there isn't, but you are allowing the user to overload ops, right?
Yes, but unary * is not defined at all. Unary ops and binary ops are considered different ops by cheddar
though if the user is creating their own op I'd expect them to know what they're doing
did we ever decide what the syntax for defining your own op should be? :/
22:40
uh brb checking transfript
oh * wouldn't work with exponentation
** is exponentiation
wait nvm
BTW, is cheddar's ops greedy or what? like, is 3***4 3 ** (* 4) or 3 * (** 4)?
22:43
Jul 17 at 22:44, by Cᴏɴᴏʀ O'Bʀɪᴇɴ
5 mins ago, by Cᴏɴᴏʀ O'Bʀɪᴇɴ
op "~~" {
    prec: 234,
    monad: (-)
    dyad: (a, b) -> a * b - 1
}
@CᴏɴᴏʀO'Bʀɪᴇɴ that would be 3 ** * 4
@Downgoat cool, just wondering
@Downgoat with that in mind, what would this do:
op "*" {
    prec: 4000,
    monad: (a) -> a * a,
    dyad: (*)
}
you mean when donig 3***4?
no, in general
what would 3 * 4 do?
infinite recursion, because we define the dyadic * to be (a, b) -> (*)(a, b), or the former definition of *?
basically set *'s precedence to 4000 and set the unary behavior to a * a
@CᴏɴᴏʀO'Bʀɪᴇɴ oh :|
wait no it would infinite recursion
what would work fine?
22:47
wait let me think
@CᴏɴᴏʀO'Bʀɪᴇɴ this would work because (*) would generate a lambda referencing the former behavior of *. The same way a = a + 1 works. Doing dyad: (a, b) -> a * b would infinite recursion
oh, cool
what about
op "*" {
    monad: (a) -> a * a
}
hm :/ I guess precedence would have to be required
why not use the already existing prec of *?
unary ops always have precedence over binary ops so using binary * precedence isn't good idea
also, do monadic and dyadic precedence need to be specified?
22:56
imagine doing 1 + * 2 and it doing *(1 + 2)
@CᴏɴᴏʀO'Bʀɪᴇɴ now that I think about it, behavior for an operator is defined within a class
so operator behavior shouldn't be defined with the operator definition
perhaps:
@Downgoat wait why would it ever do that
monad "*" 1337
extend Number {
    monad * a -> a * a
}
@CᴏɴᴏʀO'Bʀɪᴇɴ idk
I've made quite a bit of progress on STDLIB since two days ago:
STDLIB:
 - [x] File read
 - [ ] Array#slice
 - [ ] Array#sum
 - [ ] min/max
 - [ ] Get buffer contents
 - [ ] get namespace contents
 - [ ] pad left/right
 - [ ] gsub / sub
 - [ ] test regex
 - [ ] change base
 - [ ] File write
 - [ ] Array rand item
 - [ ] String.ascii
 - [ ] Static string -> Arrays
 - [ ] Seed rand
I checked off one box :D

« first day (118 days earlier)      last day (433 days later) »