« first day (842 days earlier)      last day (693 days later) » 

03:14
some thoughts on recent k language work gist.github.com/chrispsn/2f6ffa08d621d0b5516b456f89fffdd2
 
2 hours later…
05:09
if there's no draw, and the last statement in a program returns drawable tuples, iKe will render a static image for you. Arguably something like
{(80+(%t)*(cos;sin)@\:t:x*2.4;;1)}'!:
should be valid
neat!
how does ike store gists?
it stores programs in a backend I host. please do not abuse it.
oh, thanks a lot
I was confused on how the links were so short
@JohnE this was really helpful
long ago iKe and another project of mine, Octo, used github's anonymous Gist API to store programs. Then Github broke those APIs and started demanding auth tokens, like everybody does now, so I had to furnish a replacement
05:20
whoa what's goin on there
that is really short
doin' fun stuff with &, mostly
i shall be borrowing that
pretty neat how it works
 
2 hours later…
08:09
good application for a 'unit range' primitive {(!x)%x}
 
2 hours later…
ngn
ngn
09:49
@chrispsn "mark firsts" was originally "nub sieve" ~: in j and since recently ≠⍵ in dyalog
admittedly, "mark firsts" sounds better than "nub sieve"
@ngn ah! thanks. i know little about j primitives
ngn
ngn
i should have linked: ~:
@ngn now added
 
3 hours later…
13:21
Is it intentional that 0N#"" is ," "?
I would have thought it would be ""
ngn
ngn
@rak1507 fixed, thanks
13:44
does K6 have no power function?
n m/x ?
yeah i'm already using that
wdym then
like, is there an equivalent to * in APL or nah
ohh, that sort of power
13:46
I was thinking my searching skills were bad
don't think so, oK has exp, afaik ngn/k doesn't have anything
interesting
14:02
iKe also has pow and some other goodies: github.com/JohnEarnest/ok/tree/gh-pages/ike#built-in-functions
@chrispsn nice golf
ngn
ngn
14:13
@Razetime it's just very rarely needed for the kinds of problems i've been solving with ngn/k
i suppose so
I guess */# should be enough for now
14:49
hyperbolic tangent is really useful for doing sort of a "fisheye lens" distortion on coordinates, atan2 is useful for converting polar->cartesian coordinates, and most of the rest I included for the sake of completeness
I was kinda shocked to discover that q doesn't have atan2
idea: mario in iKe
super miKe brothers
I'll try world 1-1
examples/tiles.k is like 1/3 of the way to a zzt
zzt?
I'm worried about how I'll figure out jumping in iKe
15:01
if you've never implemented a platformer before you're in for a wild ride. the special case stuff that is necessary to make such a game feel good and responsive involves lots of things that are not physically plausible
@JohnE i have, just not in something as barebones as iKe
processing has more fps
question: how do i decode a number fully?
oK's "decode" requires a list as its left argument; you'll just have to decide a maximum number of digits to display
so there's no "base decode until fixed" kinda deal
this limitation is because oK uses exactly the implementation of encode/decode that k6 did: github.com/JohnEarnest/ok/blob/gh-pages/oK.js#L946
alright
I'm using ngn's k
due to speed reasons
i think I may do better with a while loop
15:23
@rak1507 nice golf on that substring question!
15:35
one thing I am curious about is the behavior of each on empty lists. why have #'"" return !0 when #'("";"") returns 0 0 and #"" returns 0? I guess the difference would be treating () as ,() when it's being each'd over
16:01
@ngn is $ on integer arrays not implemented?
@ngn also, ~/k/k <file> is outputting nothing
@Razetime x$y pad?
yes
padding
yeh that is only on strings. you could try indexing into your array out-of-bounds, then filling those nulls with your desired padding value
hm i doubt that'd work for negative padding
16:20
it's not elegant but it's doable
@coltim i just worked around it
nice function though
@Razetime borrowed from the best!
wait it's already in the thing??
well, the only difference is that the fill value is specified (vs. being " " for strings and 0N for integer arrays; i.e. what you get by indexing out of bounds)
but I think i$y has always been restricted to strings in the various k's
(I feel that x$y and x#y have a surprising amount of overlap given the paucity of ASCII symbols)
@ngn need help ↑
16:35
@Razetime I don't know if ~/.../ is supported; you could try specifying the full path (without quotes)
sadly not working
ngn
ngn
16:52
@Razetime most likely missing eol at eof in 760.k, otherwise you'd have 'io instead of 'dom
\l takes the path as-is, it doesn't do shell expansion, so you can't use ~ and surrounding quotes
17:06
@ngn ok what about ./k <filename> ?
running it with ./k gives no result for somereason
@ngn it was a problem with dos line endings
need help with optimizing this: project euler
ngn
ngn
17:27
@Razetime the latest problem?
yep, latest one
ngn
ngn
it should take <1s but you have to do some thinking first
10^18 is not bruteforceable, not even in k :)
ah
you must already have a better way lol
ngn
ngn
@Razetime yes, i solved it in python but there's no reason why it wouldn't work in k too
there must be a simplification then
not my forte but i'll try
ngn
ngn
17:31
@Razetime are you a friend of mine in PE? i don't see anyone with "raze" in their name among my friends
there's a friends list?
I'll check it out
where can i send my friend key
ngn
ngn
@Razetime yes, second to last tab. friends can see each other's lists of solved problems.
i have martin janiczek
that's it
so umm
ngn
ngn
@Razetime if you don't want to publish yours, you can use mine: 145835_8206040bb70116d02504289dce2c755b
where can i send
oh cool
ngn
ngn
17:33
i publish mine in the description. many eulerians do that.
whoa 334
ngn
ngn
there are people with twice that many :)
ah yeah but it's still pretty cool :)
1702763_1NnHzTvMGBI1fQu4civbcRfhEVyCkcfM @Razetime
17:39
do you know who Mike is?
ngn
ngn
Mike - 494! crazy
@rak1507 idk
wonder if he's a well known apl/j/k-er
@ngn did you do 757?
ngn
ngn
iirc one of the competition winners is a mike. may or may not be him.
@rak1507 no. you should be able to see what i have solved.
oh yeah I can, sorry
 
1 hour later…
18:43
Which APL/J/K variant makes it the simplest to write a network server (which implements some API) that's simple to deploy on Linux?
Also, which APL/J/K variant is the most stable and backwards-compatible? It seems like APL and J win out over K here if you take K as a series and don't freeze the language at individual versions like K6 or K9.
(can't even freeze K9 yet, b/c it's still in development…)
k9 has been especially mercurial and undulating
ngn
ngn
19:06
@jordancurve k4 (kdb+)? but not free
@jordancurve well dyalog apl will be easily the most backwards compatible I'd guess
ngn
ngn
@rak1507 yes, backwards-compatible till it hurts, but networking is far from simple and it's not free either
yeah, not saying backwards compatibility is necessarily a good thing
ngn
ngn
@jordancurve if you don't have legacy code, why does backwards compatibility matter to you?
@JohnE good words
19:22
@ngn documentation
ngn
ngn
@JohnE i see that as a separate concern
19:58
separate, but not unrelated
ngn
ngn
20:27
@JohnE not sure what you mean. if you have an old bug, you have two choices: either fix it (including docs) or deliberate ignore it to protect existing code that may be relying on it (the dyalog way). in either case documentation should be reflecting reality as clearly as possible.
20:39
What I'm getting at is that the documentation for users of your language is not just the official reference docs (which should obviously be kept up to date) but also materials created by the broader community. The more aggressively you break things, the less surrounding material remains useful
I mean, a not insignificant number of people learned K through either the materials at NSL, the Kona wiki, or my oK docs, none of which are remotely official
ngn
ngn
you can't make progress without making changes
also, breaking changes between major versions are generally considered ok (i'm not a fan of semver, but many people are)
I guess it's a question of where the users are at. if there are millions of lines of legacy code that are (mostly) happily humming away, breaking changes are anathema. if the domain is fresh/undefined enough, you have javascript-framework-of-the-week (which I believe has died down a lot in the past few years, but was quite hectic circa 2015)
then there's how well the transition is handled; with I guess deprecation warnings far ahead of time, what happened with python 2 => 3, or I guess the various updates to the C standard (C89/C99/C11)
ngn
ngn
20:55
right, bugs in popular software like browser bugs take a long time to disappear. but in apl's case we're talking about a hundred (hundreds?) active users worldwide. practically, they all know each other.
(i do mean just apl, not k)
21:19
@coltim worth observing that the python 2/3 split was and still is a clusterfuck
in no small part because python 3 changed a bunch of stuff it didn't need to
apl is that small of a community?
@JohnE I'll be forthright and come and out say that removing the print statement really irked me
but they know have even more parenthesis ...
I mean this was pre-my exposure to K/APL/etc., but the simplicity of print "Hello, world!" was amazing compared to System.out.println("Hello, world!")
print() and type() in python keep tripping me up every time
ngn
ngn
21:33
@juanez how many would you estimate?
@ngn i have no idea, im not involved in the apl world
@coltim they changed a bunch of stuff in the spirit of making python a more "mature" language, completely forgetting that the appeal at the time was python's supposed beginner-friendliness. (imo python is a terrible language for beginners, but that's a separate rant entirely.) Modern python continues to fester and grow more and more special-cased sugar features while still being fundamentally hamstrung by poor decisions early in its life
in a few decades I am fairly confident that at best python will be regarded like R: a nutty, half-baked mess that is strangely blessed with a desirable library ecosystem. At worst, it is how many people today view COBOL: highly arbitrary legacy code which is unpleasant to modify
it introduced a generation of programmers to a whole pile of terrible ideas like semantic indentation and it cannot die soon enough
some of the largest programming languages are basically just bad mistakes (python, javascript)
ngn
ngn
my #1 reason to reach for python - bigint
javascript has problems but I've never found them close to as severe as python. NPM is a huge mess, but that's the ecosystem, not the language
ngn
ngn
21:47
@coltim strange decision to force print to be a function but not do that with assert
i find the lack of ints disturbing
ngn
ngn
@juanez that's one of my top complaints about apl
@JohnE it's probably some impedance mismatch but to me "basic" operations like "get the distinct items of this array" are.. painful in javascript
js is very plastic, though- you can fix things like that in a few lines of boilerplate
extend a few prototypes, write a few helpers, boom
it's never going to be an APL obviously
ngn
ngn
21:52
apl/j/k do arrays operations right. js/scheme does first-class functions and closures right.
why haven't the best of both worlds been merged yet..
closures would be nice in k/q ...
(oK has closures and lexical scope)
i assume closures makes the memory management hairier ?
very much yes
ngn
ngn
shakti is actually a departure from first-class functions too. see @chrispsn's write-up from earlier today. sections 1 and 2 essentially describe that. sad to read.
e.g. 123_x removes 123 from x, but (mod)_x doesn't remove the function mod from a list that could potentially contain it. it does something completely different.
22:02
what does this has to do with 1st class functions (or the lack of)? it's just an overload f_ f# f^
ngn
ngn
somehow i was hoping that k would one day become more like a lisp with arrays than an apl with first-class functions, but the opposite is happening
@ktye f is no longer treated as an ordinary object when it's on the left of _
(+)_(+;-;*) doesn't work the same way as "a"_"abc"
k9 just seems like churn and dead-ends to me; not a clear enhancement or refinement
k3, k5, k6 and k7 all show a clear progression of being more general without becoming drastically more complex
ngn
ngn
@ngn correction: i'm not sure if 123_ is drop like before. if yes, (,123)_ may be a better example.
vector# or _ are set-take set-drop
ngn
ngn
@ktye so, if i want to remove + from the list x, it should be (,(+))_x ?
22:12
maybe. i cannot try
I would say exprs are increasingly not first-class
ngn
ngn
@chrispsn but:
 "a"_"shakti"
"shkti"
 (+)_(-;*;+;%;!)
(+)_(-;*;+;%;!)
^
!rank
If anything the atom case is inconsistent
ngn
ngn
@chrispsn i never understood the need for two similar but subtly different kinds of user-defined functions
it's almost as bad as dyalog's tradfns vs dfns
And it does move away from 'lists are functions'
22:23
@ngn absolutely agreed
@ngn I think of exprs as computed table/dict cols/values
after implementing views in oK and using them quite a bit to write various demos I'm really not convinced they pull their weight
it's a really marginal enhancement over a nilary function
@ngn this feels like it has echoes of A+ (I believe functions would have to be boxed/enlisted to be "data" items in a list)
ngn
ngn
@chrispsn list[index] no longer shares the same syntax with func[arg]?
@JohnE i've not really ever used views in q.. i have no idea if there's a really good use case i'm blissfully unaware of ?
22:40
in k3 they're largely regarded as a misfeature
in that implementation they're rather slow and can make it very hard to reason about performance
23:29
@chrispsn something that only recently "clicked" for me was the behavior of grade up/down and where on a dictionary; sure, the result of returning the keys of the dictionary was useful but it wasn't until I figured out that built-ins that return indices (grade up/down, where, find) instead return the dictionary keys (which play the role of the array "indices")
it makes the rationale for !list returning !#list stronger, as a parallel for !dict returning the keys

« first day (842 days earlier)      last day (693 days later) »