« first day (1388 days earlier)      last day (1275 days later) » 

7:51 AM
Heyo
I made this interpreter: Try it online!
Am I doing it correctly?
 
 
2 hours later…
9:34 AM
@Adám on your array notation talk from the other day, is there a way to enter a character array (multi-line string) -- like a Perl/shell <<HERE doc, or a triple-quote in Python? Or would you need to do ['....'⋄'....'⋄ ...etc]?
 
You man a string with newlines?
 
@xpqz No, not natively, though there are hacks to allow a comment block to behave like that, with the caveat that every line needs a leading .
@Razetime No, ('abc'⋄'def') would be a vector of character vectors, while ['abc'⋄'def'] would be a character matrix.
 
oh ok
 
@xpqz That said, I have an email in my inbox that suggests:
  :Text html
   <html>
   <head><title>...
 :EndText
or more generally, something like
 :Array html Nested Char
   <html>
   <head><title>...
 :EndArray
 
↑ wrote an answer up there, is it properly golfed?
 
9:41 AM
@Razetime Can you replace 1↑ with ?
 
yep
 
@Adám That would be really nice -- if verboseish, compared with the rest of the array notation you demonstrated.
 
@xpqz Also, it'd not allow anonymous docs, neither would it work in dfns etc.
And there are whitespace issues to think about.
 
" doesn't have any special meaning right?
 
@Razetime The trailing 1 on the last line isn't actually used, so you can replace it with i←⎕
 
9:44 AM
Yes, all such implementations have those to contend with.
 
@rak1507 Not in Dyalog APL, so """-style would work.
 
I'd also like if \n or something similar worked, maybe it could remain the same with ' for backwards compatibility but introduce new functionality with "?
 
Also, if we added " as an alternate quote, and allowed line breaks between quotes, it'd work too.
Question is also what the result should be. A vector of charvecs, or a simple vector (or a matrix ― probably not).
 
So i replaced 1 with i←0 Try it online!
and there's a huge vector in the output now
is there a way to suppress that?
 
@Adám yes please :)
 
9:47 AM
 
think I can remove p by taking inputs in reverse
yep it works
 
m←"""This is a
char matr"""
 
@Razetime Any reason you use instead of for input?
 
no reason actually
 
puts garbage (⎕:) in stderr.
 
@xpqz I don't think that'd work well though because APL's convention is doubling quotes inside quotes to escape quotes.
 
Is there a better way to do these interpreter problems?
I just jumped at the chance of using ⍎
 
@Razetime You can use a tradfn and the index (optionally plus an offset).
 
not sure what that means
I don't know what → does
 
Equivalent to :GoTo
 
9:55 AM
oh that means goto
so →<labelname>
 
Or line number for golfing.
 
i see.
does program flow go back to normal once the line ends?
or do i need another→
 
It just continues with the next line.
So, it probably isn't a good fit for this one.
The real way to do it is of course with a :Select statement.
 
doesn't look that golfy tbh
 
No, I was just telling you how you'd do it in a production system.
 
10:05 AM
Like, an Actual interpreter
Maybe I'll make a golflang
looks like everyone who comes here ends up doing that
has anyone tried making a golflang in APL before?
 
Sure, I've made QuadS and QuadR and Stencil, though they are APL-themed.
 
I guess most golflangs do borrow at least some of the aspects of their parents.
9
Q: Interpret whatfuck

cardboard_boxSmallfuck is a brainfuck-like language with 1-bit cells. It has the following instructions: > Increment the pointer < Decrement the pointer * Flip the current bit [ If the current bit is not set, jump to the instruction after the matching ] ] If the current bit is set, jump to the instruction a...

I think would be very useful here.
 
@Razetime FYI
 
marinus has wona lot of these
wonder where they are
 
Where Marinus is?
 
10:20 AM
yep
 
He disappeared IRL.
 
oh.
 
10:56 AM
@Adám what would be the best way to talk to you in private
 
@rak1507 Zoom 758 323 8770. Want to talk to me now?
 
sure, although just by text if that's alright
 
@rak1507 One min, I'll make you a contact. OK, I've sent you an invite. I think you can begin chatting to me if you accept it.
 
Would it be sent by email?
bitbucket.org/marinuso/sscbanlist/commits/… look at this, mentions a reddit account that seems to be actively used
 
11:11 AM
@rak1507 Yeah. Didn't get it?
 
Nope, doesn't matter now
 
@Razetime Any news on this front?
 
I forgot about that
mind if port it now?
 
Would be very welcome.
 
how does one make something like J's dyadic `\` in APL? (preferably in a concise way)
 
11:25 AM
hmm wotsit.org doesnt exist
 
11:37 AM
@KamilaSzewczyk Prefix or Infix?
 
prefix, this one: "u\y has #y items resulting from applying u to each of the prefixes k{.y , for k from 1 to #y ."
 
@KamilaSzewczyk For simple vectors, f¨,/ usually works (though the first item is a scalar).
 
hm this program needs binary file I/O
 
@Razetime Yeah, that's ⎕NREAD.
 
yup
reading up on ⎕NTIE and ⎕NREAD
 
11:42 AM
@KamilaSzewczyk ⍳∘≢f⍤↑⍤0 99⊢ should do it, or ⍳∘≢f⍤↑¨⊂ if you don't want the final mix.
I should ⍳∘≢↑¨⊂ to APLcart.
 
doesn't seem to work
`⊢¨,/ ⍳5` returns boxed `1 2 3 4 5`, instead of expected:
1 0 0 0 0
1 2 0 0 0
1 2 3 0 0
1 2 3 4 0
1 2 3 4 5
 
RGS
11:57 AM
@KamilaSzewczyk ⍳5 gives 1 2 3 4 5 -- ,/ comma-reduces 1 2 3 4 5, that is, evaluates to ⊂1,2,3,4,5 which is just ⊂1 2 3 4 5 and ⊢¨ then does basically nothing
 
in J I get the expected result:
]\ (1+i.5)
1 0 0 0 0
1 2 0 0 0
1 2 3 0 0
1 2 3 4 0
1 2 3 4 5
 
RGS
I'm not saying it doesn't work in J, I'm just saying computers don't do what we expect them to do, they do what they are instructed to do :P
 
Wouldn't ↑,\⍳5 work
 
RGS
@rak1507 it does! well thought of!
⋄ ↑,\⍳5
 
@RGS
1 0 0 0 0
1 2 0 0 0
1 2 3 0 0
1 2 3 4 0
1 2 3 4 5
 
12:00 PM
@KamilaSzewczyk Markdown doesn't work in multi-line msgs. Use multiple messages instead, and they will be visually merged. Also, for a code block, use Ctrl+K (four leading spaces on each line).
 
good to know, I'll do that next time
thanks
 
⋄ ,\5 5 ⍴ ⍳5
How come that doesn't execute?
 
RGS
Mine had ` around it
 
⋄ ,\5 5 ⍴ ⍳5
 
@rak1507 Maybe an issue with \, I'd recommend always backticking code.
 
12:02 PM
Try it locally as well, it just hangs
 
↑ still doesn't seem to work
 
RGS
      ⎕IO←1
      ,\5 5 ⍴ ⍳5
┌─┬───┬─────┬───────┬─────────┐
│1│1 2│1 2 3│1 2 3 4│1 2 3 4 5│
├─┼───┼─────┼───────┼─────────┤
│1│1 2│1 2 3│1 2 3 4│1 2 3 4 5│
├─┼───┼─────┼───────┼─────────┤
│1│1 2│1 2 3│1 2 3 4│1 2 3 4 5│
├─┼───┼─────┼───────┼─────────┤
│1│1 2│1 2 3│1 2 3 4│1 2 3 4 5│
├─┼───┼─────┼───────┼─────────┤
│1│1 2│1 2 3│1 2 3 4│1 2 3 4 5│
└─┴───┴─────┴───────┴─────────┘
 
@Razetime You mean the above, or the primitive?
 
Weird, for me it hangs
 
the above lol
@rak1507 doesn't hang for me either
 
12:03 PM
@rak1507 "it"=bot or local APL?
 
local
I think I remember having this issue during the problem solving competition as well
 
That's odd. Seems like a pretty straight-forward expression.
 
Yeah
,\2 3⍴1 works fine but ,\2 4⍴1 hangs
And if I leave it, it starts not responding
 
Really odd. I'd complain to support@
 
I'll drop them an email
Is there any debugging I can do to make their lives easier beforehand?
Weird that ,\4 ⍴ 1 works fine but ,\1 4⍴1 doesn't
 
12:07 PM
@rak1507 Not really. It seems like a minimal example, but make sure to include your exact version number and platform.
Does it manifest itself after a clean start?
 
Nope, restarting/clearing/whatever makes no difference
 
How about changing data type? ,\1 4⍴.1
 
Same thing with that + strings
I clearly remember working on problem 10 and having this issue, I should maybe have emailed them then
 
@Adám, when I do the following with a PNG file:
b←⎕NREAD ¯1 83 4 0
      b
¯119 80 78 71
I get these values
but the vb script says 137, 80 and 78
 
Convert signed to unsigned ints: ⋄ 256|¯119 80 78 71
 
12:14 PM
@Adám 137 80 78 71
 
thats a thing
wow
 
Wait, wtf, {⍺,⍵}\1 4 ⍴ ⍳10 works
What is the difference between {⍺,⍵} and ,
 
@rak1507 {⍺,⍵}\ isn't optimised.
 
Huh, so there must be something with the optimisation that causes the problem
 
Yes, a real bug. Though it may have been fixed since.
 
12:22 PM
Is there a changelog of stuff so I can see if my version is outdated?
 
@rak1507 Hm, installation images have a changelog, but I'm not sure if it is also available separately.
 
What's the latest version out, mine is 18.0.38524
 
Latest publicly available Windows version is 18.0.38756 and UX is 18.0.39263, though we're planning to release a new one next week.
 
Is there an easy way to update?
 
@rak1507 my.dyalog.com/#Fixes180 if you still have access there.
 
12:30 PM
Doesn't look like it
 
Then you need to renew your license.
Although I think we'll auto-renew all 18.0 licenses next week.
 
Oh, just checked my email, I do have access, I just didn't remember that they sent me credentials
 
Ah those credentials don't work either
 
@rak1507 Right, for free licenses, they run out after a month I think. However, renewing is free too.
(gotta go pick up kids from school)
 
12:33 PM
Alright
 
So for jpegs
We need to find a byte sequence FF D8 FF
which should just be ⍸(255 216 255) ⍷ file_contents right
 
12:59 PM
huh, 1+num on average takes only ~7ns. Expected more between the pervasion mess & temporary object allocation.
@dzaima beats ngn/k fwiw
 
both in js?
 
@Razetime no? dzaima/BQN is java and ngn/k is c
 
@Razetime Yes.
@rak1507 Only if you have a Dyalog Support Service account (costs money).
 
How do I renew the licence
 
@Adám is there a way in RIDE (or the 'terp most like) to get a 'listing' of the expressions executed? Like the ones you see one by one hitting ctrl-shift-backspace... if the line I want to re-execute was many lines above, esp when mixed in with lengthy output, that's a lot of tapping on ctrl-shift-backspace.
 
1:15 PM
@rak1507 Go To your Nearest APL Dealer And Illegally Funnel Money To Them!
 
lol
 
@dzaima with •compstart←¯1 it's up to 21ns which still somehow manages to be on-par with ngn/k
 
@rak1507 Email sales@, but I think you can just go to the downloads and select "Already registered", which gives you the newest interpreter (and includes changelog).
 
Will do
 
@xpqz You can't get a listing of entered expressions, but you can get the entire log. Your entered expressions are likely to begin with six spaces, so you can filter the log by that.
 
1:22 PM
Should I uninstall my current version first?
 
@xpqz on linux there's a file at ~/.config/Ride-[insert-version]/hist.txt. Wouldn't know where it translates on other OSes
 
@rak1507 - You can have multiple version installed "side-by-side", at least on Windows, so you don't have to uninstall the previous version. If you do, however, do so before installing the new version, because I think the fonts are common, and uninstalling the terp uninstalls the fonts.
 
1:39 PM
@rak1507 Yeah.
@JeffZeitlin You can't have multiple builds of the same version.
 
@Adám ok, I can work with that -- where does the log live (on MacOS)? I have a ~/.dyalog dir but no hist.txt as far as I can see below there.
 
That bug is fixed in the new version, cool
 
@Adám - Yeah, OK - I may have missed something in reading the scroll; I'd gotten the impression that @rak1507 was talking about e.g., going from 17.x to 18.x
 
1:57 PM
Interesting. In GNU APL the following is false: (,⊂2 3⍴⍳6)≡(⊂⍤ 9 2) 1 2 3⍴⍳6
It's annoying. ⍤ is giving me by far more problem than any other function or operator.
And clearly GNU APL also finds it confusing, giving the inconsistent result.
 
@EliasMårtenson this feels utterly broken. I'd advise ignoring what GNU APL does with
@dzaima (that last case is understandable because prototypes suck, but (⊂⍤¯1) 1 2 3⍴⍳6?)
 
@dzaima Yeah, perhaps me using GNU APL as a reference in this case was a bad idea.
Is it safe from a intellectual property point of view to use Dyalog as a reference?
 
I don't want to be seen as plagiarising them.
 
If you start making loads of money off of it, then maybe you should be worried but otherwise idk why they would really care... could be wrong
 
2:05 PM
Hah, yeah. Well, then I'm safe :-)
Besides, the languages are quite incompatible anyway.
 
@EliasMårtenson I would assume it wouldn't be worse than reverse engineering/wanting compatibility, as long as you don't actually copy actual Dyalog code
@EliasMårtenson not being compatible could theoretically be bad for you - see Android vs Oracle about copying Javas APIs for Android
 
@dzaima The incomaptible API for Java was the basis of the Sun vs Microsoft lawsuit in the 90's.
The Oracle one is about them arguing that the API can be copyrighted. If Google's version hadn't been compatible, I don't think there would have been an issue.
 
@xpqz Try aplcart.info?q=transcript or simply ⎕SE⎕WG'Log'. Depending on your settings, even ⎕SE.Log might work.
@EliasMårtenson Yes.
 
@EliasMårtenson afaik (and i, of course, am not a lawyer) it's a case of much of the API being copied but not enough to be safe under being compatible or something
 
3:05 PM
@EliasMårtenson Yeah, I also found it to be various amounts of broken. Interestingly, is conceptually quite simple. I might even be able to find you an APL model for it, if you want it.
 
 
3 hours later…
5:44 PM
@Adám That would be incredibly useful. Thanks.
 
@EliasMårtenson From my presentation at the Dyalog '19 user meeting, (f⍤k)x ←→ ↑f¨⊂[(-k)↑⍳≢⍴x]x. Slides to download here.
For two ranks, you have to find which ranks correspond to which arguments, then use the ⊂[…] thing on each argument separately.
It also assumes a positive rank; to convert a negative rank to positive I think the formula is k←0⌊(≢⍴x)+k.
There's also the reference implementation in BQN, which has the same functionality as APL (it supports leading axis agreement, but only because Each does).
 

« first day (1388 days earlier)      last day (1275 days later) »