« first day (1391 days earlier)      last day (1253 days later) » 

6:50 AM
@dzaima Roger Hui says that if a potential speedup is less than a 50% time reduction, then it isn't worth it.
 
7:28 AM
@Adám I'm timing an entire program (Marshall's compiler on 2+2) so i really shouldn't get a 50% improvement there, and for all i knew, there could've actually been a 50% improvement on the actual pervasion of builtins (but testing all combinations of it is really annoying)
also i'm fairly certain that reducing this "20-100ns" by like 3ns would be a pretty big benefit to scalar code
 
 
5 hours later…
12:55 PM
@Adám That's for adding a new special case, not improving existing code.
 
1:34 PM
There may well be some reason that I don't understand, but why can't a function be syntax-checked on fixing? Like a mis-matched bracket etc.
 
@xpqz it could be - dzaima/APL does check for correctly matched parentheses/brackets, and Dyalog "stores" the error of an unknown character in the source until evaluation
huh, i thought it'd error on any input
 
1:59 PM
I know some say to use a deliberate syntax error as a way of doing a conditional breakpoint... which seems like a hackbodge to me. It's just a bit tiresome when a long running program fails on a syntax error :)
 
@xpqz It all depends on the design of the parser/compiler.
There are benefits to merging parsing and evaluation like most APL's do. KAP generates a full tree at parse time. Great for immediate error reporting, but has the drawback of not being able to dynamically redefine a symbol's role for example.
It also means that you have to parse function definitions in the correct order, as a function has to be known before use.
 
@EliasMårtenson but one could still match parentheses/brackets before runtime in that case, even if that was completely pointless to do
 
I'd settle for the sort of syntax highlighting an emacs mode or VS Code does to capture the simple stuff. fix already does something -- you can't save a dfun missing its closing }, say.
But the line between IDE and interpreter is much more blurry for Dyalog than A.N.Other language.
 
@xpqz try executing ⎕←'output' ⋄ f←{ in the REPL :)
@xpqz that's because the code is actually evaluated on fixing, so of course it'd error
 
Well then. If it is evaluated, it should be syntax-checkable to some degree at least?
 
2:15 PM
@xpqz it'd probably be non-trivial to make sure that {{ 1+⍵ }⍵}¨⍳1000 doesn't result in 1000 re-syntax-checkings of the inner dfn. And regardless, it'd be a thing that'd get caught later anyways and can be checked by an IDE trivially (which RIDE does)
 
> and can be checked by an IDE trivially (which RIDE does)
how?
 
@xpqz it colors things red on mismatched parentheses
(and, along with checking for invalid tokens (incl non-existing quads, which RIDE does) that is pretty much all one can check about an APL expressions validity at compile-time without writing a separate parser just for statically checking syntax, and even that couldn't possibly always work)
 
2:30 PM
I'd like to try it, but it crashed on me.
 
@xpqz RIDE?
 
yeah. Or the interpreter -- it's become unresponsive, can't even select text with the mouse.
 
@xpqz huh. I've had issues with it, but highlighting text with mouse always works
 
In this case, I'd really like to copy the text as I am fond of this particular set of (unsaved) code :)
 
@xpqz is the whole thing frozen? can you open the JS console with F12?
 
2:37 PM
Nope. I can access the menus, but that's it. Menu items seemigly no effect.
Strange.
Cant scroll.
It's like a screen shot, basically.
 
then i have no clue what could even have happened.
 
Looking top, dyalog hogs all my ram. That's possibly the problem.
 
@xpqz ah. On linux I always know if that's the case, because then the OS becomes unusable :P
 
Ah well, rude-killed it.
Maybe I should get a linux box with big ram.
 
@xpqz ⍸255=↑200⌶⎕NR fnname should give you the indices of issues.
 
2:49 PM
@Adám for syntax issues?
 
Yeah. E.g.:
      ⎕IO←0
      foo
    ∇ foo y
[1]   1+(3,4)) ⍝ comment
[2]   ]]
    ∇
      ⍸255=↑200⌶⎕NR 'foo'
┌───┬───┬───┐
│1 7│2 0│2 1│
└───┴───┴───┘
 
3:06 PM
Just thought I'd discovered a cool way of golfing an identity matrix, but forgot about the 5 byte ∘.=⍨⍳ :(
 
@rak1507 The 5-byter is quite inefficient, though. What is yours?
 
Haha, if you thought that was inefficient... ⌹⍨∘?⊢⍴⍨,⍨
Doesn't always work as well
 
??
 
Was playing around with solving systems of equations and noticed ⌹⍨ returns the identity matrix if it's invertible
Yeah, otherwise the matrix isn't invertible I think
 
Hm, but it will fail every once in a while.
 
3:13 PM
All part of the fun
 
RGS
3:28 PM
A good way of ensuring a matrix is invertible is by adding big numbers to the diagonal
But by the time you do that, you already spent a whole bunch of bytes
 
hello guys
 
RGS
@Adám is this more efficient? (2∘⍴⍴1↑⍨+∘1)
I don't understand why the five-byter is inefficient, it doesn't look like it's wasting anything
 
@RGS It is doing O(n²) comparisons.
 
RGS
Ah of course
 
thought it was about flatness
@Adám What about (1 1⍉(zero matrix))←1?
 
3:36 PM
@Razetime Slow.
 
:P
 
RGS
(~∘×2∘⍴⍴1∘+|(⍳*∘2)) wohooo
⋄ ⎕IO←0 ⋄ (~∘×2∘⍴⍴1∘+|(⍳*∘2)) 5
 
@RGS
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
 
gamer moment
 
3:53 PM
,⍨⍴1↑⍨1+⊢
 
4:04 PM
@rak1507 ,⍨⍴1,⍴∘0
 
4:25 PM
@dzaima I'd expect @rak1507's solution to be faster, but it probably doesn't matter for small args.
 
 
1 hour later…
5:43 PM
@Razetime this gives 'JPG' 26884 59391 904 instead of 'JPG' 2099 3148 904
 

« first day (1391 days earlier)      last day (1253 days later) »