« first day (1508 days earlier)      last day (1443 days later) » 

00:26
CMC: UPDATE So I understand the problem better now
    f g h←0
    f ← g + 1 ⍝ every generation
    f ← f - 10 ⍝ if purchasing a point in g, costs 10 f
    g ← g +1  ⍝  when a point of g is purchased
    g ← h + 1 ⍝  every generation
    g ← g - 10  ⍝ if purchasing a point in h, costs 10 g
    h ← +1     ⍝ when a point in h is purchased

    Given these rules, optimize for f ≥ 1000 in the fewest generations
Now that I understand, this is a pretty interesting problem
think I'll have a go at it myself
if I've understood it right by buying Gs and Hs whenever you can you can do it in 43
not array based though
is it known what the minimum number of moves is? @nathanrogers
@rak1507 I'm not sure
@rak1507 how do you figure 43?
at what point do you stop purchasing Gs and Hs?
I don't currently, but you should because it's not worth it past a certain point
@nathanrogers there's a lot of stuff in that picture. I'm assuming you're meaning the windows logo in the top left? :P
CMC: draw the windows logo
00:41
So the original picture I shared was someone trying to determine how high you could get in less than 1k steps using only F and G
@Wezl my solution: abrudz.github.io/ngn-apl/web/… , still illegally using ngn/apl
@nathanrogers hmm
well it seems that with that variation, buying g takes 10 moves to be worth it, so buy g as much as you can unless you're less than 10 steps away from 1000?
@rak1507 It takes me to about 43 steps to get my first H
ah, I must have misunderstood how it works
at 43, buying up exactly when possibe, I have f=5, g=0, h =1
00:47
I'm confused, you start with 0 for all, then after iteration 1 you have what, 1 1 0? then what, 2 1 0? then after that, you still have 2 1 0
are some of your ←s meant to be +←s
11 moves ←→ F=0;G=1 ⍝ spend 10 F to get a G
17 moves ←→ F=0;G=2 ⍝ spend 10 F to get a G
22 moves ←→ F=2;G=3 ⍝ spend 10 F to get a G
25 moves ←→ F=0;G=4 ⍝ spend 10 F to get a G
28 moves ←→ F=0;G=5 ⍝ spend 10 F to get a G
I still don't have enough G's for 1 H yet
31 moves ←→ F=2;G=6
34 moves ←→ F=6;G=7
36 moves ←→ F=4;G=8
38 moves ←→ F=3;G=9
40 moves ←→ F=3;G=10
41 moves ←→ F=3;G= 0;H=1
I don't understand how you get past 2 1 0, f←g+1 sets f to 2 still, g←h+1 sets h to 1 still, so nothing changes
This is F←G+1 for each generation
@rak1507 you're right, its
G←G+H
that's my mistake
is it f←f+g too?
no because if f is 0 and g is 0, it never move
F←G + 1, you always get 1, but you get 1 more with each G
00:54
ok
oh, I guess there's another catch. "Spending" is a step, but only the purchased value gets incremented, while the spending value gets decremented
when you buy an item, only the purchase increments, f doesn't increment
oh ok
like betwen step 40 and 41, f doesn't move
can you buy g and h in the same turn?
no, purchase is a move
00:59
at the start, you have 0 0 0, then f←g+1, g←g+h, so 1 0 0, but then it stays at 1 0 0
there's probably some other rule I'm not understanding
derp, f←+/ f g 1
ok, that's what I thought, thanks
('fgh')⍪ 0⍪⊃⍪/((10 3↑⍪⍳10)⍪0 1 0)((10 3↑(⍪⍳10),1)⍪0 2 0)
if that helps
I think I have an 86 move solution
That should show explicitly that each "purchase step" is its own move
@rak1507 whatcha got?
01:09
oops, think it's 90, hang on
     fm←{
         t m f g←⍵
         ~∧/t m≤1000 100:g
         ⎕←t
         ceil←⌈g÷⍨⌈/0,10-f
         ntot←+/f,g×100-m
         nmov←+/m 1 ceil
         newf←+/¯10 f,g×ceil
         newg←g+1

         f,∇ ntot nmov newf newg
     }
     fm 0 0 0 1
I translated the python version
90≡⊃11 17{a b←⍺⋄n f g h←⍵⋄(g≥10)∧g<a:(n+1),f,(g-10),h+1⋄(f≥10)∧f<b:(n+1)(f-10)(g+1)h⋄(n+1)(f+g+1)(g+h)h}⍣{1000<1⊃⍺}4⍴0
@Wezl How's this one?
01:25
wow that's pretty good!
01:36
@Marshall wait, I thought he was saying try to generate a blue screen
@rak1507 can you splain?
so I'm still not sure if I've implemented it properly but the idea is buy as many gs and hs as you can, but only if g and h aren't above some constants a and b
and then I just bruteforced a and b and that was the minimum in the small number I tried
02:01
@Marshall nice
@Marshall that's done with sin I'm gessing?
@nathanrogers Basic idea is ⋆⟜3⊸-, or x³-x.
 
3 hours later…
05:23
is there a better way to get ∊(4 4∘⍴)¨(7 12 17 22)(5 9 14 20)(4 11 16 23)(6 10 15 21) (used in md5)?
I guess it is possible to start with 4 4 4⍴7 12 17 ... and rotate the cube somehow
never mind, I figured out that dyadic transpose does that.
05:39
<loke[m]> * Yes. You can enable it with C-\ and choose APL-Z
<loke[m]> Det finns nog inte tillräckligt med svensktalade som använder APL :-)
<loke[m]> * Det finns nog inte tillräckligt med svensktalande som använder APL :-)
hello, loke. guess the irc bridge starts working again
05:58
Question about Dyalog ∪.
Is it guaranteed to return the result in its original order?
@EliasMårtenson Yes, in the order of them first appeared
06:45
@LdBeth No, the bridge is really broken.
<loke[m]> shapr: Patreon? Nej, i så fall skulle det ju bli som ett jobb, och jag har redan ett jobb :-)
07:00
 md5←{
     ⍝ index origin zero
     ⎕IO←0
     ⍝ decoding UTF-8 & padding
     M←(⊢,(0⍴⍨512|448-512|≢))1,⍨l←,⍉(8⍴2)⊤'UTF-8'⎕UCS ⍵
     ⍝ add length
     M,←,⍉(8⍴2)⊤⌽(8⍴256)⊤≢l
     ⍝ init registers
     A←16⊥6 7 4 5 2 3 0 1
     B←16⊥14 15 12 13 10 11 8 9
     C←16⊥9 8 11 10 13 12 15 14
     D←16⊥1 0 3 2 5 4 7 6
     ⍝ T table
     T←⌊(2*32)×|1○1+⍳64
     ⍝ index table
     K←16|i,(1+5×i),(5+3×i),7×i←⍳16
     ⍝ rot table
     S←,1 0 2⍉4 4 4⍴7 12 17 22 5 9 14 20 4 11 16 23 6 10 15 21
     ⍝ truncate ⍵ to 32 bit & rot left ⍺
phew, that is the longest apl code I've write
ngn
ngn
07:32
@LdBeth ∊(4 4∘⍴)¨ -> ∊4/ ?
ah, you already have ,1 0 2⍉4 4 4⍴, that looks better
ngn
ngn
07:52
"init registers" could be A B C D←16⊥⍉(⌽⍪⊖)⍪⌽2 4 2⍴⍳16
08:15
ah, that makes sense
 
3 hours later…
10:57
<FireFly> Det finns minst tre av oss :p (well, åtminstone om man inkluderar J/andra relaterade språk..)
language?
ngn
ngn
11:09
@Razetime swedish, most likely
11:34
<leah2> oh no, weird characters in my APL channel
12:30
lol leah2
@Razetime (they can't see that message :p)
hmm what happened
the bot's still broken of course
ah nice
ngn
ngn
@nathanrogers m_ done
 
1 hour later…
13:37
@dzaima Who made the bot?
<loke[m]> Lite jobbigt att vara både på IRC (via Matrix) och på stackexchangewebbsidan samtidigt :-)
@EliasMårtenson moonchild (both here and IRC; github)
(but the bot being broken isn't moonchild's fault, it's the python ChatExchange that's broken)
13:50
@dzaima I noticed that you can get a state-saving version of •BQN with •BQN"•Eval", which is an eyesore but I think does a good job of showing what's going on. It has all the capabilities of •Eval but starts with a blank scope so it can't access outer variables or anything like that. And it clearly creates a new instance each time it's run. You could do it with •Import too but that requires another file.
14:23
@Marshall right. So should I just push a new scope creating •BQN and current mutating •Eval?
<FreeTrav> @loke[m] - Endast om du förväntar dig att delta på båda samtidigt; Jag lämnar bara en klient på tomgång på IRC-sidan för att hålla koll på saker när jag inte är på min SE-övervakningsdator. Only if you expect to participate on both at the same time; I just leave a client idling on the IRC side to keep an eye on things when I'm not at my SE-monitoring computer.
<loke[m]> FreeTrav: Imagine how much better everything would be if everybody was using Matrix. :-)
<FreeTrav> Everyone's got their own preferences. What works best for you may not be appropriate for me, and vice-versa.
<FreeTrav> vi is not emacs is not notepad++ is not spf.
<dzaima[m]> I don't think preference is the main issue here - it's just that we've barely gotten APLers to get on SE, moving to another platform (which has trouble previewing a room without logging in mind you, and the most popular client (element) is a slow mess)
14:41
@dzaima Yes, I'd like to start using them.
@Marshall pushed
not that matrix people can see this but I also wouldn't want to move to matrix if I couldn't easily talk to people from SE
<FreeTrav> Well, for chat I'm more-or-less agnostic. For email and forums, I actually tend to like the older technologies, rather than the modern assume-you're-always-connected model. SMTP/POP for mail, NNTP for forums.
@rak1507 my bridge is supposed to solve that, when it's finished at least
yeah, maybe when that's available I'll give matrix a go
14:45
<FreeTrav> I still have a tendency to call forums "newsgroups"
Another thing I was thinking about is some shortcut codes for the left argument to evaluator functions. Things that would be useful are
- inherit current environment's information, for everything or an individual attribute
- behave as though called from a given relative filename (but no `•args`).
<FreeTrav> OK, I need to go play editor for a while. The magazine doesn't edit and publish itself...
@Marshall oh right, i completely forgot about the left arg ¯\_(ツ)_/¯
@dzaima (•BQN doesn't even allow for a left arg)
15:00
Incidentally, it looks like the echo between here and #apl on freenode is one-way - stuff from here isn't apparently getting there.
@JeffZeitlin right, that's what's happening - the bot is successfully sending messages from IRC to here, but fails to read from SE and thus doesn't evaluate things or send stuff to IRC
@Marshall how about a •state or something, so that you'd do •state•Eval"whatever"?
@dzaima That is obviously better than anything I was coming up with.
15:18
while at it, i'll reorder it to •path‿•name‿•args (apparently some things maybe already got path and name the wrong way around)
@dzaima Yeah. It could make sense to turn it into a namespace, but a three-item list isn't hard to keep track of and hopefully there won't be more to add.
@Marshall I'd rather have it be a dictionary maybe, when those come around
And there's not really a problem with allowing a list or namespace in the future.
@Marshall pushed •state, rearranging, and left arg for •BQN
hopefully didn't break anything along the way
(fun side-effect: reading •state in the REPL can serve as a reminder of the order of items)
@dzaima Just replaced every call in the BQN repository, so I can test it out.
It all still works.
15:32
yay
(heh, replacing {⍎𝕩} in my tester with •BQN broke the a←1⋄a←5 test as it's allowed in top-level scopes, which is otherwise reserved for REPLs)
Somewhat reasonable use case for •Using here.
15:47
I really need to learn BQN.
@Marshall I mean, I don't disagree with •Using being useful, but things like a←1 ⋄ {•Using{a⇐2} ⋄ a} don't work, unless •Using forces everything to use VAR_
@dzaima made •BQN"a←1⋄a←2" error
@EliasMårtenson there are nice tutorials and of course this chatroom; also this is useful
@dzaima Oh, it definitely does that, but at least it's a step down from •Eval in that it can't modify existing values. I probably would have just used dot syntax instead of •Eval if I weren't porting from J though.
@Marshall so one •Using and all variable accesses slow down? (never mind now all variable accesses following a completely different model)
@dzaima If •Using tries to add variables that are defined elsewhere in the scope, it should be an error, so only undefined variables need to use VAR instructions.
16:03
@Marshall so a←1 ⋄ {•Using{a⇐2}} is disallowed?
@dzaima Oh, I didn't see that case. I'm not sure.
cause either it has to be, or everything after •Using needs to use VAR_
(and if everything is, then a←2⋄{•←{a}⋄a←1} becomes problematic and gives 2. though that may be fixable, idk)
how come ⎕ is blocked on tryapl? is the character blocked in general or is there no way to safe eval the input
I don't think it would really bother me if it wasn't allowed. Regardless of how it behaves there should probably be a way to specify aliases and non-imported variables with the left argument.
@rak1507 you can't use stdin/stdout, but some specific quads are permitted iirc
16:11
And if it isn't allowed to shadow, then you can even statically make slots for every undefined variable that's used, provided only one parent scope has •Using. If multiple parents have it then I think you really have to do something dynamic.
dyalog extended's lack of support for ⍣¯1 is annoying, I can't even do something like ×⍨⍣¯1
@rak1507 ?
(I know that's root, but trying to use it with under)
@dzaima Wait, this isn't really true. Variable references that go past a scope containing •Using would have to use VAR_, but references to a variable defined in that scope or a child scope are fine. Which isn't so different from the case where •Using can't shadow, but is used in a parent scope.
@Marshall does bacon have true lexical scope and closures?
16:22
@nathanrogers haven't I said it does like 5 times to you?
@nathanrogers Yes. See functional programming. Examples about 2/3 of the way down.
Oh, that doesn't actually demonstrate closures. But it's intended to show the pure side of functional programming so that sort of makes sense.
@Marshall having such fancy variable handling for a feature for laziness which is purposefully slow just doesn't feel nice. We currently have: separate handling for the number of scopes with •Using; recording which variables have been made after •Using; requiring VAR_ for a conforming impl
@nathanrogers Closure example.
@dzaima Every system value is optional, so a conforming implementation doesn't have to have •Using. The spec basically reserves names: if you use the name •Using, then it must have the given definition.
I think of •Using as basically a form of •Eval, so a performance hit wouldn't surprise me as a programmer.
@Marshall unless the description page of it starts with "WARNING: HORRIBLE", everyone from any other language would assume it's very acceptable and the norm
@dzaima I can do that.
16:35
@Marshall then why add an explicitly horrible thing to the language?
@dzaima In some cases you really want it. Same as •Eval.
imo •Using with the currently proposed perforomance drawbacks is much worse than •Eval
•Eval just evaluates and doesn't break the whole language. •Using quietly changes the behavior of variables in general
@dzaima So I don't think this is actually a complicated implementation feature at all. Each scope records if it can define variables dynamically, that is, if it contains a •Eval or •Using token. Lexical lookups in this scope are modified a little: normally if a variable isn't found it would try the parent; for a dynamic scope it instead returns a code saying to use VAR_.
And in case it's not clear, now I think it makes more sense to allow •Using to shadow, just like •Eval.
16:55
I still don't think an implicit "lol variable reads will be slow now" in the language is good
•Eval at least explicitly doesn't guarantee variable propagation, whereas that's all that •Using does
17:26
@dzaima What is "variable propagation"? •Using can be implemented using •Eval and a function to get keys from a namespace, so it doesn't introduce any extra capabilities.
•Eval∘((∾∾⟜"←"¨)∾"@⋄{"∾(1↓·∾"‿"⊸∾¨)∾"↩𝕩}"˙)∘•Keys⊸{𝕎𝕩}
@Marshall the whole thing of quietly injecting VAR_
which •Eval doesn't do
@dzaima I don't get it. •Eval can create arbitrary variables in the scope that contains it, right? What's the difference?
Oh wait, a←4⋄{•Eval"a←3"⋄a} in dzaima/BQN returns 4. That's an incorrect implementation.
@Marshall Of course it does. Otherwise I'd already need to have the whole VAR_ fallback
I thought we agreed to •Eval (well, back then, and I don't recall any talk about changing the behavior for •Eval) only quietly changing variables
@dzaima But that's way worse! {•Eval"a←3"⋄a} has a different result depending on the lexical context.
@Marshall I mean, that is what you get for using eval in a statically lexically scoped language (if that even is a term)
the only reason I was at all okay with •Eval mutating the scope was because I assumed the idea was that it would only read the new variables from other •Evals
(and i had completely forgotten that an uninvoked {𝕤⋄unknownvariable} doesn't error in dzaima/BQN)
@dzaima (i guess in that case it'd be better to have •Eval create a new scope on appearance, such that {a‿b←1‿1 ⋄ E←•Eval ⋄ E"b←a+1" ⋄ b≍E"b"} would give 1‿2)
other than implementing •Using, it really doesn't make sense for variables created by •Eval to be read outside of another •Eval - you will always know what assign outside of •Eval if you're reading outside of it
17:50
@dzaima I don't think you can choose performance over soundness here. It's generally understood that •Eval can hurt performance, and I think a rule that looking up variables past an •Eval is slower because it has to check the variable hasn't been shadowed is easy to explain. Also, there's no difference for •Eval at the top level, which is where •Using would usually appear.
@dzaima This is just {•Eval}, and I think the extra flexibility is useful.
@Marshall well, it is, but it also means it can't do incredibly stupid things
Should a program completely consisiting of {𝕤⋄unknownvar} and nothing else error ever?
@dzaima Yes, if none of its parent scopes are dynamic.
@Marshall that's just stupid imo
just not giving a whole class of errors because a •Eval or •Using exists somewhere
@dzaima Well, you also can't give an error for F←{𝕤⋄var} ⋄ G f ⋄ var←@ until var is actually referenced.
@Marshall but var still exists there
@dzaima (though i guess that's more of an argument for not having dynamically scoped variables)
 
1 hour later…
19:08
<shapr> FreeTrav: there's an APL magazine?
<shapr> I'm wearing my co-dfns t-shirt today, it arrived a few days ago.
<leah2> :)
which one did you get?
<shapr> howdy leah2, do you also speak Swedish?
<leah2> no, just german
<shapr> Ah, for some reason I thought you were a member of the Recurse Center community.
<leah2> also not, but i know a bunch of people that are
<shapr> It's my favorite community, and I am a member of many communities.
<shapr> leah2: you could apply!
<leah2> yeah, maybe. let's wait for the pandemic to be over first...
<shapr> Right now Recurse Center is online only, so you wouldn't have to move to Brooklyn to attend.
<shapr> With the good and bad points of that.
<shapr> I wrote myself a research paper annotation tool while I was at RC: github.com/shapr/fermatslastmargin
<leah2> yeah i think currently i dont have time currently
<shapr> leah2: fair enough
<leah2> also being in brooklyn could be interesting actually
<shapr> I spent a solid three months, roughly fifteen hours of productive time every single day, and I produced something wonderful!
<shapr> and I'm the only user
<shapr> I spent less than three days on my wildly popular project: github.com/shapr/markovkeyboard
<leah2> i started using zotero last week
<shapr> I'm tempted to switch to org-roam
<leah2> i mainly wanted something better than 4k unread firefox tabs XD
<shapr> I know that feeling.
<shapr> I wanted some way to annotate research papers without distributing the papers themselves.
<shapr> so I use the DOI as a primary key
<shapr> Although I haven't added paging to search results, so I'm having trouble finding good APL resources I really want to read
<leah2> zotero stores the annotations out of band too now
<shapr> my goal was to use github as a social network, FLM lets you load up the annotations of any user you follow on github
<shapr> So you can see what others are writing on the papers they're reading.
<leah2> that's cool
<shapr> yeah, it was a fun thing to build
<shapr> and it got me a job writing Haskell, so that's nice too
<leah2> :)
<shapr> I wonder how long it'll take me to get a job writing APL? :-D
<leah2> someone was offering K jobs recently iirc

« first day (1508 days earlier)      last day (1443 days later) »