« first day (1363 days earlier)      last day (1299 days later) » 

12:03 AM
@dzaima and default them myself. ok i can do that.
 
@dzaima does each block get a variable array, and if there are no variables, it's empty? That's going to be implementation dependent I guess
but is {a} supposed to fail because it's looking up variable 1 in an empty array?
 
another thing im running up against that i think im missing some of the complexities of, are values.
js allows you to [1,2].sh = [2]
but in erl at least ive been using records (named tuples)
so ive been using a ravel field
 
@TessellatingHeckler each instantiated block gets a variable array, i.e. each DFND should create exactly one variable array always
 
@dzaima what is instantiated here? I was surprised when you said z←{a} should fail because in Dyalog APL it wouldn't be executed and doesn't fail until z ⍬
 
@TessellatingHeckler {a} isn't a function, it's an immediately evaluated block (niladic if you will)
@dzaima actually no that's plain wrong :|
 
12:17 AM
@cannadayr that's one of the things that pushed me to go with PS first; it's casual enough that I can add .sh when needed
 
@TessellatingHeckler correct version: each time a block is called, it gets an environment, and the variable array that comes with that. As {a} is immediately called, it gets its environment immediately, and accesses a immediately, which is, at the time of its execution, not defined.
@cannadayr yeah, making BQN arrays be a class/tuple of ravel & shape is good for specifying shape
@dzaima i.e. see what {2+2} does
if immediate blocks don't exist/work, F←{𝕩+a} ⋄ F 1 ⋄ a←1 is an alternative that does the same thing
 
what else is in the environment apart from the variable array? the core / runtime functions?
 
@TessellatingHeckler the parent environment. Otherwise you wouldn't be able to access a in a←1 ⋄ {a+𝕩}1
@dzaima that makes a "global" environment of a single variable a, and the {a+𝕩} block, when evaluated, creates an environment with 3 variables 𝕊, 𝕩, and 𝕨 (only one of which we use), and stores its outer environment as its parent (here, the global one)
 
@TessellatingHeckler It might help to read the scoping spec, which makes a point of carefully maintaining the distinction between blocks and instances of them (and identifiers versus variables). The last section is the part that's performed by the VM.
Lexical scoping is easy to use and easy to implement (assuming you have garbage collection already), but difficult to explain or talk about.
 
12:45 AM
@dzaima It makes sense in terms of the BQN language level
@Marshall I'll have a read of it; I'm familiar with using lexical scoping, although not implementing it.
 
 
1 hour later…
2:05 AM
@Adám like im interested in helping with apl cart, just where do you want the blog post and content mentioned in the issues to go? like a brand new page or what
 
2:52 AM
<moon-child> dfns are coming to j github.com/jsoftware/jsource/commit/…
 
3:23 AM
moon-child: Oh, so apparently they're special-casing the digraphs {{ and }}? That's a good news I guess, in terms of both golfing and general coding
 
<moon-child> well, not entirely clear how the syntax is supposed to work. I tried running the latest version and {{expr}} does nothing other than it would otherwise. (Though perhaps the feature is yet unfinished.)
<moon-child> also, looks like it was changed to {{ }} from (. ). IMO the latter would be better as it doesn't overload existing syntax. But maybe even better would be open with (: and close with bare )
<moon-child> better for golf, and it matches the existing non-tacit fn syntax
<moon-child> (also, leading : matches k9 expression syntax)
 
 
2 hours later…
5:07 AM
@NoahCristino All the issues labelled "pub" apply to pub/pub.tsv.
 
 
1 hour later…
6:36 AM
OK, the glyph-vs-meaning part of APL Wiki's mnemonics page should be complete now. Next up is the keyboard part…
 
 
4 hours later…
RGS
 
@RGS Thanks. I've put the LaTeX logo into a template. By LuaLaTeX and XeLaTeX, do you not mean LuaTeX and XeTeX?
 
RGS
I see you have created the LaTeX template, I was just trying to figure out where you defined it and couldn't find it. As for LuaTex/LuaLatEx and XeTex/XeLaTeX I don't know if they are different names for the same thing
Or slightly different things
 
CMC: LaTeXify a text by uppercasing consonants and lowercasing vowels.
 
@Adám what case is the input?
 
@dzaima You have to handle anything.
 
RGS
10:22 AM
I'm assuming we have to golf it? And what letters are vowels? Only aeiou?
 
@RGS Yes, CMC is always golf unless otherwise noted. And yes, those five.
 
RGS
I have 22 bytes then
 
dzaima/APL, 14
 
I've got 18 in vanilla.
 
@Adám vanilla as in Dyalog 18.0 or any APL with ⎕UCS?
 
10:26 AM
@dzaima 18.0
@RGS If you want, you can add an image of the rendered text.
 
got 18 also
dzaima/BQN, 21
 
Wait, BQN uses and for case mapping?
 
@Adám dzaima/BQN does, as it's never been removed from dzaima/APL
BQN, 28; probably pretty golfable
 
I see.
 
@dzaima 26, but i don't know whether the assignment mid-train is strictly legal by the specification
 
RGS
10:36 AM
@Adám sure ○/
 
 
1 hour later…
11:46 AM
@Adám bit difficult to golf this
 
I also have 18
 
RGS
12:04 PM
I'm interested in checking some of these vanilla APL 18 byte answers
 
12:32 PM
@dzaima It's explicitly pointed out that it isn't.
@RGS Wikipedia doesn't specially typeset LaTeX, and I'd say we should follow suit. A name is a sequence of letters; the fancy representation is a logo.
Some discussion in Manual of Style/Trademarks.
 
 
1 hour later…
1:49 PM
@Marshall Good point. We should just use LaTeX then.
 
RGS
1:59 PM
@Adám Will you fix it, then? I don't know where to remove the {{LaTeX}} template from.
 
2:11 PM
@RGS All done.
 
How do I make the ≢ in (≢=2∘×∘+/) monadic?
 
@Razetime It already is if the whole function is called monadically.
 
RGS
@Razetime from the left or right? assuming the train is dyadic
either way, f⍤⊢ and f⍤⊣ are probably the patterns you are looking for
 
@Razetime Btw, 2∘×∘+/ can't be right because it is a monadic function as operand to / (unless the argument has trailing length 1)
 
⋄(≢∘=2∘×∘+/)1 0 0
 
2:19 PM
@Razetime SYNTAX ERROR
 
@Razetime Can you add some parentheses to clarify what you mean?
 
I just want a simple fork f(x) g h(x)
 
what are f and g and h separately?
 
RGS
┌───────┬─────────────────┐
│┌─┬─┬─┐│┌─────────────┬─┐│
││≢│∘│=│││┌───────┬─┬─┐│/││
│└─┴─┴─┘│││┌─┬─┬─┐│∘│+││ ││
│       ││││2│∘│×││ │ ││ ││
│       │││└─┴─┴─┘│ │ ││ ││
│       ││└───────┴─┴─┘│ ││
│       │└─────────────┴─┘│
└───────┴─────────────────┘
 
(≢)(=)(2×+/)
 
RGS
2:20 PM
@Razetime this is what you have ^
 
yeah I should remember to try that first
 
@Razetime AH, but then you need …×∘(+/)
 
RGS
Or you could also just write (≢=2×+/) or did I get smth wrong?
 
I wasn't sure if that'd work
atleast like how I needed it
 
Yeah, I think what you want is (≢=2×+/)
 
RGS
2:23 PM
(≢=2×+/) checks if the length of the vector is equal to twice the sum of its elements
 
yup it does work
great
 
<phantomics> Something odd I found
<phantomics> ⋄ 0↑1 5 6
0 ⍴ 0
<phantomics> ⋄ ⊃0↑1 5 6
0
<phantomics> That looks normal
<phantomics> But what's this?
 
phantomics: 0↑ changes the length of the leading axis to 0
 
  Ṛ       -   reverse                   [7,  6,  5,  4,  3,  2,  1,  0]
 c        -   n-choose-k                [0,  0,  0,  0,  4, 10,  6,  1]
I saw this in a Jelly answer just now
How do I n-choose k in APL?
 
RGS
@Razetime k!n
 
2:34 PM
(first of all, what does it mean)
 
RGS
@Razetime (n choose k) gives the number of different ways in which you can bag K objects from a bag with N different objects
(pls notice that the order in which you bag items does not matter for this)
 
⋄{w!⍨⌽⍳1+w←⍵}7
odd
anyway, looks like I'm not doing something right
 
RGS
⋄ {w!⍨⌽⍳1+w←⍵}7
^ 1 7 21 35 35 21 7 1
 
oh, bot died.. that's why phantomics message seemed cut off
 
ok I got how it works
a(n) = Sum_{k=0..n} (C(k, n-k) + C(k+1, n-k-1))^2
{+/×⍨{((n-⍵-1)!⍵+1)+(n-⍵)!⍵}⍳1+n←⍵}
does this match it?
 
2:46 PM
@DyalogAPL what followed after that was a message of ⋄ ⊃ 0↑'' 4 5 6
 
RGS
@Razetime looks like so
 
hm, doesn't give the right answer...
 
RGS
@Razetime are you using the correct ⎕IO?
 
yep, using ⎕IO←0
 
RGS
problem is in n-⍵-1
recall that APL evals right to left, so that is actually n-⍵+1 in standard mathematical notation but you really want to write n-⍵+1 or n-(⍵-1)
 
2:53 PM
oh n-(⍵-1)
Ima try n-⍵+1
yep its correct
 
RGS
 
@RGS ?
 
RGS
Like the "correct" mark, nvm
 
oh nice
 
@dzaima @Moonchild bot dead
 
3:27 PM
i wonder if there's anything we can do to increase the reliability of the bot.
Maybe someone who tends to hang out here (not on #apl) should be in control of it, as we are more likely to notice its absence?
 
@Adám there was this, but doesn't appear to have been effective
 
3:41 PM
rewrote a subset of bqn vm prototype in elixir last night.
pros: elixir is less rigorous about mutation (instead using variable rebinding), which is good when I dont personally have a complete enough mental model to write a functional version. it has keywords [1], which seems to provide similar functionality as foo.sh where foo was a list.
cons: erlang has named funs [2] which are very handy for writing self referential lambdas. there is a way to emulate it in elixir (wrap in outer function that you call with itself as a parameter) but its hacky
 
 
3 hours later…
ngn
6:25 PM
@dzaima you have online interpreters for canvas, sogl, etc. what algorithm would you recommend for encoding permalinks?
 
@ngn those are just stupid base64 of unicode escapes because i didn't know better. Now i'd either suggest a base64 of utf8 bytes of the wanted string, or, if wanted, some compression on top; paste uses pako, which is what tio uses, but comparing different compression algorithms is a todo item for me
but with any of those you want the encoded text to be after a # so that mess isn't sent to the server (unless you have a server and want server-side processing for it, but i doubt that)
 
@ngn For the BQN REPL, I used Base64 of the code in UTF8. It's not too bad in modern Javascript, or in BQN, and it gives a URL that isn't affected by URL encoding.
# Encode
let b=(new TextEncoder()).encode(doc.code.value);
btoa(String.fromCharCode(...b);
# Decode
let b=atob(code);
b=new Uint8Array([...b].map(c=>c.charCodeAt(0)));
(new TextDecoder()).decode(b);
 
ngn
yes, i do utf8+base64 too, and it was easy to set up
@dzaima is pako general-purpose compression or something specific to text or source code?
 
@ngn no clue. i blindly copied tio
(it's just zlib in JS)
 
ngn
@Marshall i used en/decodeURIComponent instead of TextEn/Decoder
 
6:36 PM
@ngn that'll create longer links
 
ngn
@dzaima no, i just use it for converting to/from utf8
 
@ngn It doesn't do that though. It escapes it to ASCII.
 
ngn
it escapes with %-s, then i turn %hh into the corresponding char
 
@ngn encodeURIComponent("⍺") gives 9 characters, which is 3x the corresponding UTF-8
 
@ngn I guess that works, but it's more code, right?
 
ngn
6:39 PM
@dzaima i would immediately replace %hh with 1 byte, so it's 3 really
 
@ngn ah, you then do extra manual work afterwards. Is it really shorter than the corresponding TextEncoder/Decoder though?
 
ngn
@Marshall about the same, but TextEn/Decoder looks slightly better, so i'll use yours :)
 
u8e=x=>String.fromCharCode(...(new TextEncoder()).encode(x));
u8d=x=>(new TextDecoder()).decode(new Uint8Array([...x].map(c=>c.charCodeAt(0))));
I can't get your definitions to work: breaks on y._(1).
 
ngn
@Marshall _() is slice()
i didn't know fromCharCode() could be used like that. nice :)
 
6:54 PM
I'm pretty sure I just looked up this code and reformatted it, so it's not my trick.
 
ngn
it turns out, it is shorter in my code. i already use Text..coder in other places, so i already have them as globals. and it works.
 
BQN has one-line UTF8 encoding without libraries:
U8e ← ∾ (2⋆7) (⊣+(2⋆6){𝕨 ≤◶⟨⥊⊢-2×-⟜𝕗 ⋄ 𝕗(|∾˜(2÷˜⌊⟜𝕨)𝕊⌊∘÷˜)⊢⟩ 𝕩}¨) -⟜@
Not sure about decoding since I haven't needed it yet.
 
ngn
does it have a unicode string type?
 
Characters are Unicode code points, and strings are lists of characters.
 
ngn
k doesn't mix well with unicode, chars are 8bit, but it wouldn't be hard to use an int list for the code points
@Marshall @dzaima btw, isn't utf8 a very bad encoding for apl and apl-like languages?
 
7:02 PM
@ngn it's definitely not the best, but setting up a custom codepage for APL, which still allows including arbitrary unicode besides APL, would be quite a bit more work
 
If people try to share so much code in the REPL that they have URL length problems, that's kind of on them.
 
ngn
@dzaima technically it's just indexing..
 
@ngn the unicode fallback part is the harder part
 
You also have to start worrying about forwards compatibility though.
 
ngn
@Marshall obviously you're not a hardened golfer yet :)
i was thinking of rolling my own encoding+compression
 
7:05 PM
for what, k? compression, sure, but encoding?
 
But code golf is the most advanced form of compression.
I should use the most bloated encoding possible, to encourage people to golf!
 
ngn
@dzaima yes, huffman coding, for instance, would be like both at the same time
i think i can do better than huffman, but it's probably better to take one step at a time
@Marshall code golf compresses as much as the underlying language allows
but think about this: in k (being pure 7-bit ascii) 1/8 of the bits are wasted
@ngn (and as much as the skills of the golfer allow, of course)
 
@ngn I'm just joking, I know golfing with compression is smaller. But I do have to wonder what would motivate a K programmer to share more than, like, a kilobyte of code.
There's kind of this phenomenon where the things users of a language worry about are precisely the kinds of things the language should prevent them from having to worry about.
 
ngn
@Marshall a codegolf.SE challenge that has a kB of input?
@Marshall in codegolf you worry about one thing: the length of your solution. shorter permalinks are just a nice extra.
 
C - performance, K - bytes, Java - extensibility, BQN - compiler speed
 
ngn
7:17 PM
k - simplicity&speed
but yeah, "simplicity" most often translates to "bytes" ("kolmogorov complexity")
 
Haskell - proofs
 
ngn
haskell - tenure :)
 
That explains the laziness.
 
ngn
is there a limit on url length?
 
There are many different limits, I expect.
 
ngn
7:24 PM
5100
A: What is the maximum length of a URL in different browsers?

Paul DixonShort answer - de facto limit of 2000 characters If you keep URLs under 2000 characters, they'll work in virtually any combination of client and server software. If you are targeting particular browsers, see below for more details on specific limits. Longer answer - first, the standards... RFC 26...

and wow - 5k upvotes!
 
<phantomics> Got it, thanks
<moon-child> ⋄⊃0↑'' 4 5 6
0 ⍴ ' '
<phantomics> Is APLBot actually written in APL?
<moon-child> no, it's written in raku
<moon-child> github.com/moon-chilled/seproxy
<phantomics> But the Dyalog instance crashing crashes it?
<moon-child> (though the sandbox part is by @Ádam; that's written in apl)
<moon-child> no, the raku interpreter itself crashes
<phantomics> Got it
 
7:38 PM
@ngn simple, just import golf and have it be a module full of one-character functions which implement golf problems. Call it 0SABIE or J3LLY or something and claim it's a golf language. (If golf is compression, it should be held to the standards of compression challenges and be sizeof(code+interpreter) which counts)
 
ngn
@TessellatingHeckler "code+interpreter" - i agree :)
i'm proud of my binary being ~110k (no libs)
 
@TessellatingHeckler Isn't that the same as writing a code golf challenge only for the languages the interpreters are allowed to be written in?
 
<moon-child> code+interpreter--what if my interpreter is 'eval'?
 
ngn
@moon-child what is your interpreter's interpreter? ultimately we have to measure x86(_64) binaries
(and, yes, i know x86 is itself interpreted..)
 
<moon-child> amd microcode is ~1.5% the size of intel microcode
 
7:49 PM
98.5%, perhaps?
 
ngn
microcode varies too much from cpu to cpu, and it's usually a secret
 
Oh, the provided microcode, not equivalent microcode.
 
@Marshall I don't think it's the same; there might be some value in "how short can a general-purpose interpreter be", I don't see much value in "in FooLang, there happens to be a one-byte front end to this large and hyper-specialised back-end, 1 byte answer" and then switch languages every question
 
<moon-child> @TessellatingHeckler that's true, but a self-interpreter in joy (iirc) or lisp is not more than 20 lines. Which can't really compare with most other languages
<ioa> Somehow it makes me happy that the raku instance crashing is to blame and not the APL.
 
7:56 PM
@moon-child it's probably not reasonably possible to do this in competitions anything like the normal codegolf ones, they'd be eaten up in IO code if nothing else. But if you can write a self-interpreter in Joy in 20 lines and also write a solver for whatever the problem is, that's impressive. More impressive than writing a one-liner in Python leveraging megabytes of hashing and set and generator and bignum code behind the scenes.
and more impressive than writing a 10 byte J answer that calls p: as a builtin
 
<moon-child> the mathematica answer to the invertible goat problem was pretty impressive tho
 
ngn
@TessellatingHeckler a codegolf challenge is not a competition between languages, but more like a set of per-language competitions
 
I don't think my BQNterpreter problem is array flattening/nesting, I think it's scoping between blocks inside run()
 
@TessellatingHeckler A self-interpreter isn't a reasonable measure of programming language complexity, because it can reuse all the language's functionality without ever implementing it in the first place.
Even if you somehow find a way to clearly define and disallow eval-like things.
 
<moon-child> (see ken thompson's example of implementing escape sequences in c, where you don't have to have a numeric value for e.g. '\
')
 
8:02 PM
@ngn I use base-85 in Try APL 3.0. But that is for binary data.
 
here somewhere, github.com/mlochbaum/BQN/blob/… where the code inside D has to be able to reference vm() which is defined after it, that works in lexical JS and not in dynamic PS, and I think the way I addressed that is maybe only working for simple things and not modifiers
 
ngn
@Adám and in your case the binary is the utf-8 encoding of the apl source?
 
ngn
8:17 PM
a url "fragment" (the part after #) can contain these 81 (if i counted correctly) chars, so a base-81 encoding would make more sense
 
<phantomics> Something still doesn't make sense
<phantomics> 0↑'' 4 5 6 is supposed to be a vector containing ''
<phantomics> So you need to disclose it twice to get the blank character prototype
<phantomics> ' '=⊃⊃0↑'' 4 5 6 is 1
<phantomics> But ⍴0↑'' 4 5 6 is 0
<phantomics> ' '=⊃0↑'' 4 5 6 is an empty vector
 
ngn
that's why roundtripping is important
 
@ngn don't see how that's really relevant, other than wanting a way to display prototypes, which would probably be awful in runnable code form
 
<phantomics> How can the empty vector produced by 0↑'' 4 5 6 produce an empty vector when disclosed instead of the character array prototype ' '?
 
0↑'' 4 5 6 isn't an empty character vector, it's an empty character vector vector
 
ngn
8:26 PM
please, whoever starts implementing the next 100 apl-like interpreters in whatever super-cool language, do make the output look like an apl expression. don't print it as "1" when it's really a vector. print ",1". don't print empty. print ",⊂⊂0 0 ' '" or whatever it is with full information about the prototype.
 
again, see ⊃0↑(1 'ab' (2 2⍴'c'2 3'd'))4 5 6 - the result is just the 1st element with leaves changed
 
<phantomics> An empty vector whose type is the empty character vector?
 
no, an empty vector whose would-be element type would be an empty character vector
@ngn roundtripping format is just pure awful for visualizing nested & high-rank arrays
 
<phantomics> Yeah, its prototype is an empty vector
<phantomics> I'll have to think about how to implement that
 
ngn
@dzaima that could be an option, but i think the default must be round-tripping. it helps a lot with learning, and learners don't know how to configure their interpreter yet. the defaults must suit their needs.
 
8:28 PM
and then with you're getting that prototype, so ⊃0↑'' 4 5 6 is an empty character vector
@ngn i'd agree that roundtripping really should be provided, but the default really should be something usable
roundtripping for everything often doesn't suit my needs even now
phantomics: also see ⎕SE.Dyalog.Utils.repObj - round-trip formatting in Dyalog
 
<phantomics> thanks, I'll have to think about how to implement that, arrays can't have an array as a type in CL
 
(about formatting, there's the third option of it being interactive - by default the output is "pretty", but you can examine any previous output - get deeper insight, prototype info, roundtripping code, etc)
 
@dzaima I implemented that for Dyalog.
 
@Adám where?
 
8:37 PM
$HOME/dyalog.18U64.files doesn't exist (and making it doesn't make it work either)
 
:-(
 
RGS
@Adám The "StartupSession" folder in Windows is read by default by APL when the session starts?
 
8:50 PM
@dzaima (but the "pretty" still shouldn't leave out info like whether 1 is a number, vector, matrix, or character. Leaving out prototypes is fine imo)
 
9:12 PM
@RGS Yes.
 
RGS
@Adám Ah, as documented here, is that it? So things I have in that folder end up under ⎕SE?
 
@dzaima So you arranged matters until you had $HOME/dyalog.18U64.files/StartupSession/out/init.aplf ?
@RGS Yup.
 
@Adám yep. ⎕SE.out just isn't defined
 
@dzaima Hm, well you can try ]import ⎕SE.out $HOME/dyalog.18U64.files/StartupSession/out
(though you may need to actually use the value of $HOME)
 
@Adám that works (with $HOME expanded obviously)
crucially, you cannot copy the def. It's quite annoying that getting a proper hover/click popup in html is so impossible
 
9:19 PM
@dzaima Wait, what? What is your problem?
 
@Adám like, if i did 0↑(1'a')2 there's no way for me to copy code that gives that result
 
@dzaima Can you not Ctrl+click on the result area, then select and copy as normal?
 
@Adám ah, i didn't read the readme. :p
 
@dzaima At some point (during work hours) I'd like to investigate this. If you're open to a screen share session, I'd appreciate it.
 
9:43 PM
@Adám sure; if strace really displays everything a process accesses, it only ever reads $HOME/.dyalog/* and /opt/mdyalog/…
 
@dzaima What happens if you put "out" into the StartupSession that is a sibling of the dyalog executable?
 
@Adám then it works
 
@dzaima OK, can you edit the startup.dyalog sibling file to the executable? Change the line [52] verSpec←{ into ⎕←verSpec←{ then start APL and let me know what it prints to the session.
 
@Adám hmm, gives /home/dzaima/dyalog.180U64.files
ah, 18 vs 180
 
@dzaima Is $HOME=/home/dzaima?
 
9:55 PM
@Adám yeah
yep, adding the 0 makes it work :D
 
Oh, so that's just a typo in the README. Will fix.
 
and now i'll know to look for a better way to read all file/directory accesses of a process
 
And I'm happy we solved this. Looks like both of my projects work as intended; the Dyalog startup procedure, and "out. G'nite!
 

« first day (1363 days earlier)      last day (1299 days later) »