« first day (1321 days earlier)      last day (1351 days later) » 

9:05 AM
Weird question, does anyone know of any golf based languages that use a miller rabin based primality test as their primality checker?
 
@rak1507 J uses Miller-Rabin algorithm for numbers larger than 2³¹.
 
amazing
 
ngn
@rak1507 probably all that have any primality test at all (some might implement an additional strict test too)
 
Well I was looking at 05ab1e and it just bruteforces factors, bit disappointing
 
ngn
@rak1507 right, that can't go very far
 
9:12 AM
yeah
definitely wouldn't work with 1543267864443420616877677640751301
bonus points if you figure out what that number is
 
ngn
@rak1507 27778299663977101*55556599327954201 ?
 
@rak1507 Upper limit for exact result from Miller-Rabin test with a appropriate set of witnesses.
 
yep, strong pseudoprime
 
ngn
@rak1507 not strong enough for the gmp library:
>>> import gmpy2
>>> gmpy2.is_prime(1543267864443420616877677640751301)
False
 
shame
 
ngn
9:25 AM
gmp performs the test 25 times by default. it takes only 2 tests (i guess using the smallest bases for miller-rabin) to prove it's composite.
 
I was thinking if it was opened again needing a strong pseudoprime for the key could be an interesting way of doing this codegolf.stackexchange.com/questions/210638/…
 
ngn
@rak1507 so, the challenge asks "cops" to make a cipher without using cryptography :)
 
does primality testing count as cryptography?
 
ngn
@rak1507 i don't know. i'm not sure the author of the challenge knows. cryptography is just mathematics.
 
I thought that was just so someone couldn't say 'decrypt this without knowing anything' or something like that
 
ngn
9:38 AM
there's an important cryptographic algorithm called the "one-time pad", which is basically xor. does that mean we can't use xor.. ?
anyway the challenge is closed, and rightly so
 
yeah it's too vague
 
 
1 hour later…
10:45 AM
Is there a defined max recursion depth for non-tail-calls in Dyalog?
 
@xpqz No, it simply fills memory.
 
Memory in this case being the max size of the ws?
 
Yeah.
 
Ok, that explains what I can see, I think.
Can I ask the interpreter what it thinks the ws max size is?
 
@xpqz ]config MAXWS or ⎕SE.Dyalog.Utils.Config'MAXWS'
 
10:57 AM
Aha. 256Mb. Very spartan.
So I have an environment variable set MAXWS=8G -- but Dyalog seems to ignore this on the Mac.
How do I increase the max?
 
@xpqz Check ]config MAXWS -origin
 
 ]config MAXWS -origin
 MAXWS  Built-in default  256M
 
11:13 AM
@xpqz As you're using 18.0 you are best off editing $HOME/.dyalog/dyalog.dcfg. You'll need to remove the "//" before MAXWS: and alter "256M" to "8G". Just be careful not to overcook the size you set MAXWS to .. consider how many APL sessions you might run at any one time. We don't grab all that memory at startup, but I have killed many a system in my time by setting MAXWS too big and then starting up far too many APLs !
[FWIW in 17.1 you'd need to edit $HOME/.dyalog/dyalog.config]
 
11:25 AM
Thanks @AndyS -- do I need to restart, or can I tell the interpreter to reload its config?
 
11:43 AM
@xpqz Sorry .. critical run to the shop for milk - can't survive without tea. You'll have to restart.
 
:D Any workplace runs on tea.
 
12:03 PM
@xpqz Indeed. Some of us have tea rather than bloody flowing through our bodies. MAXWS will report what the maximum value can be, but you might also want to use 2000⌶ or ⎕wa .. and you might like to search for workspace management to see how we actually use the value of MAXWS
 
12:22 PM
@Marshall your dyadic inverse for ¬˜ seems wrong (also monadic ÷˜ ¬˜ very much go against "give an error if there are many choices of inverse" and i wouldn't say identity is very preferable, nor does the error checking seem useful)
 
@dzaima Fixed ¬˜ (well, changed it to +-1˙ which seems more likely to be right). You're probably right about the constant inverses. I added ⊣⁼ since it's often useful to "merge" two values in this way, but the user has to know the spec in order to confidently use it, and in that case they should know to use ⊣⁼ specifically.
 
@Marshall that's what i arrived at; ⊣⁼ does seem maybe useful (and, at the very least, not bad)
 
I'll keep k⁼ for data value k since it makes sense as a shortcut for ⊣⁼, and remove the others, including ˙.
 
12:38 PM
(also trying to figure out what is -˜÷1-⊢ for ∨⁼ since the only arguments i've seen it working for are 0s)
 
@dzaima Ah, I think it's supposed to be -˜÷1-⊣.
 
that seems correct
 
1:40 PM
@dzaima i'm thinking about switching to •args/•path being determined at tokenize time again ( won't know about them, but that's probably actually good), so loading & viewing files in the REPL is possible
 
2:18 PM
@Marshall thx updated. written imperatively but ill improve... at some point
 
another BQN question, (ill have to think about and rewrite some code to come up w/ a good example):
in the case of the PRNG, i want to call the function w/ a left hand arg, (say N Prng S), where N is an integer, and S is the state (list of 4, 64 bit numbers).

If N = 1, it will just calculate the prng and return the successor state
if N > 1, it will accumulate the random numbers, and return the final, modified state

still figuring out the language (1/2 modifiers esp), so Im trying to figure out a concise way to write this. The docs seem to hint at ◶.
no rush or anything, i usually ask a question, take a break, think it out, and check back later to incorporate answer. v efficient :|
 
@cannadayr yeah, something like (N=1)◶{𝕩: handle N>1}‿{𝕩: handle N=1} whatever. Or go with headers - {1: handle N=1 ; handle N>1} N
 
@dzaima quick q while youre here, in dzaima/bqn I can write a dict like ⟨"x":1⟩, how do I get "x" back out?
(tyvm btw, will dig into this answer in a bit and try to internalize it better)
 
@cannadayr that's not a dict, it's a vector of two items, and that syntax doesn't error because i implemented headers in an extremely lazy way; currently there are (almost) no dictionaries in dzaima/BQN
 
2:32 PM
@dzaima gotchya thx
 
@dzaima (they technically are still there from dzaima/APL but i don't think there's a way to get/set data at all so they're pretty much pointless)
 
@dzaima no worries ill ignore them. not a big deal at the moment.
 
@dzaima (the 𝕩:s are there in case 𝕩 isn't used (as 𝕩 will be the whatever, which often is useless when using as an if-else), without them the blocks will be executed immediately instead of being no-arg functions)
 
@dzaima does bqn have guards?
 
@cannadayr as in APL, no
your choices for branching code is / (my first example), or headers (second)
 
2:37 PM
@dzaima what is the use of the colon?
not sure what primitive it is if its not a guard
ill have to read doc/block.md a bit more...
 
@cannadayr Case headers only handle constant values, but they might be what you want sometimes.
 
@cannadayr it denotes the end of a header. As an example, {𝕊 𝕩: 𝕩+10} is a strictly monadic function (𝕊 𝕩 denoting the way the function is used); the 𝕊 can be omitted, and replacing the 𝕩 with something else deconstructs it
 
Announcement: Dyalog v18.0 printed manuals now available.
 
@dzaima with small modifications, also in the JS interpreter
(but now back to fixing mlochbaum/BQN/test/bt, as it's giving an annoying error:)
https://dzaima.github.io/paste/#01VVfTxNBEH92P8VQNVwDHHdH/3FRIlCIEEuRwmvj3XULZ6@75/1BkJDwZJAE44MEYjQkPMGTb@qTJvDot7hP4Edwd6@2RQutIRjcyzWzszO/@c3Mdm6m7jq4jklgBDYlU55HPR2eGquG7BhkWR73PGN9hlTwWjEMitUJGpKKP7VmYZeb6yCOIAU0DIBWwRTnUKUeOJgsByuQQqXAsGo6Suso2jqaLBbmbQdXoBoSi0Og04/dHwSgKKBkga35pdJD6NMaKq2lOtvvbKaqEK/pOa3YMBlpc/vMddOgCLP89Fwe1A5e6mhjvzC1OIfGxjhKroWiXo1PJ7dMS5e6wE1tmQw1stCaWVwUK9VyirbfcSOlaaQWEUrd3Eaxsv9lo2KUm94oNKKj/EJIopdvNpDwFaWMDo9Na5AOmk4tOjwBdgquZ9d9mKR1lzUHfnzYO0Fw2SojTUcF4bqBo61vpg5StPsaJ6OdL9Gro2
@dzaima ah, it's not my •args refactoring that broke that
 
The compiler runs under plain dzaima/BQN now! I thought it still needed multidimensional join but all of those are in wc.bqn (the Wasm backend). Just pushed the change.
 
2:54 PM
@Marshall very nice
 
3:19 PM
@dzaima how long has bt been broken for‽
@dzaima i'm guessing since it adds the trailing RETN. i guess i never did make sure it worked
pushed fixing that, and the •args rework. most things (including •EX) are as before, but )exing files in the REPL writes the variables in the current scope
 
3:50 PM
@dzaima I started running with •compstart↩¯1 when the JVM transpilation started failing because the bytecode was too long. It's been working with that setting since then, but I haven't been testing without it.
@dzaima gendocs is failing now because md.bqn uses •path and runs under dzref. Guess I need to record the source file path in dzref and do a replacement?
 
4:14 PM
@Marshall hmm.. an alternate would be some way to give the arguments, but that's also an option
in general it'd be nice to be able to pass just •args as 𝕨 to , but also •path/•name if needed
 
 
1 hour later…
5:26 PM
@cannadayr Realized BQN numbers are 64-bit floats, so you can't do arithmetic accurately on 64-bit ints with them. It's probably best to stick with the binary representation the whole time. Here's a model of little-endian (backwards relative to APL ) addition, and it looks like all the multiplies are by small constants so you can decompose them as shifts and adds.
 
RGS
6:01 PM
I was wondering if ⊢ and ⊣ are considered scalar functions. After some thought I think I could say their monadic versions are, but their dyadic versions aren't. Would you guys agree?
 
@RGS sure, that kind of works. dyadically they do fall apart on a vector & scalar argument
 
 
2 hours later…
7:57 PM
NARS2000 having ⎕a for lowercase alphabet and ⎕A for uppercase is nice
 
@TessellatingHeckler with all other quads being case-independent i feel like that's a bit strange. i went with ⎕l or ⎕la in dzaima/APL (and so •l/•la in dzaima/BQN)
(it'd be impossible to differentiate •a and •A in BQN anyways)
 
@dzaima it's a bit strange that quads are case-independent and variables are case-dependent. Having a distinct lowercase one is neat
(what use are ⎕A and ⎕D outside golfing and puzzles? Were they present right back in APL/360, and pre-ASCII?)
 
8:13 PM
@TessellatingHeckler yeah, that too is strange. not sure which case i'd prefer for quads, but BQN solves this by consistently ignoring case anyways
 
8:34 PM
@dzaima PowerShell ignores case in variable names (operator names, function names), also in string comparison ('abc' -eq 'ABC'). does BQN go that far with it?
 
@TessellatingHeckler no, it doesn't touch character equality (that'd break many many things); variables (and so functions & modifiers (aka operators)) are all case-insensitive, but case does matter syntactically (it's what determines if a variable is supposed to be interpreted as a function or a value (e.g. f F f is the function f called dyadically with both args being the same function))
 
8:54 PM
@dzaima that doesn't sound like "consistently ignoring case", that sounds like case sensitive and case is significant; if it can distinguish f and F, why would it be impossible to distinguish •a and •A ?
 
@TessellatingHeckler f and F still read the same variable, they're just used differently. for example F←+ ⋄ •←f prints +
furthermore that means that •A would be interpreted as a function so that wouldn't work anyways
 
@dzaima ahh yeah ok. After saying I like ⎕A vs ⎕a, I'm seeing that and thinking "that's a bit too Perl-ish"
 
@TessellatingHeckler can't seem to see doing anything in this emulator so that's probably a no
(the wiki mentions "later ⎕IO" so i don't know)
 
@dzaima wow, classic emulator; quad there does ⎕←1 output, but ⎕A errors; and looks like there are no lowercase letters for ⎕a on the keyboard
no it has ⎕LC whatever that is
 
9:27 PM
Finally got around to this, I think it's a neat problem with a cool array-based solution (and fast!) youtube.com/watch?v=LD7kSshwTkA
 
10:08 PM
@voidhawk started watching, but it's so long since I looked at any AoC things that the storyline is lost context; will have to watch later
 
10:24 PM
Is there any real difference internally between an APL-style implicit map, and a LISP-style explicit map? Does the APL style really avoid a function invocation on every item in the array, and do good LISP engines avoid it as well?
 
@TessellatingHeckler System variables like ⎕IO were introduced in APL.SV, but skimming through the manual I don't see ⎕A or ⎕D.
 
Certainly not an expert, but "APL-style implicit map" means basically scalar functions I think? If that's the case it should be pretty different, since you can use SIMD where appropriate and you're looping through the shape/striding the array rather than invoking a function on each chunk. That all goes out the window if you do explicit mapping with something like ¨ though
 
10:40 PM
@voidhawk That's up to the implementation: ר doesn't become inscrutable gibberish because it's two characters long. Dyalog just removes the Each from a scalar function except in some edge cases involving empty arrays where that would change the behavior. More complex operands could be analyzed as well.
 
@Marshall That's 1973? This Burroughs APL/700 manual ( softwarepreservation.org/projects/apl/Manuals/… ) has ⎕A and ⎕D in a code sample on page 90, and is from 1975
early 70s or so, then
 
@TessellatingHeckler Oh, that's interesting. They're not in the APL2 or SAX (SHARP derivative) manuals, and both of those were mainly developed in the 80s.
@TessellatingHeckler They're defined on page 138 (6-9) along with a bunch of other character constants.
It's possible Burroughs introduced them, as I know they did add some functionality. If not, I would guess it came from APL*PLUS, but it's strange that it's not in SHARP in that case.
 
10:58 PM
@Marshall I see them; ones that seem quite niche like backspace and tab, and is a null character different to an empty string?
 
@TessellatingHeckler It's a scalar while an empty string would be a 0-character vector (and remember that as a flat APL with no boxes APL/700 wouldn't allow vectors to be stored in arrays).
 

« first day (1321 days earlier)      last day (1351 days later) »