« first day (435 days earlier)      last day (1100 days later) » 

00:28
@ktye I've thought about it a bit, but I didn't have much of a use for it in iKe. GUIs get rather hairy very fast. The set of widgets, properties, and constraints you might want to support is a combinatorial explosion which will eventually overwhelm a neat declarative system. Should be interesting to see where you go with it.
 
12 hours later…
12:52
@JohnE o/ @JohnE, how's it going? WRT a GUI for oK/iKe, maybe there is some potential in exposing a generic way to create/manipulate DOM elements that could then be used to build a GUI library in oK?
You may have already implemented this while building iKe.. I must confess I've been distracted by a runaway APL train for the last several weeks :)
 
5 hours later…
18:19
Hey, ab5tract!

I did some tinkering with DOM access from oK a long time ago. I made a library called "k-line" that allowed you to use <script language_="k"> elements on a page. It's a really tricky design problem to expose DOM stuff in a nice way to an array language, though; I was finding that the K I was writing to use k-line was almost as verbose as the JS would have been, and just as imperative.
web APIs have a huge amount of surface area to expose.
so in iKe I just went with a minimal set of IO primitives, rather than a comprehensive one, and focused on allowing a user to make fun little interactive sketches instead of trying to make something that could be "industrial-strength"
the input callbacks available in iKe were somewhat modeled after the "z" system arthur was tinkering with for kOS, but I think I've fleshed them out more than he did
@JohnE Makes sense to me. What I was thinking would only really make sense if there was a decent generalization that wasn't also too cumbersome to bother with as a result of that generalization.
it may be possible, I just think it's a large and complex design problem. I haven't spent enough time thinking through all the details.
It's something that would definitely take a lot of forethought -- and probably a fair number of decently traversed false starts too.
The programming of the UI layer in oK itself is actually less interesting in the end than trying to achieve a decent declarative DSL for interface design.
exactly
and there's also a delicate balance to strike between creating new sealed abstractions and exposing the underlying functionality of the DOM. The former lets you reduce complexity and make the new design portable outside of browsers, but e.g. CSS is already very powerful and flexible
so far I'm somewhat pleased with my experiments with "special-K" (beyondloom.com/tools/specialk.html if you haven't seen it) as an alternative abstraction for shader programs, which are one small piece of the puzzle for general purpose graphics programming in K
Regarding this hypothetical DSL, I was wondering if it might be interesting to go down a route where you could do some declarative stuff using plain text asciiflow.com
18:34
hmm. Like a visual "TUI" templating system?
@JohnE I haven't taken a close enough look at it yet but I've been planning to look into it to see whether I might be able to make some shaders to mimic the behavior of "Cool Retro Term" github.com/Swordfish90/cool-retro-term
@JohnE Yes exactly. Maybe even with a dash of Befunge thrown in
currently the special-K sandbox is only set up for running a fragment shader, and I think you'd need to install prototypes for the texture-mapping primitives, but otherwise something like that should be doable
@JohnE awesome! :D
special-K-the-compiler is its own freestanding single-file thing that one could easily integrate elsewhere (or simply use in a build system to statically generate the desired GLSL programs)
so you'd need to do a little tinkering but it's <400 LoC anyway. :)
Thanks for sharing all your cool experiments. It's definitely made it easier (slipperier?) to fall into obsession with array programming languages!
18:43
my pleasure. :)
 
1 hour later…
20:14
:O
That's going to take a minute for me to grok :)
Very cool effect
ngn
ngn
@JohnE atan2 and then sin,cos - that can be simplified :)
I don't know if you intended this or not but it's an interesting task for the reader to adjust the code to prevent fg and bg having the same color picked
ngn
ngn
@JohnE (cos a;sin a) -> (x%r;y%r) and you don't need a:
for some reason ((x;y)%r) doesn't work, btw
the -2? should arrive at unique foreground and background colors, but it's possible for the algorithm to composite together patterns that are entirely blank in some unlucky circumstances
@ngn context, please?
ngn
ngn
20:31
@JohnE i mean, in your animation if i replace (cos a;sin a) with (x%r;y%r) it still works, but if i replace it with ((x;y)%r) (which should be equivalent) it doesn't
ok, but which animation are you referring to?
ngn
ngn
@JohnE huh.. for some reason this link opened the colourful hexagons animation for me
but with a different browser it doesn't
alright, that makes way more sense. :)
ngn
ngn
@ngn and also, i'm stupid. x and y are probably not atoms there. ((x;y)%(r;r)) works
perhaps your browser had an older version of ike cached, so it was recalling the local storage copy of the last thing you looked at instead of retrieving the example from the new keystore?
ngn
ngn
20:37
@JohnE most likely
I guess I should just write more interesting iKe programs so everyone has an incentive to refresh their caches when I make changes. :)
21:12
clear your caches and go to:
https://ktye.github.io/#w%3A%60i%60b%60f%60c%60s%60rgb%60pushbutton!(13%3B1%201%3B1.23%3B%22xyz%22%3B%60alpha%60beta%60gamma%3B255%200%3B%7B%7Cx%7D)
executing the line declares w as a dict.
\g d shows a gui. change values and click on the last line (pushbutton) which executes the callback, with the updates values.
The gui can only do scalars, but you can set ranges in the input.
I just get 'RuntimeError: "unreachable executed"' in ktry()
what did you do, just the example?
the instructions are wrong, you have to type \g w (the variable name)
ah; that works. Why do you position the popup right-aligned to the center of the screen?
by default it's right aligned on the window, but there is also my drawing canvas. after all the gui is supposed to control graphical output. best would be to attach it next to the canvas.
gotcha

« first day (435 days earlier)      last day (1100 days later) »