feels like i should be missing some huge part, but it passes test/tj.js and seems to work on the things i tested; it uses my previous vm, so all that's changed is the environment system (it's now like dzaima/APLs - variable array with parent field) and that the compilation is done beforehand (and includes dynamically generated code for managing arguments)
@dzaima If you haven't already figured this out, you can uncomment the commented section in tj.js, and comment the part before its starting with const, to run the reference tests.
Not sure I understand either part of your explanation. So the environment is now more like a linked list than a flat array?
@dzaima I'd assumed that wouldn't work because all the built-ins are defined at the top level in r.bqn and most execution is inside a block, but it looks like the depth of variable references in the compiled runtime is generally pretty low. No idea why.
@Marshall maybe something with the fact i'm using eval? i did wonder about that, but (proobably due to poor ctrl+s-ing) didn't see that happening 100% of the time
Today I had a nightmare about APL. I dreamed that I had misread one of the problems in the competition and that that mistake made me score a flat 0 in that problem, placing me poorly in the overall ranks :'( or otherwise lower than what I could've achieved if I knew how to read :P
@RGS Nope, you don't have any 0s at all. You lowest score for any one problem is 4/5, and your lowest score for any particular aspect of a task is 3/5. (These are my judgements, other judges may have other values.)
@RGS I have 4s for you on the two hard problems, because I gave you 3/5 on clarity for those two. The only other 3/5 I gave you was for clarity of problem 2.
@RGS Uh, you're not in 4th place, or any other place, yet, since we've not decided on a result. Only two of the four judges have finished judging, and then we convene and decide on winners guided by our collective scores, not determined by them.
@RGS Meh, scrap what I just said about your scores. I was looking in the wrong place!
@RGS I have 4/5 for you on 1 and 8, with a 3/5 for correctness of 1 and clarity of 8.
Also, these scores are preliminary. I may adjust them if persuaded by other judges.
If I understand correctly, someone who is to install RIDE on their computer would also need to start by installing Dyalog APL from https://www.dyalog.com/download-zone.htm, right? the RIDE is just an interface?
I've stated this (like a broken record!) -- it's confusing. Please make Mac Dyalog be like its non-Mac cousins :). I'm now running standalone RIDE and (sort of) command-line dyalog via convoluted workarounds on a Mac.
@xpqz I think we eventually want to get rid of the TTY interface, but I agree that separating the front-end (RIDE) from the back-end (the interpreter) is a good thing. Still, we have to make it easy to start both together, and connected, with one click/command.
(Secretly, I just wish we could port the Windows IDE to UX.)
If the "TTY interface" is a "read from stdin/write to stdout" interface, I think it should be kept - I'm visualizing being able to insert APL into a PowerShell script, for example: $vector = Evaluate-APL -APLExpression "3+⍳10"; ForEach ($number in $vector) { ...} where Evaluate-APL could be a function that simply feeds the expression to Dyalog via stdin; writing to stdout in PowerShell automatically makes the string the "return value" of the function/cmdlet.
(The stdin/stdout interface should even be an option for Windows, if for no other reason than to support this sort of usage.)
@JeffZeitlin That's exactly the problem, the TTY interface isn't a language engine, it is a full window manager using pseudo graphic line drawing characters!
@JeffZeitlin I keep being disappointed that the APL*PLUS character-based interface (running under DOS) from 1992 was so much better than Dyalog's graphical IDE in 2020.
@Adám - I seem to remember that our old 911 system here in NYC ran on AIX, and seemed to have a "real GUI", but I don't know whether that was implemented entirely in the program or whether X had been implemented.
@JeffZeitlin Just a couple of things off-hand: tracing primitive-by-primitive including inspecting the arguments of the current primitive, editor allowed seamless switching of type (character vector, vector of vectors, matrix, function, native file) and renaming the current item and editing (simple) numeric arrays (up to rank 2), you could record macros for the F-keys, keep things in the editor while switching workspace, run OS commands from the IDE,…
Oh, and it had menu items to create or edit new functions or arrays.
@RGS Ah, then it sounds like the interpreter is being directed at a different file by a configuration parameter. Try, from RIDE, to execute ]config Log_File
@Adám it is indeed mildly confusing. would also be nice if it also converted the reply @ to the proper one for it (and i now had the idea of making an SE chat extension making the IRC users look more like proper users, plus maybe better formatting for TIO, and while at it, replying to self)
@dzaima It's up. 6.5s self-compile! I changed it from using eval() to Function() to avoid having to worry about whether all the outside variables are mutable or not.
@JeffZeitlin This is what I'm playing with building; do you have any opinion about what exactly "Evaluate-APLExpression "3+i10" should output or how? A single [System.Int16[]] or individual Ints which gather up into a [System.Object[]]? Would you mind having to do "⊂3+⍳10" or "⊂⊂3+⍳10" all the time to keep the structure from unrolling?
@TessellatingHeckler - That's a tough question. Ideally, it would return whatever the context requires - the specific example would be [system.int16[]] or [system.int32[]]. But there might well be contexts where you would want to return a [system.object] or [system.object[]], and I don't see how Evaluate-APL can know that.
As far as disclosing or double-disclosing, the ideal is to not need it except if I would need it in an interactive APL session.
@JeffZeitlin Ideally "Do what I mean" is a tough one. As far as data type, Dyalog chooses to make 0 and 1 into System.Bool, small numbers into System.SByte or System.Int16, and I don't have much choice of that.
The choice I have is if you want to pipeline it and do Eval-Apl "3+i10" | foreach-object {"-$_-"} and have each number come out, the APL side has to unroll it once instead of sending out a vector. That seems bad for numeric vectors. If you want to gci | eval-apl "⌽" | select -first 3 and be able to passthrough (I kinda do) then unrolling the output seems good and sending out a vector.
My test tries to do "if it's .Net references unroll it, if it isn't then sometimes unroll" but it's unpredictable
I found out why obj.Prop1 doesn't work on the APL side of the bridge. C# expects that name to exist in a way it can verify at compile time. PowerShell is very late-bound, dynamic lookup, and flexible in the way it can add new properties. That means it secretly wraps everything in PSObject and pretends it's the class underneath.
The PowerShell dot lookup really looks through a hashtable of extra properties and then falls back to .BaseObject.Prop1 behind the scenes
PS C:\> ⍎ "{⍵.BaseObject.Name}¨" (gci) can work, and PS C:\> ⍎ "{⍵.Properties[⊂'Length'].Value}¨" (gci -File) can work Both are clunky and only seem to work on homogenous arrays, if there's a directory in there with no length it gives a value error.
so maybe I could add a function to do a more dynamic lookup
@Adám Is it syntax because it has to be able to lookup ⍵.Thing where Thing is an unbound name, not a string?
@TessellatingHeckler That's just one use case. You can even do (obj1 obj2 obj3).Fn Y instead of (obj1.Fn Y)(obj1.Fn Y)(obj2.Fn Y)(obj3.Fn Y)
@TessellatingHeckler E.g.:
System.Environment.(∊⍕¨OSVersion' '(32×1+Is64BitOperatingSystem)'-bit with 'ProcessorCount' cores')
Microsoft Windows NT 10.0.18363.0 64-bit with 8 cores
@Adám while I don't know exactly what was happening, I think I know why everything was weird. The default RIDE option is to "Connect", and I pressed it
it worked, but now I think it only worked because I also had Jupyter notebooks going on
closing everything and ending all tasks, and then trying to "Connect" on RIDE no longer works
@TessellatingHeckler what type of trouble do you run into? the only issue I ever had with adam's keyboard was it stopping to work out of the blue, only for me to realize I had unintentionally switched keyboards.
@RGS it's currently my selected keyboard, and pressing AltGr+r gives me r instead of rho, and Alt+shift+r gives me r instead of rho
I do find that some programs seem to swap keyboard on me unexpectedly, so I've got used to win+space cycling through if APL chars aren't working, but this seems different
@RGS It hasn't been reliable/repeatable, it's just happening now and I don't wanna reboot to get it back. The only things I've opened recently other than FireFox tabs are KeePass and Python IDLE but closing those hasn't changed it.
@dzaima I believe that, that doesn't feel like it's happening now
I always fall into the trap of thinking "reduce puts the function between every element of the array" to mean =/'AAAA' becomes 'A'='A'='A'='A' and evals to 1. Instead it becomes ('A'=('A'=('A'='A'))) and evals to ('A'=('A'=1)) and evals to false. A common and misleading way to describe reduce as if it's ∧/2=/
@dzaima annoyingly, 'A'=='A'=='A' seems to work in Python, but functools.reduce(operator.__eq__, 'AAA') in Python doesn't become that, so doesn't work in my wrong-intuition way either.
@rak1507 that is the way I tried first and it works out very slow, and I was hoping to try equals-reduce as an alternative to have less state, less dictionary inside, and see if it's faster :D
not sure how to do a 2-window reduce in Python. Probably needs Pandas, NumPy, TensorFlow, JuPyter, two environment versioning systems, and a web framework 😒
@TessellatingHeckler I have not experienced that. Since it is a "normal" Windows keyboard layout, I can't think of a way to reboot it without either re-installing it or rebooting Windows.
@TessellatingHeckler No, but some applications handle keyboard entry in non-standard ways, and that can interfere with my keyboard. E.g. the Zoom application has some keyboard shortcuts defined using Ctrl and Shift, but the code evidently neglects to check if Alt is also depressed, so it ends up treating AltGr (which is equivalent to Ctrl+Alt) as just Alt. So AltGr+i (⍳) is understood as Ctrl+i and turns on italics, while AltGr+Shift+X (⊇) is interpreted as Ctrl+Shift+X and turns on strike-through.
@Adám I am no expert in any particular subject but when it comes to maths/computer science I'm pretty sure I have the skill to learn something well enough to create a nice little workshop about that thing in question, as I have done several times before. I was thinking it could be interesting to marry APL to something else, possibly one of my active interests (scroll slightly down from there), and make a workshop out of it.
@Adám ah ok, but those happen once a year and I hear the next one, the one close to me, is going to happen in more than 1 year from now; while I can definitely present there, I was trying to come up with something that would happen in a nearer future
I just really like talking about maths and programming, you know? I have never refused an invitation to do so. And sometimes I actively look for opportunities to do that
@Adám the format of a webinar is not that interactive, is it? it is more of an (insert correct English word here; "exposition"?) where one person does all the talking/coding
@RGS The Dyalog ones aren't, true, but the BAA ones can be. And at the user meetings we have both presentations (one or a couple of people speak for 20-45 min) and workshops (two or more people interact with a group of 5-25 for half a day, sometimes split into two half-days).
@Adám I took this course with the videos playing at 2x the speed... but only because I knew most of the stuff
if I want to properly understand what the code jugalbandi is, I'm sure I have to watch it at 1x, 1.25x if I am feeling very smart and attentive. Especially because they are doing/using the code jugalbandi with a topic I am not very familiar with
so there's just too much I have to pay attention to... :/
But that is fine, I will watch it soon. Just not right now
@Adám recreational stuff or things you have to pay attention to? If the latter and you manage to pay attention, wash the dishes and not chop your fingers, hats off to you, I couldn't do it
(@Marshall just to let you know I really like your page about your GH repos, excellent idea to organize everything like that.)
APL does not confuse spirituality with thinking about programming while peeling potatoes, but it does help peel them all in one go. ( goodreads.com/quotes/… )
@TessellatingHeckler You mean the other languages? I don't think they can. Conor does mention that because the input is small, it doesn't matter. Btw, for the APL solution, it should be faster to do {+/,0>⍵} than his {+/0>,⍵}.
@TessellatingHeckler No. Ravelling an array is basically O(1) since the data is kept and only the shape header is changed. However, since ⍵ must keep its value , has to copy the array (while ravelling). 0>⍵ only has to write 1/8 as many bits as , and the subsequent , can then be done in-place.
@TessellatingHeckler Yes, Marshall's proposed thunks might avoid ravelling altogether, and instead compute 0>⍵ and then count the ones directly. Or maybe it'd even be clever enough to not even do 0> but rather remember that we're looking at strictly negatives, letting +/ inspect and count the negative sign bits in ⍵
It seems mad that there's still potentially large speedups in execution of short combinations of functions and operators, so many years after APL appeared.
@Adám the latter seems like quite the big jump. even with that only jumping in on big arguments, i'd think at that point it'd be much better for that level optimizations to happen at 400⌶-time