« first day (685 days earlier)      last day (850 days later) » 

08:27
@ngn i'm still shocked how you wast 2 bytes. i thought golfing is a sport to be taken seriously.
what if you define you language to be in "lambda mode"? then {} would be implicit. self recursion should be possible too. k had "o". it can be implemented as o:{..} but you only type the inner code.
ngn
ngn
@ktye on the other hand, if {} are implicit, we'd lose compositions :)
@ngn why?
i mean implicit only for the outer level. you can defined inner functions in the normal way.
ngn
ngn
09:24
@ktye suppose there's a challenge to golf the shape of an n-dimensional array. if you have implicit braces, {#'-1_*:\} won't work, and {(#'-1_*:\)x} would be too long. but more importantly, as i mentioned before, full programs are not allowed to take input in pre-defined variables.
also, you wouldn't be able to use helper functions because of k's lack of closures
 
5 hours later…
14:02
So I have a file with this:

1+2
2+3
4+5

If I run `shakti < a.k`, I get just `9`. Is there any way to get `3\n5\n9`?
@Dogbert if you put anywhere "space backslash", that will print (and pass on) the value on it's right. e.g. for debugging.
\ 1+2
\ 2+3
\ 4+5

worked, thanks!
it also works if you start with ./k a.k (without the redirection)
as you have noticed that will leave k in repl mode. so append two backslashes to the file
that doesn't seem to work for me :/
that's what I tried first
@Dogbert what happens?
14:09
oh wait.. I'm stupid.. instead of an alias I created a shell function to wrap it in rlwrap which doesn't pass extra arguments by default
works! still useful to know about space backslash
 
1 hour later…
15:14
is there a way to print strings without quotes? e.g. input: "foo", output just foo
,"foo" prints without quotes but prints an extra line
@Dogbert you have to use io verbs. e.g. ""1:"alpha"
"file"1:"chars" writes to a file and returns the file, 0: writes lines given as a list
can I write to stdout with this?
yes the empty x writes to stdout: ""1:"alpha"
ok, I updated the binary and it works now. The one I had before wasn't printing anything with empty x, thanks
 
5 hours later…
ngn
ngn
20:37
warning: in ngn.bitbucket.io/k i'll switch to a library for more efficient permalink compression, so old links won't work (unless someone tells me s/he really needs them)
20:51
strange that zlib is not built-in in js/html. given that browsers need to do compression anyway.
ngn
ngn
yeah
@ngn how large is the lib?
ngn
ngn
that's half ngn/k's wasm :)
but it can compress better than my huffman-coding experiments
there are so many versions. the minified does not really look so. there are still long names in it. not good style for a compression library.
Do you think k could match those compression speeds?
20:58
@ngn and twice of mine
ngn
ngn
@chrispsn compressed size is more important than speed here - it's for permalinks
@chrispsn first you have to implement it, than we talk about speed. feel free to make a png encoder in k, that would be a nice addition.
ngn
ngn
@ktye well, i've just downloaded it and i'm trying to make it work. i'll look for ways to optimize it later
@ktye is that manually created wasm?
@ngn it's written manually in w. that is compiled by w which exists as a go program, or in k: github.com/ktye/i/blob/master/_/i3/w.k
ngn
ngn
@ktye right, you've shown that before, i just didn't describe it properly
21:06
you might remember the online version, anyway i show it again: ktye.github.io/w.html
ngn
ngn
well, it displays some letters and some numbers.. unreadable to me :)
but it's cool that it's self-compiling
compiling k.w with w.k takes 4s in my browser. the new compiler k.k (which does not use the w language anymore) is much faster, but i haven't written the wasm code generator yet.
21:51
@ngn I've noticed some inconsistencies with n?dct and dct'vals (mostly when the dictionary key isn't !#vals)
another random thought would be to have =dct not enlist the keys (would be a nice trick to flip a dictionary's keys and values)
22:32
one last one (for now...) is to have _sym return the lowercased symbol

« first day (685 days earlier)      last day (850 days later) »