« first day (1166 days earlier)      last day (1489 days later) » 

12:00 AM
also, am I losing out much by using RIDE on OS X vs the windows software?
same interpreter i know but there seem to be some differences in the IDE
 
OK, weird. Winkey wasn't working, then all of a sudden it is. Now... is there a way to change from Winkey to ... oh, AltGr would be good...?
Winkey-L puts up QUAD and also immediately locks the computer :)
 
12:17 AM
For basic usage, you're not missing much. The Windows IDE does have some nice integrations missing in RIDE, e.g.:
∘ Workspace Explorer is much more powerful, allowing editing and moving items around
∘ There is a versatile search functionality
∘ Menu items to save/load session
∘ Menu items to save/load/clear log
∘ Much more customisable (undock or move language bar and other elements, font, )
∘ Copy and paste data with structure (e.g. spreadsheet ←→ matrix)
∘ GUI for many additional settings
On the other hand, RIDE has some modern features, e.g.:
@JeffZeitlin Well known clash with Linux in VM under Windows. I highly recommend using AltGr (on Windows too), especially for English layouts. I simply use my AltGr layout on Windows and it somehow propagates into my Ubuntu VM. I think that forum thread addresses switching to AltGr directly in Linux, but if it doesn't, let me know and I'll find out from someone.
 
Ah! Got it! It took some groping around since I don't seem to be using exactly any of the interfaces discussed in that thread, but I tried what seemed to be the equivalent of one of the suggestions/instructions, and it worked.
 
Nice. Maybe you could document how to do it under Mint in a reply on that thread?
 
On Windows, I use the default of Ctrl for the APL characters, with the input method set to the Dyalog US keyboard layout.
As far as documenting it, I couldn't tell you what interface I'm using - it's a windows-y interface, but it's not KDE, and it's not ttbomk Gnome.
 
And it doesn't bother you that you can't use Ctrl+S to Save, Ctrl+F to Find, Ctrl+A to select All, etc. etc.?
 
Nope. It actually never occurred to me that I might want those. But then, remember that I'm the guy that uses the del editor for tradfns. :)
 
12:31 AM
Oh, right ⍨
 
While I'm thinking of it... To the best of your knowledge, are there any browsers that inherently block Javascript from writing data to the computer? I'm thinking of the possibility of hacking on that 5110 emulator so that you can save (and load) the disk images [so that you can write your own programs in BASIC or APL and save them and keep them; right now, the disk images are only in the browser's memory].
 
Certainly not any mainstream browser. These days, you only have to worry about Chromium, Firefox, and Safari.
 
Well... And EdgeHTML, for a while longer. Chromium Edge hasn't been fully deployed yet.
But EdgeHTML doesn't lock down, either.
 
 
3 hours later…
4:01 AM
Hmm... is there a reason why when I call ]LINK.create # /my/dir, I wind up with Linked: # → ...... the arrow going one way?
 
 
2 hours later…
5:47 AM
@Evan Yes, we don't have file system watching other than on Windows due to it using the .NET Framework. Basic support for .NET Core is coming in the next version.
 
 
13 hours later…
RGS
6:52 PM
There's something that is bothering me. I have a regular vector (in my particular case, ⎕D)
and I want to box every scalar in the vector.
I was able to come up with a couple of solutions, like
(⍳∘≢⊆⊢) ⎕D
((1/⍨≢)⊂⊢) ⎕D
I came up with ((1/⍨≢)⊂⊢) ⎕D first and I thought it was too long, so I thought a bit more and came up with (⍳∘≢⊆⊢) ⎕D
But this still looks really long...
(on a completely unrelated note, sometimes my Dyalog interpreter tooltips stop showing; i.e. I hover a glyph and it doesn't show the little help section I usually get. Does anyone know why this happens/how to prevent it/how to fix it after it happened?)
Also, my WS is full? how is that even possible :P
Nevermind, I just realised my lack of parentheses meant I was trying to create a matrix of rank 10 or something like that.
 
7:24 PM
@RGS You can't enclose simple scalars, but the methods you've come up with anyway simply transform each scalar to a vector. You can do that with too.
 
RGS
@Adám Alright, this is, in fact, much shorter and cleaner! Thanks
I mean the
 
8:05 PM
@ngn @Adám do you know if there is a way to convert NGN Apl results to javascript data and back?
 
ngn
@Nathan you mean like dyalog's ⎕json?
there isn't but it shouldn't be too hard to write in apl
 
8:20 PM
@ngn how are apl arrays represented internally?
 
ngn
@Adám generally as js objects with a .s property for the shape and .a for the content, but there are gotchas - scalars are sometimes represented as ordinary numbers and those should be treated equivalently to {s:[],a:[thescalar]}
 
What I mean is I don't understand how to use ngn apl results with existing javascript libraries without the means of collecting the result as javascript data.
I could write a wrapper for unpacking the data, but I was just curious if that already existed
 
ngn
@Nathan you could use those .s and .a properties of the result, if you really want, but i wouldn't recommend using ngn/apl for anything other than learning from my mistakes
 
What mistakes are you referring to? I just think it would be useful if the returned object had a .toJS() method which would output the results in a useful format. That'd allow for some nice interop, and I could use ngn as part of a typical JS app
so apl('2 2⍴⍳4').toJS() would result in [[1,2],[3,4]] or something to that effect.
I'm just trying to see what ngn can do. I thought you could do things like var f = apl('{⍵+⍺}'); f(3,4) or something to that effect? I also thought that definitions in one call to apl('...') would be visible in the next call to apl('...'). Is that not the case?
 
ngn
@Nathan how would you distinguish between 2 2⍴⍳4 and (1 2)(3 4)?
@Nathan it's not as advanced as you think
 
8:34 PM
For exporting to JS, I wouldn't. There's no such difference in javascript arrays.
[[1,2],[3,4]] is a 2x2 matrix so far as mainstream language notation is concerned
I could↓ the results, and get the .s from each of the resulting arrays. That seems simple enough
 
ngn
what if apl('2 2⍴⍳4') returns { isA: 1, a: Float64Array [ 0, 1, 2, 3 ], s: [ 2, 2 ] }?
 
then the hypothetical .toJS function would return [[0,1],[2,3]]
 
And 0 2⍴0 would give []?
 
I imagine it would result in [[]]
 
@Nathan That looks a lot more like 1 0⍴0
What would 'a'1 give?
 
8:39 PM
Yes, I see that. You're right, it would return []
'a'1 I expect would give ['a',1]
 
Just like (,'a')1?
 
[['a'],1]? Or not
 
What would 'abc' give?
 
'abc'
 
'a' 'b' 'c'?
 
8:41 PM
grr. Ok, then ⊂'abc' would give 'abc', but 'abc' would give 'abc'.split('')
 
@Nathan What would ⊂1 2 3 give?
 
[1,2,3]
 
And 'a' 'b' 'c' 1 2 3?
 
['a','b','c',1,2,3]
 
How about ⊂'a' 'b' 'c' 1 2 3 ?
 
8:42 PM
That's the same thing
 
Uh, nope. 'a' 'b' 'c' 1 2 3 ≢ ⊂'a' 'b' 'c' 1 2 3
 
I suppose it would mean [['a','b',..., 3]]
 
What would ,⊂'a' 'b' 'c' 1 2 3 give?
 
[['a','b',..., 3]]?
 
So ⊂'a' 'b' 'c' 1 2 3 and ,⊂'a' 'b' 'c' 1 2 3 would give the same?
 
8:45 PM
I would imagine
 
Would you also say that ,⊂1 2 should give the same as ⊂1 2?
 
[[1,2]]
 
Fair, then ,⊂'abc' and ⊂'abc' should be the same too, I imagine?
 
if a←1 2 ≡ [1,2], then ⊂a would mean [[1,2]].
I see
 
Good for you. Seeing is believing.
 
8:48 PM
Why not just handle the type separately? When returning any sort of 'string' it should be returned from JS as a string
 
Define "string" (on the APL side).
 
so then a 2 2⍴⎕A ≡ ['ab','cd']
I wouldn't
I would describe it on the .toJS side
 
How about 2 2⍴0,⎕A?
 
[[0,'A'],'BC']
 
Seems a bit inconsistent, no?
 
8:49 PM
That's annoying. Stop being socrates
:P
 
Stop proposing things you haven't thought through.
 
@Adám - Wouldn't the canonical response to that be along the lines of "There's no such thing, just vectors where all the members happen to be characters"?
 
It isn't a matter of thinking it through or not, it's a matter of I would like to use APL for javascript interoperatbility, and I can't, so I was asking if it was possible. And if it isn't, it would be nice if it were
Rumination doesn't need to be rigorously proven
 
@JeffZeitlin Sure, but that doesn't help us in converting to JSON.
@Nathan It'd be nice to have a way to call something that'd work like JSONserver, but I wouldn't venture into auto-mangling arrays. You'd call result=APL("{⌽⍵}",myJsArray) or result=APL(jsArray1,"{⍺⌽⍵}",jsArray2).
Even better if we could also pass JSON objects.
@ngn How hard do you think it'd be to implement ^ based on ngn/apl?
E.g. sometimes I want to .map() over two JS lists, so I'd want to be able to do APL(list1,"{code here}¨",list2)
 
ngn
@Nathan @Adám such interop would have been a nice thing to have, but i'm no longer interested in developing ngn/apl. i put all my efforts in k now.
 
8:57 PM
@ngn And K'd be much better for this, it having a much closer array model.
 
ngn
@Adám there are issues there too
char atom vs char list for example
 
Sure, like ("a",1)
 
ngn
.. vs symbols
 
I seem to recall a K demo using canvas in the browser. Does anyone know where I can find that offhand?
 
ngn
9:02 PM
@Nathan also k7 and ktye/w
 
@Adám converting to APL would be much more problematic, whereas i can see an APL to JS being mostly usable even with 'a' 'b' 'c' returning a string
 
@dzaima tbf, ⎕JSON does an OK job.
 
a .toJS in JS could even do fancy stuff like add array methods (map, filter, etc) to outputted strings, hiding the difference while keeping stringiness
 
 
3 hours later…
 
@Adám r←(2↑a),b - i (in my personal opinion) would leave that as-is (maybe sprinkle a couple spaces if it's not too unimportant), but would be okay with r ← b,⍨ 2↑a - spaces help my brain parse a lot. nested parenthesis, though, warrant a lot more to remove
 
@dzaima I find it interesting that you read b,⍨ as a unit. I read ,⍨ as "appended to", so I'd space it r ← b ,⍨ 2↑a
 
@Adám I personally tend to use parens over s because it is the natural direction for most of the primitives (one exception being ÷).
 
@Adám it becomes more useful in succession, and especially in trains - (¯1↓ 1, A× ⊢) (maybe even things like (1↓ ∘, 10× ⊢) would make sense to do?)
 
@dzaima Yeah, I do that in my explanations of code golf.
 
11:58 PM
And I think you omitted one acceptable (and actually recommended) use case of parens: (a b c)←array
 
@Bubbler Oh, see that's the type of feedback I wanted.
 

« first day (1166 days earlier)      last day (1489 days later) »