« first day (1569 days earlier)      last day (1072 days later) » 

Wzl
12:00 AM
does it really omit combinators though?
 
It really does.
 
Other aspects of K that I don't like are that it puts too much functionality in one glyph because of the ASCII restriction and that it separates integers and floats. Given that doubles contain 53-bit ints as a subset I think the added complication of separate higher-precision ints is very much not worth it for just 11 bits.
 
One of my main gripes with K is that you can't (easily) create your own infix functions.
 
You could call K trains combinators, but that's the only kind, so it's fair to say it omits nearly all of them.
 
Wzl
can't you write them though? Then it's just a syntax difference
 
12:08 AM
No. No user-defined adverbs/operators.
 
You can write functions that take functions as arguments, but you have to use name[f,g,…]
 
Wzl
@Adám exactly: just a syntax difference
 
@Marshall How do you distinguish between user-defined functions and operators for K, where you must use square brackets to call a user-defined thing with multiple arguments?
 
Oh, true. I guess that does qualify as "just a syntax difference", although I view the syntax of tacit programming as very important.
 
Wzl
mumbles something about forth and postscript
 
12:11 AM
I have used Factor, and wrote a few stack-based array languages early on. I discovered that I do not like to use these.
 
Wzl
I mean the syntax, that is what I like about them
 
IMO it is hopeless to have to write over:{x[y[z];y[d]]};over[=,_,a,b] instead of over←{(⍵⍵ ⍺)⍺⍺(⍵⍵ ⍵)} ⋄ a=over⌊b
There, fixed it with a header:
And why not put the left arg on the left while we're at it:
over:{[x,f,g,y]f[g[x];g[y]]};over[a,=,_,b]
 
Wzl
... thinking of something APL is bad at :P
 
@Wzl Wouldn't it be Lisp? K uses Lisp's (never implemented) M-expressions.
 
Wzl
@Adám they were implemented but didn't catch on btw
I was mentioning postscript's very extensible syntax
 
12:27 AM
Oh.
 
Also you can't implement a combinator like Over as a function that takes two functions and returns one of them, because no closures. over:{f:x;g:y;{f[g[x];g[y]]}} doesn't save f and g long enough.
 
Wzl
however Adám's version works the same as that (because you can curry it)
 
The first one, you mean?
over:{[f,g,x,y]f[g[x];g[y]]}
 
Well I guess that's the way dops work in Dyalog too. In J and BQN you can do computation when you get the functions.
 
And I never understood how the system knows when to start computing.
 
12:32 AM
No difference for combinators though.
 
(Oops, I had ,s instead of ;s)
 
There are two sets of special names, 𝕨𝕩𝕤 for a function call and 𝕗𝕘𝕣 for a modifier call. The block runs once all sets that appear have values.
So the four possibilities are no special names (immediate block), function names only (function), modifier names only (immediate modifier), and both (deferred modifier).
 
Ah, thanks.
@dzaima Now decided: I don't like the modifier guessing.
 
Wzl
true there should be closures (in K) but I still don't like operators
 
I can confirm that this works in K:
 over:{[f;g;x;y]f[g[x];g[y]]}
 caselessEq:over[=;_]
 caselessEq["Abc";"aBd"]
110
So, equivalent to:
      over←{(⍵⍵ ⍺)⍺⍺(⍵⍵ ⍵)}
      caselessEq←=over⎕C
      'Abc'caselessEq'aBd'
1 1 0
I definitely prefer APL's syntax.
 
1:32 AM
can we compile APL code from command line?
 
@elliptic00 APL is an interpreted language.
 
then can we run APL code from command line?
 
Yes. How is your APL code stored?
 
I think you can run GNU APL from command line?
just put one a file?
put code in a file?
 
OK, but how does the file look?
Is the content of the file a function?
 
1:35 AM
sure..
 
Then try dyalog LOAD=filename
 
It means I can't run APL ouside RIDE?
 
Wait, which OS are you on?
 
macOS
 
From inside APL, can you run ]config DYALOG please?
 
1:40 AM
yep
 
What did it return?
 
/Applications/Dyalog-18.0.app/Contents/Resources/Dyalog
 
That'd be the directory where the executable is found.
 
Dyalog is the APL binary?
 
Yes.
 
1:42 AM
if I put APL code in a file, for example.
m <- 1 2 3
 
Another method is, from inside RIDE, go in the menu File>Connect… then select Type:Start and look at which interpreter RIDE is intending to start.
@elliptic00 Right, that's not a function, but you should be able to pipe that into dyalog -script
 
in a file, and Dyalog. myapl ?
myapl contain my APL code
 
No, try dyalog -script < myapl
 
oh..OK.. let me try it.. thanks..
 
Of course, not much will happen, as you're only assigning without causing any output.
 
1:45 AM
Yep.. how to use stdout like printf in C/C++?
 
⎕←stuff to print
 
nice..
 
For simple questions like that, remember that you can ask APLcart.
 
can I.. Nice.. I don't know that.. thanks your suggestion..
Dyalog APL could not initialise because the script file could not be opened.
dyalog -script < /tmp/apl.x
It seems there is some issue when I try to run my script
 
Sounds like a file permissions issue.
 
1:49 AM
  m ← 2 3 ⍴ ⍳ 10

  ⎕ ← m
this is my code inside apl.x
 
That's fine.
 
apl.x is under tmp.. should not be any permission issue?
 
I think you may need to give dyalog permission to access files outside your documents dir.
macOS has become very restrictive lately.
 
how I do that?
 
Can you try to just run dyalog and then from inside APL, do ⎕NGET'/tmp/apl.x'
Enter )off to close APL when done.
@elliptic00 System Preferences -> Security & Privacy -> Privacy -> Files and Folders and Full Disk Access.
 
1:59 AM
It ok, from do ⎕NGET'/tmp/apl.x'
I don't have this on my MacOS Files and Folders and Full Disk Access.
⎕NGET '/tmp/apl.x'
m ← 2 3 ⍴ ⍳ 10

⎕ ← m
UTF-8-NOBOM 10
 
Hm, ok, so APL can access the file.
 
It seems to me..
 
Then I'm not sure why it doesn't work. I suggest you contact support@dyalog.com
 
Ok..Thanks
 
Meanwhile, if you change instead use a file called apl.aplf and add a line at the top and at the bottom so it says:
apl x;m
m ← 2 3 ⍴ ⍳ 10

⎕ ← m
⎕OFF
Then try dyalog LOAD=/tmp/apl.aplf
 
2:10 AM
how to output using APL?
 
Put ⎕← on the left of what you want to print.
 
ok, I can useing LOAD=/tmp/apl.aplf
 
Great, so it prints the matrix?
 
it is just command line like RIDE..
yep. it print the matrix
 
@elliptic00 What do you mean? Does it not quit when done?
 
2:13 AM
no, when I'
 
so how to output Hello.?
 
@MatthewDaniels ⎕←'Hello.'
 
I can't figure out the way.
oh.
what about input?
:)
 
 
when I use dyalog LOAD=/tmp/apl.aplf, print out the matrix, and I'm still inside the command line, and I can run APL code in REPL, but it is like a shell
 
2:14 AM
@elliptic00 I see. Did you make sure to add ⎕OFF at the end of the file?
 
OH.. NO. maybe this is why I'm still inside the prompt..
ok, )off, I quit
 
Indeed. ⎕OFF turns APL off under program control.
 
I'm trying to write an APL program of Hello, <name>. and I'm trying to set up the input and adding the name in.
 
like exit in C/C++
 
my variable is n.
 
2:16 AM
n←⍞
⎕←'Hello, ',n,'.'
 
It works..now.. thanks..
 
thx. :D
 
@elliptic00 Sorry for all the trouble. All this should get much easier in 18.1.
 
yeah, APL looks very hard.
considering the characters can't be typed in with a basic keyboard.
 
The code language is in fact very easy. Unfortunately, some of the tooling is still awkward, but we're working on improving that.
@MatthewDaniels apl.wiki/typing_glyphs
 
2:40 AM
It seems I'm the only one have developed APL keyboard for Japanese keyboard (JIS) layout.
 
@LdBeth Ooh, is it available to the public?
 
It's developed using Ukelele (a keyboard editor for Mac), available as a Mac input method bundle.
 
@LdBeth Right. Maybe it could be added to apl.wiki/Typing_glyphs#By_platform?
 
Good idea, I just need to write down a readme so people can figure it out easily. It is not based on the current most popular layout but dyalog.com/uploads/conference/dyalog06/presentations/…
 
 
6 hours later…
8:21 AM
@Adám i mean, yeah, there's not much to like about them, but the alternatives aren't pretty either. (and i absolutely hate immediate function blocks)
actually, now that i think about it, I'd take forcing headers for everything other than non-immediate functions over needing the extremely stupid 𝕤⋄ or 𝕩⋄ or 𝕊: for functions that don't use 𝕨 and 𝕩
 
@dzaima Well, my suggestion was to use _{} and _{}_ but that wouldn't work for immediate blocks.
 
@Adám then you'd need to have spaces between them and names, leading to an ugly F _{…}_ G (and F _{…}_G would be 2 modifiers, leading to more confusion)
 
Maybe the left and right indicators should be two different chars.
 
8:56 AM
If the left symbol was _ and the right symbol was ¯ then F_{…}¯G is a 2-modifier and ``F_{…}_G` is 2 modifiers. Maybe the symbols are not ideal, but you get the idea.
@dzaima F◞{…}◟G vs F◞{…}◞G
 
@Razetime Ah yes, I was meaning to add an APL Wiki page for it. Do you want to do that?
@Razetime Wait, Glee is a LtR APL?
 
9:40 AM
@Adám idk i found it on hello world and honestly have no idea about it
1 + 2 3 4 	3 3 4
1 + (2 3 4) 	3 4 5
looks like it's ltr
 
And stranding is after function application. Clearer example:
__ ~(13 10#asc)=> A;
 
it has.. decimal indexing?
 
No, that's ⎕ASC i.e. ⎕UCS
 
looks like a fully ascii version
 
Yes, it is ASCII-only
 
9:45 AM
seems like square brackets can also work with filtering predicates
 
The above has __ be the end of a here-doc, and then ~(⎕UCS 13 10)
So A ← (⎕UCS 13 10)~⍨
LtR indeed.
 
"raw text"
this site keeps breaking
looks like it has lazy sequences
unimplemented sockets lib
ok, enough rabbit hole for now
 
10:05 AM
What's today's CMC?
 
implement J in Dyalog APL
 
Before lunch?
 
sure
 
CMC: Given the representation of a tradfn (your choice of vector, vector of vectors, or matrix) return a list of local names.
E.g.
 {r}←(F _Op)(a b);⎕AVU;abc
 ⍝ hello world
 ;more;names;here
 boo
should give F _Op a abc b here more names r ⎕AVU
Harder test case:
 {r}←(F _Op)(a b);⎕AVU;abc⍝;fool
 ⍝;hello;world
 ;more;names;here
 boo[;goo]
 
10:27 AM
I didn't know that the ;local;names;can;span
;several;lines
 
10:38 AM
This is the before mentioned APL layout for Japanese keyboard
hope someone would help put on aplwiki. I don't have account.
 
10:52 AM
I'll add it
@LdBeth added
 
thank you
 
 
1 hour later…
12:19 PM
meetup.com/ACCULondon/events/277980280 @RikedyP is there a way to attend this without making an account and uploading a profile picture?
 
12:34 PM
@rak1507 I'll ask - this was the only link I was given
 
 
1 hour later…
1:41 PM
@user3821550 Hi. If you want to participate here, email access@apl.chat
 
2:30 PM
@Adám No one else seems to be playing? Here's my tee-off:
{('{}(); ←'(~⍤∊⍨⊆⊢) 0⌷d),⊃↓';'(≠⊆⊢)⍤1⊢(';'=⍵[;0])⌿d←(~∨\'⍝'=⍵)/⍤1 1⊢⍵}
      ]repr ex2
4 31⍴'{r}←(F _Op)(a b);⎕AVU;abc⍝;fool⍝;hello;world
      cmc ex2
 r  F  _Op  a  b  ⎕AVU  abc  more  names  here
Sorry:
4 31⍴'{r}←(F _Op)(a b);⎕AVU;abc⍝;fool⍝;hello;world                  ;more;names;here               boo[;goo]
 
RGS
2:43 PM
Announcement: Dyalog webinar on “Drawing the Mandelbrot Set” in 17 minutes at dyalog.tv/Webinar/?v=ozaRMHeYWYM
 
typo: well-know
 
RGS
wooopsie
@rak1507 should be fixed by now
 
yep
 
Mandelbrot as a tradfn? This I must see.
 
sounds blasphemous, I can't wait
 
2:56 PM
A recentish code_report video includes an example which I think pretty well shows how an idiomatic APL approach to a problem compares to an alternative yet still functional approach
https://www.youtube.com/watch?v=QtvvQ7MdwKY

⊃(⊣,' ',⊢)/4↑' '(≠⊂⊢)sentence
Vs
{⍵⌿⍨4>+\' '=⍵}sentence

In my opinion, this example is simple and applicable enough to be interesting, but other nested array techniques (like the ones from the webinar on boolean scans and reductions) are a bit esoteric and probably less convincing. I think it's like striking a balance between what is good idiomatic APL for a given pr
 
@user3821550 Welcome. You should now have access.
 
@RikedyP classic example of under
not sure under could ever actually work here
it's basically 'take under splitintowords'
haha, martin replied the same thing!
 
 
2 hours later…
RGS
5:01 PM
@rak1507 how well did you take it?
 
the talk itself was great, so good job, as for the for loop I'd probably use something with ⍣ but it doesn't matter too much
I think the one thing that would be a good change would be outputting in PPM format to avoid a dependency on that PNG thing
 
RGS
@rak1507 I'm definitely open to suggestions on alternatives to the :For
@rak1507 Yes, Adám suggested pretty much the same thing, but I didn't have time to change to that.
 
Fair enough
 
 
4 hours later…
9:33 PM
I was reading back to the discussion last week about how Dyalog APL is broken and can't really be fixed without breaking backwards compatibility. How do you guys think dfns, tradfns, and modified assignments should work, and what else needs fixing (or would go into a clean-slate APL-like)?
 
preferably tradfns would be erased from the universe, potentially dfns should have an alternative return syntax then you could have multiple guards, and multiple things executed without having to add _← in front of stuff, modified assignment not sure
 
also dfns should always return the last statement
 
yeah
can't think of many ways to adapt things without turning it into haskell - array edition
 
modified assignment should at the very least allow parenthesizing the function (so a (+←) 1), or go BQN and be a separate character
 
I would absolutely be down for Haskell - Array Edition, for the record
 
9:37 PM
the problem with that is the type system can either be far too general to really be useful or be far too complicated to be useful
like, what's the type of an inner product?
+.× :: ?? -> ?? -> ??
 
I like the way Haskell's functions are defined. If APL could do that too, it'd be one step closer to math notation
@rak1507 I guess that's where dependent types or overloading come in?
 
APL's composition abilities are better than Haskell's
 
Wzl
@user I like pattern matching but not pattern matching in definitions
 
@user yep, which makes the signatures so long
oh yeah, pattern matching, that is a cool thing but maybe not that useful in APL
 
Wzl
(for moral reasons :P)
 
9:39 PM
@rak1507 idk, I sometimes find myself needing it
 
it would certainly be interesting if you could do haskell style function definitions with pattern matching and APL primitives
 
Wzl
I like inline pattern matching like case (I think it's called case in haskell)
 
I guess inner product could be f.g :: f⍨ a g b if you could somehow treat the functions as also function types
Oh wait, that doesn't work
 
rev ⍬ = ⍬
rev (x,xs) = (∇xs),x
 
Wzl
haskell doesn't have a type for operators so that would have to change (operators removed or at the very least first class functions, please)
 
9:42 PM
yeah, first class functions
that would be useful
then you could basically emulate control flow with higher order functions too
 
Wzl
@rak1507 you don't need recursion as often in APL though
 
so you could bin :For :While etc
@Wzl true, that was just an example of how a recursive definition of reverse might work in hask-PL
it's just
rev [] = []
rev (x:xs) = (rev xs) ++ [x]
but with APL primitives
 
I'm trying to think of what I'd want to import from Haskell into APL, and now I'm realizing that it's more that I want to import APL into Haskell
 
a bit of both I think
 
The compositions, sure, but also array-based programming but with lazy functions and so we get those infinite lists
I have not a clue how it would work when implemented, though
 
9:51 PM
large scale APL projects seem to be very OOP-ish so I think it'd be interesting if it was more functional
 
I might try writing up a specification at least when I learn more Haskell and more APL
 
would be an interesting experiment
 
How would you pass operators around as first class functions without hyperoperators or something?
 
And I could try building an interpreter for it. That's another project I've been meaning to pick back up, just below learning APL and learning Haskell on the list of things to do
 
Or would you use Haskell syntax instead?
 
10:01 PM
@user BQN allows you to switch syntactic class of named entities on the fly.
 
haskell syntax can be pretty terse, so it might be a good fit
 
Am I off in my understanding that operators are functions that take other functions as parameters? Because Haskell does that just fine, if so
 
Operators can take arrays and/or functions as operands, but they cannot take operators as operands.
 
What I'm not sure about is whether the best syntax to keep is Haskell's currying from the function on the left to the right (or from right to left?) until it's taken enough arguments, or to keep to APL's on one argument on the left, one argument on the right.
This requires a great deal more thought than I am currently able to give it
 
well there are still infix functions in haskell
so you could still have APL like syntax, but the potential to use multiple arguments if non infix
 
10:13 PM
Like K.
 
similar to k, but still allowing user defined infix functions and some other nice APL things like that
 
I suppose operators would be infix functions, and functions would be normal currying functions
I think it's similar in math?
 
most existing APL primitives could stay infix maybe
 
Perhaps the syntax for expressing a type could be a (dynamically typed) APL expression
 
that would be interesting
 
10:26 PM
Basically, it could have first class types, with the type of a function or operator depending on the arguments' types.
No idea if that's feasible or if it would be convenient, though
 

« first day (1569 days earlier)      last day (1072 days later) »