Sandbox

Where you can play with chat features (except flagging) and ch...
Oct 15, 2024 17:20
message 2
Oct 15, 2024 17:10
hello world
 

 The APL Orchard

apl.chat ― Learn, teach, ask, code, golf, & discuss usage. See ...
Jul 8, 2023 21:02
@RubenVerg as a "hint" that it should be stable - if it weren't, there'd be no need to have both and , as ⍒x would just be ⌽⍋x. And of course also that grade being stable is very useful
May 18, 2023 11:57
@Adám this?
Apr 22, 2023 13:20
I'd maybe say that they have the same structure
Apr 12, 2023 11:34
@B.Wilson that's for the monadic case, which isn't defined; though, yeah, "Not Yet Implemented" isn't really accurate if there is nothing to implement
Apr 11, 2023 14:27
and it's all very very incomplete
Apr 11, 2023 14:27
@B.Wilson dzaima/APL doesn't provide anything for allowing to invoke Java things from APL, so you'd be stuck doing most things in Java. It does have a Processing integration, which'd allow you to draw rectangles & circles & stuff, but no native UI stuff
Apr 4, 2023 09:51
@B.Wilson 1 + 2 3 4
Mar 19, 2023 14:13
@B.Wilson replacing the /**/s with ##s appears to make it compile
Mar 17, 2023 19:37
and {(+´÷≠) 𝕩⊏˜ (⌊⋈⌈) 2÷˜¯1+≠𝕩}∘∧∘∾ is one option for avoiding the branching for the median
Mar 17, 2023 19:34
an alternative way to write the second function might be {⌊´ ¬∘∊⟜𝕩⊸/ 1+↕≠𝕩}, avoiding one of the 1+es by "reusing" it
Mar 17, 2023 19:31
@Slimey BQN is 0-indexed, so /𝕩 is just the thing you use for APLs ⍸⍵ with ⎕IO←0. If you require 1-indexing, you indeed just 1+ that, same thing you'd do for anything you want to make 1-indexed
Mar 1, 2023 16:03
(my internet connection to pc is absolutely dying for whatever reason)
Mar 1, 2023 16:02
yeah
Mar 1, 2023 15:46
there's certainly no reason that an APL couldn't support directly assigning dops - dzaima/APL does
Mar 1, 2023 15:41
Jan 3, 2021 at 12:16, by Adám
@dzaima You are lucky, not having customers that (ab)use to stop execution!
Mar 1, 2023 15:10
@B.Wilson they're more a list of tokens; or, rather, APL code in general is a list tokens before execution, that's nothing special to dfns
Mar 1, 2023 15:06
actually, {}s aren't even (necessarily) parsed ahead-of-time - 2+2 ⋄ { successfully evaluates 2+2 before it realizes that the curly brace is unmatched
Mar 1, 2023 14:36
:)
Mar 1, 2023 14:27
Jan 3, 2021 at 11:35, by Adám
@dzaima That's what happens when design give way to bandages and duct-tape. My colleagues where rather surprised when I presented this:
Mar 1, 2023 14:24
@dzaima and it largely can't - consider {f} - is that a valid dfn? it might be if f is an array, but not if it's a function or operator. And the class of a variable can change over time
Mar 1, 2023 14:22
because Dyalog doesn't parse dfns before execution beyond finding the closing brace; even { ]( } isn't a syntax error before it's called
Mar 1, 2023 14:20
any {}-enclosed thing that doesn't have ⍺⍺ ⍵⍵, nor ∇∇, will be a function
Mar 1, 2023 14:17
you'll have to separate out the statements - op←{∘} ⋄ 3=⎕NC'op'
Mar 1, 2023 14:16
it wants to build a train, just like 3=⎕NC'op'⊣op←+ or equivalently 3=⎕NC'op'⊣+
Feb 24, 2023 18:22
(or put f 5 in the "Input" field)
Feb 24, 2023 18:21
you want ⎕←f 5
Feb 24, 2023 12:08
there's also ⍺⍸⍵ but that & grade are the only things that use TAO iirc
Feb 16, 2023 19:39
that seems more like an issue with the color scheme and not the font
Feb 15, 2023 09:39
(remember that APL started out like in the 1960s)
Feb 14, 2023 18:25
as much as doing things by codepoints makes it impossible to construct mismatched UTF-16 surrogate pairs
Feb 14, 2023 18:15
realistically, the "proper" attitude should be that doing things by codepoints instead of graphemes is like the "new" version of doing UTF-16 without handling surrogate pairs - works for most things, but not all; but, unfortunately, while handling surrogate pairs is feasible to do yourself, with graphemes you pretty much have to get a library and suffer a heavy performance and/or memory usage penalty
Feb 14, 2023 18:04
and consider things like this where you would actually want to see the combining characters on their own
Feb 14, 2023 18:03
@B.Wilson APL, J, and BQN all have already chosen that the character type is a codepoint, that's not gonna change without a completely new language. and k (most of them at least) is even more behind, having characters be bytes. Grapheme clusters are a very niche thing for storage (which makes sense as they're variable-size, which makes them incredibly awful to impossible to work with in non-performance-destroying ways)
Feb 14, 2023 17:46
and there's not even much to do here - the matrix there is a 7×2, so there'll necessarily be some unwanted padding. There are like three conflicting interests - rendering as unicode-intended text, rendering as a matrix, and having the text output be copy-pasteable or programmatically readable
Feb 14, 2023 17:38
e.g. (↑'öööA' 'oooB') (2 2⍴⍳4)
Feb 14, 2023 17:38
combining diacritics don't exist just for zalgo of course, but yes
Feb 10, 2023 10:53
I personally think erroring is the sanest default if going for one option; multiple options is also acceptable, but I haven't found myself ever in a situation where I need padding and the prototype/fill element is acceptable
Feb 10, 2023 10:46
you can do 8⍴⍳4 though, which neatly repeats all elements twice; but 5⍴⍳4 is indeed strange. No way to do the former with a ⍬n⍴ though, all you can get is the weird behavior of 5⍴⍳4
Feb 10, 2023 10:42
@xpqz heh, I'd say recycle would be the most surprising behavior. I can see how it makes sense as an extension of regular Reshape, but for a ⍬ 2⍴ specifically it'd always result in putting a column 1 element in column 2, which I don't think would be desired like ever, and it only recycles to a max of less than one row too
Feb 6, 2023 14:41
but it at least folds array literals
Feb 6, 2023 14:39
this would suggest that it doesn't
Feb 5, 2023 16:05
BQN doesn't have operator trains
 

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Mar 2, 2023 13:06
@user I do have an SE APL Orchard←→Matrix bridge that I run locally for myself, but it's not published anywhere and is decently incomplete
 
Jan 28, 2023 00:53
@nathanrogers oK should probably be feasible to use for such a thing; I don't know if it has any docs, but in a couple minutes I put together var env = baseEnv(); tojs(run(parse("2+!10"), env)) just from looking at its source (which can be ran from a js console in johnearnest.github.io/ok/index.html)
Jan 28, 2023 00:44
@nathanrogers do you have any example of a language where, going through FFI, interoperability for GUIs is easy?
Jan 28, 2023 00:36
@dzaima but for the rest of the cases where the external communication is just a tiny part of your program, writing a bit of C to wrap around them, and doing the rest 99% of your program in your language of choice, is a pretty simple option
Jan 28, 2023 00:34
@nathanrogers you're now in the very niche corner of "a significant portion of my program is dealing with events & callbacks in the other language", and I'd say that there's a large chance that no FFI will provide a better experience than just writing everything in the language native to the API
Jan 28, 2023 00:30
@dzaima but if the number of functions they have is not far off from the amount of code your whole program will be, honestly, just write the whole app in the language the library was meant to be used in