« first day (633 days earlier)      last day (2016 days later) » 

1:52 AM
Okay, woah, I'm really behind. LOL
@Cowsquack Single character screen-full updates can be done on text-based screens using, I think, the []SM functionality. However, I'm not sure the Dyalog folks are terribly excited about continuing to support that functionality. Using the Windows or HTMLRenderer stuff is more likely to garner their support. ;-)
@nathanrogers Regarding Each and Outer Product, I should clarify that Each is really the one I have problems with. Outer Product is less inherently troublesome than Each. However, using Outer Product with a complex, non-primitive operand over large arrays can be as troublesome as each.
Using Outer Product with primitives over large arrays is not likely to be as troublesome, but you have to be careful about the asymptotic complexity of your code at that point, and make sure that you aren't turning a linear algorithm into a quadratic one unnecessarily.
So doing something like 3 5∘.|⍳20 isn't an inherently bad thing at all, and it's not really a performance problem.
 
2:42 AM
@nathanrogers Hrm, while I don't think an outer product solution is bad here, if I want to be really cheeky I can. :-) Here's a solution that uses only two incidental nested arrays, but otherwise works entirely over simple, flat, non-nested arrays.
With the exception of a small bit of text rendering, it also uses almost entirely vectorized primitives.
There's zero "element at a time" working here, and this method could be trivially expressed on a large SIMD vector machine such as a GPU efficiently:
(((↑'FizzBuzz' 'Buzz' 'Fizz')⍪∘⍉8↑∘⍉⍕∘⍪)⌷⍨∘⊂3+⊢((⊣×0=⊢)+⊢×0≠⊢)(0⌊(¯2+0⌊⊢)@(0=5|⊢))+0⌊(¯1+0⌊⊢)@(0=3|⊢))
Oh, and it's also written as a single train. :-)
⎕←(((↑'FizzBuzz' 'Buzz' 'Fizz')⍪∘⍉8↑∘⍉⍕∘⍪)⌷⍨∘⊂3+⊢((⊣×0=⊢)+⊢×0≠⊢)(0⌊(¯2+0⌊⊢)@(0=5|⊢))+0⌊(¯1+0⌊⊢)@(0=3|⊢))
 
@arcfide
  FizzBuzz  ⍪∘⍉  8  ↑∘⍉  ⍕∘⍪     ⌷⍨ ∘⊂  3 + ⊢  ⊣× 0 =⊢  + ⊢× 0 ≠⊢     0 ⌊  ¯2 + 0 ⌊⊢  @ 0 = 5 |⊢    + 0 ⌊  ¯1 + 0 ⌊⊢  @ 0 = 3 |⊢
  Buzz
  Fizz
SYNTAX ERROR
 
Aaaah.
That's no fun.
⎕←3+⊢((⊣×0=⊢)+⊢×0≠⊢)(0⌊(¯2+0⌊⊢)@(0=5|⊢))+0⌊(¯1+0⌊⊢)@(0=3|⊢)
 
@arcfide
┌─┼─────────┐
3 + ┌───────┼───────────────────────────────┐
    ⊢ ┌─────┼───┐          ┌────────────────┼───┐
    ┌─┼───┐ + ┌─┼───┐    ┌─┼─┐              + ┌─┼─┐
    ⊣ × ┌─┼─┐ ⊢ × ┌─┼─┐  0 ⌊ @                0 ⌊ @
        0 = ⊢     0 ≠ ⊢ ┌────┴────┐          ┌────┴────┐
                     ┌──┼───┐   ┌─┼───┐   ┌──┼───┐   ┌─┼───┐
                     ¯2 + ┌─┼─┐ 0 = ┌─┼─┐ ¯1 + ┌─┼─┐ 0 = ┌─┼─┐
                          0 ⌊ ⊢     5 | ⊢      0 ⌊ ⊢     3 | ⊢
SYNTAX ERROR
 
Alright, well, at least that provides the basic logic.
I don't know why it doesn't like to do the whole thing.
⎕←(((↑'FizzBuzz' 'Buzz' 'Fizz')⍪∘⍉8↑∘⍉⍕∘⍪)⌷⍨∘⊂3+⊢((⊣×0=⊢)+⊢×0≠⊢)(0⌊(¯2+0⌊⊢)@(0=5|⊢))+0⌊(¯1+0⌊⊢)@(0=3|⊢))‌​⍳20⊣⎕IO←0
 
@arcfide
FizzBuzz
 1
 2
Fizz
 4
Buzz
Fizz
 7
 8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
 
2:53 AM
Needlessly complicated.
Here's a simpler version:
⎕←(((↑'FizzBuzz' 'Buzz' 'Fizz')⍪∘⍉8↑∘⍉⍕∘⍪)⌷⍨∘⊂3+⊢((⊣×0=⊢)+⊢×0≠⊢)(¯1×0=3|⊢)+¯2×0=5|⊢)⍳20⊣⎕IO←0
 
@arcfide
FizzBuzz
 1
 2
Fizz
 4
Buzz
Fizz
 7
 8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
 
That version also doesn't include any @'s.
That means that there are no sync barriers to keep a GPU from executing everything on the right of the enclose as a single, ultra-fast kernel in one go.
The critical path complexity of the above expression is almost entirely constant time.
That means that the above expression is so embarrassingly parallel that it will scale almost perfectly.
The way it's expressed right now it is limited to counting up to 99999999.
However, for any given size of machine integer for the above, if you have enough SIMD threads, and your memory can keep up, that computation would theoretically take constant time to compute.
On a modern GPU, you should see constant time performance up to about 2048 or 4096 elements, at which point you could expect the system to scale in accordance with the memory bandwidth/throughput of your GPU.
Incidentally, this method can be scaled to an arbitrary number of "FizzBuzz" elements up to about the first 48 primes in current implementations of APL.
 
3:41 AM
Here's a generalized fizzbuzz that works for a large number of factors (up to about 48), and only uses nested arrays and that sort of thing for the "high level" control, and does everything using vectorized primitives under the hood, with meaty operations the whole way though, avoiding "element at a time" computation, and working mostly over simple arrays.
genfizzbuzz ← {(⍺ str ⍵)⌷⍨⊂(¯1+2*⍺)+⍵{(⍺×0=⍵)+⍵×0≠⍵}⊃(-2*⍳⍺)+.(⊣×0=⍵|⍨⊢)⍺↑1↓primes 250}
     primes ← {(~X∊∘.×⍨X)/X←2+⍳⍵-2}
        str ← {⍉(((2*⍺)⌈≢⍵)↑⌽(' ',(2*⍺)↑⎕A)[(1+⍳2*⍺)×[0]⊖((2*⍺)⍴2)⊤1+⍳(2*⍺)-1]),(((2*⍺)⌈≢⍵)↑⍉⍕⍪⍵)}
And here's it working on a standard FizzBuzz of 2 factors on the first 20:
      2 genfizzbuzz ⍳20
AB
 1
 2
A
 4
 B
A
 7
 8
A
 B
11
A
13
14
AB
16
17
A
19
Whoops, I need to fix str:
        str ← {⍉((⍺⌈≢X)↑⌽(' ',⍺↑⎕A)[(1+⍳⍺)×[0]⊖(⍺⍴2)⊤1+⍳(2*⍺)-1]),((⍺⌈≢X)↑X←⍉⍕⍪⍵)}
And with that fix, you can get this:
      ⍉5 genfizzbuzz ⍳50
A  A  A  A  A  A11A1 A 2A  A 2A33A3 A33A 4A4 A44A
B12 4B  8 B    B67 9B  3 B   9B12 4B 78 B1 3 B67
C      C      C      C      C      C      C      C
D          D          D          D          D
E            E            E            E
And that gives you a 5 factor fizz buzz.
@nathanrogers The above generalized fizz buzz also doesn't use Outer Product or Each. ;-)
 
4:39 AM
Coly how
 
 
3 hours later…
ngn
7:52 AM
@J.Sallé using tsh/lynn's algo i got to 16 bytes: ~6∊2⊥∘⍒¨3,/0 0,⊢
 
 
8 hours later…
3:48 PM
the grapher works :D I spent way too long making that be all dynamic & O(nlogn)
 
4:06 PM
@dzaima looks nice! what platform is it?
 
@Cowsquack it's Processing, so whatever runs Java
 
oh processing
is it built on top of your apl implementation?
 
@Cowsquack yeah, and that's the cause of this
 
haha
does it support one to many functions, like a circle?
 
@Cowsquack well it currently just executes the function with ⍵ as the X coordinate, it doesn't do math :p
 
ngn
5:08 PM
@dzaima you should expose a plotting api, like ike, add keyboard hooks too, and then it will be possible to write games and your impl will become famous :P
 
 
1 hour later…
6:31 PM
@arcfide when exactly does an operation become efficient? how/why is 5+⍳5 more efficient than 5+¨⍳5 when they both really add 5 to each element of ⍳5?
 
@Cowsquack ¨ calls (think of it as a jump/goto to) + for each element, while just + alone can be, at the very worst, implemented as a single loop (though it should be using SIMD for even more performance)
 
@dzaima adding on to ngn, yeah an apl interface to processing would be really cool, nowadays when I get a graphical idea I want to implement in processing, I quickly get discouraged because I don't have apl's power, like the gravity thing I mentioned not long ago
 
@Cowsquack I'll think about it, but currently some of the modifications have made my APL jar not work for android :|
it's saying Cause: default or static interface method used without --min-sdk-version >= 24 but I neither use default/static interfaces nor have min SDK < 24 ಠ_ಠ
 
@dzaima looks up simd oh parallel processing
what are you using for porting processing to android?
 
@Cowsquack Processings android mode
though right now I've exported it to IntelliJ because it's a better IDE
 
6:39 PM
I feel vim > pde (and generally use vim for anything processing related), though I used intellij for using processing as a java library
I vaguely remember messing with the android mode, but don't really remember it working
 
@Cowsquack it has worked for me every time before this for me :|
(well now it's not really its fault, I don't know what's to blame now)
 
6:55 PM
@dzaima oh i didn't have min sdk set to 24 ಠ___ಠ ive successfully compiled it with IntelliJ now, I'd like to have pde work though
 
7:09 PM
my workflow for PDE is have the same project for PC & android and switch between the two by changing a //* to /* or vice versa (aka primitive macros :p)
 
7:21 PM
oh yep the error cause is the fancy streams :|
 
9:04 PM
argh, forgot that a part of the app is a font of APL385 & Deja Vu Sans Mono combined, and that copyright exists :|
 
ngn
9:15 PM
@dzaima apl385 is in the public domain. dejavu "incorporates the Bitstream Vera license, an extended MIT License which restricts naming of modified distributions and prohibits individual sale of the typefaces, although they may be embedded within a larger commercial software package" wikipedia
 
@ngn that far I got, but the APL385 font has Copyright 2013, Adrian Smith, Brook House, Gilling, YORK, UK in the copyright field, and DejaVu - Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved., and I have no idea where the licenses shall be included
 
ngn
@dzaima copyright notice ≠ licence
 
ngn
afaik copyright arises with the creation of the work and those "(c)"-s have been unnecessary for a long time, but people still add them by habit
 
@ngn I think some jurisdictions require a copyright claim for a right to take effect.
@ngn Ah, yes, it was like that in the US until '94.
 
9:26 PM
@ngn so what I have to do is include both of those short messages in the font file?
 
@dzaima No you are not obligated to include the APL385 one, as it is truly in the public domain now.
 
ngn
@dzaima I don't think you need to do anything special to use the fonts as they are. The only catch with DejaVu is that if you modify the font, you must rename it.
 
@ngn yeah I've renamed it, the thing is the base font of the merge was APL365 so nothing beyond glyphs of dejavu was present, which is why I'm wondering about what to do
 
ngn
@dzaima why bother merging them at all? can't you give java a list of fallback fonts, like with "font-family" in css?
 
@ngn I didn't find a way to do that in Processing :/
 
9:38 PM
@dzaima Can I have a copy? Dyalog's Windows IDE doesn't handle fallbacks very well either.
@dzaima So all normal text is APL385 and only "exotic" glyphs are DejaVu, right?
 
@Adám mhm
@Adám eh, you wouldn't want to, as the DejaVu chars are 2x bigger and I scale them down manually per-char :p
 
@dzaima What do you mean by manually? Not in the font?
 
@Adám yeah, there's a boolean option in the charmap JSON to scale the display text down. I'm not a font expert, I barely merged the fonts together at all :p
 
@dzaima Oh ⍨ I feel your pain. I don't know anything either. Tried merging Noto Symbols into Noto Sans Mono so it would cover APL — turned out horrible.
 
the reason I got dejavu was for the and chars because I had to be fancy :|
 
9:44 PM
@dzaima Enter BS?
 
@Adám yep
 
@dzaima What do you use them for?
 
@dzaima ah, cool.
 
I could've gotten svgs for them, but that would've taken another argument type in the JSON, which it ended up needing anyway :/
 
 
1 hour later…
10:50 PM
how would one make a non-wpf/windows form graphics window/application?
 
@nathanrogers Use the HTMLRenderer
 
with canvas or what?
 
@nathanrogers Any HTML/CSS/JS you're comfortable with.
 
i'm not trying to make forms or pages is what I'm saying. I don't want a UI, I want a graphical application
is there opengl, or would I have to bootstrap all that
 
@nathanrogers Ah, well on Windows, you can draw using ⎕WC-style programming too, or yes, you could draw on an HTML canvas.
@nathanrogers You may want to look into how the Stormwind simulator works. Maybe I can prod @Stormwind to pop in again.
@SJT Welcome! Glad to see you here.
 
11:07 PM
@Adám are there links to stormwind engine?
 
@nathanrogers Only presentations (search youtube for stormwind simulator) about it — it is proprietary.
 
i'm watching one now
but I'm not hearing anything about the tech
just about the produc
like, is the graphical portion accomplished with APL? or just the map data processing
 
@nathanrogers Right, I understand what you're asking. Even if I can't get a hold of Tomas by mail (I'll try, though), it is very likely that I'll see him next week. I'll ask him to pop in here so you can ask yourself.
@nathanrogers You may be able to glean something from his SE presence:
 
11:22 PM
I suppose they mention that the 3d engine is in apl
 
@nathanrogers Really? Doesn't it say it uses a 150 USD mtv3d65.dll "3D engine"?
 
43:32
 
@nathanrogers The applause?
 
43:25?
 
@nathanrogers Sounds to me like APL only tells the 3D engine what to render on a high level.
 

« first day (633 days earlier)      last day (2016 days later) »