« first day (22 days earlier)      last day (1513 days later) » 

00:02
π is pretty easy to type on a macintosh keyboard, at least
ø, π, ∞ are option plus o, p, %
which are all pretty mnemonic
but I do seriously question going unicode in K
I do know that during the k6 days there was intense debate over how to have literals for dictionaries and tables
the ascii character set has been at the breaking point for some time
I get why arthur included if[]/while[] forms in k7, but it makes me a little sad. I was so blown away by the boldness of leaving them out in k5
I haven't missed them in oK
ngn
ngn
@JohnE why did he include them? to please converts from c?
at least in my experience in k4/q I've seen while used as a way to short curcuit out of big queries on disk when you need to query for something that might be in one of a few partitions of data on disk
@ngn: presumably. Also helps when you port over a complex algorithm from some other language. If you use the "while" forms of over/scan you can't mutate locals
whereas if[]/while[] operate within the same scope
it is more aesthetic to spend more time thinking and re-imagine an algorithm in a vector style, but some things are just really messy
Another use case for while is during ipc with some other non k
in almost 3 years of programming in k3 professionally I have not written a do[] or while[] loop, and I have deleted many of them
00:17
Program (web service maybe) that's you're hitting over some api
if[] I do use in moments of weakness, but I favor :[;;...]
when someone else writes a do[] in k3 it seems that most often they really wanted dyadic or variadic each
@NerdRage sometimes you can do those sorts of things with a fixed point over
error handling with retry is where things get really ugly
@JohnE yes good point! Will keep that in mind
ngn
ngn
@NerdRage in theory every while[] should be replaceable with some variation on {}{}/
exactly
I do like the way guard clauses work in the dfuns APL dialect; it's slightly less expressive than the K :[;;] "cond", but in a good way. I like that, as a special form, guards are explicitly part of the syntax of an anonymous function, whereas in K the special form :[;;] very much looks like it should just be a verb
ngn
ngn
@JohnE guards are inconvenient if you want to do something after the cond - you must repeat it at the end of each branch
{:[a;b;c];d} (k) is {a:d⊣b ⋄ c ⋄ d} (apl)
00:30
@JohnE re: if vs cond. I've seen a whole lot of if[1;...;... to deal with newline and ; idiosyncrasies within complicated :[;;] so gross though haha
ngn
ngn
@NerdRage in k4?
@NerdRage I find that idiom every once in a while (as well as do[1; ...]) and I do not like it
it's usually a sign that somebody didn't think a piece of code through very well or they are refusing to factor
@ngn k3 k4 supports [...] to define blocks
ngn
ngn
right, i was gonna mention [...] :)
k4 has blocks; I don't believe k3 does
I dunno if you guys ever looked at the iKe "snake" game demo. It may not be obvious at first glance, but there are zero conditionals: raw.githubusercontent.com/JohnEarnest/ok/gh-pages/ike/examples/…
the handful of instances where it seems like I need to do some sort of branching are done with indexing from a list, just to make a point
conditionals are only inescapable (1) for efficiency sometimes and (2) to terminate general recursive procedures. Obviously sometimes it's clearer to just use a conditional than to do some other contorted thing, but it's a very good educational exercise to try to write some complex code without using them.
ngn
ngn
00:37
my asteroids has 3 $[]-s. shame :)
it's still a really cool demo
probably the best asteroids clone to ever be implemented in K
ngn
ngn
also the worst, as it's probably the only :)
it's lonely at the top-bottom
2
ngn
ngn
@JohnE iKe is really cool. if i were you, i'd put a big link to it near the top of oK's readme
that is probably a good idea. It is a bit hidden...
00:43
@JohnE yes! I must say reading through your section in the oK docs on eliminating conditionals was a great learning experience for me as a budding k programmer! :)
glad to help. :)
01:04
I really tried to capture a bit of the "why" behind the more unusual features in the K toolkit. where/grade/group/encode/decode are sort of the crown jewels of array programming
2
apl and j of course have their own even fancier goodies but they tend to be more special-purpose
@JohnE have you had much experience with J?
a little tinkering here and there. I've read many of their docs to harvest ideas for K
and amusingly enough I discovered, read, and deeply contemplated the incunabulum several years before I'd even heard of K
I think it's hilarious that J has a verb which just so happens to generate an array of box indices for something like a sudoku puzzle
but arthur has historically cheated at sudoku too
I find J syntax much harder to read than K. Forks and digraphs are difficult for me to decode.
I assume it does get easier with experience
 
11 hours later…
11:51
Using shakti-python:
>>> shakti.sum(shakti.distinct(k("1 2 3 1 2 4")))
k('10f')
Kinda neat
@chrispsn is distinct = uniq?
@ktye looks like it
12:44
@JohnE what is the last column in the advert table of ok? It's labeled "3+v", with adverbs: eacha, scana, overa? Is that documented?
@ktye you can get a list of everything in the shakti namespace with “dir(shakti)” [not an answer to your last query]
@chrispsn you mean in python?
@ktye yep, after “import shakti”
13:08
What’s the most advanced IDE for k (or j, actually) at the moment / historically?
ngn
ngn
@chrispsn notepad :)
@ngn when it finally can read newlines!
@chrispsn yes, that's what I referred to. It didn't arrive yet on my pc.
@ktye hm. might have missed those in the manual, but they are mentioned here: github.com/JohnEarnest/ok/blob/gh-pages/docs/…
ngn
ngn
13:27
what are sv and vs (encode and decode) abbreviations of?
 
1 hour later…
14:38
k2 has a _sv and _vs for encode and encode, i think
ngn
ngn
@rcabaco yeah, but what do the "s" and the "v" stand for?
scalar from vector, vector from scalar
10 _sv 1 9 9 5 --> 1995
ngn
ngn
could be
10 _vs 1995 --> 1 9 9 5
according to the k2 docs
ngn
ngn
@rcabaco thanks
14:42
In k7 i don't know how it works
10/:1 9 9 5
1995
in k7
ngn
ngn
the apl world uses "encode/decode" terminology but many people (including myself in the early days) have trouble remembering which is which. i guess "sv/vs" was an attempt to avoid that in k
14:58
(it's still hard to remember)
ngn
ngn
@JohnE in k or in apl? in k the use of / and \ (or /: and \:) as vs and sv is consistent with what "over" and "scan" usually do - one returns a scalar and the other a vector
I meant _sv/_vs are still hard to remember. I find /\ or /:\: easier to keep straight.
my problem is I can never remember if it's "scalar from vector" or "scalar to vector"
but reminding yourself of things like this by experimenting is what a REPL is for
ngn
ngn
right, it's still confusing...
if they were forth words they'd be s>v or s2v or something
ngn
ngn
it must be "scalar from vector". the docs say /: eachright join|sv
in apl i have my own visual mnemonic for remembering ⊤ and ⊥ - i imagine a two-digit number as input written above a line, e.g. 19, and the result - two separate digits 1 and 9 written below it. so that's ⊤
and vice versa for ⊥
15:12
that's a good mnemonic
15:26
also, notice the join/split next to the sv/vs. that helps, for me.

« first day (22 days earlier)      last day (1513 days later) »