« first day (1495 days earlier)      last day (51 days later) » 

2:06 AM
Latest release of Iosevka has full BQN support! Preview here, least confusing download here.
The ordinary monospace version renders some characters like arrows much too large, so the Term width is best.
 
3:01 AM
cool
 
 
3 hours later…
6:09 AM
@Marshall A bit odd that in your table, the first row has font names above the sample, while in the centre and bottom rows, the name is below.
 
7:04 AM
@Marshall does it work with APL as well?
praise B5invis
doublestrucks look weird in iosevka's condensed family
 
RGS
7:16 AM
@Adám I meant to ask if there was a way to override whatever was in that line already, not to add to the current line.
 
 
1 hour later…
8:40 AM
@RGS Doesn't my code do that?
 
9:12 AM
@Adám damn!
if i only knew about it before
this code looks really clean
why isn't monadic dot product supported by the interpreter?
 
CMC: is input a prime tower: codegolf.stackexchange.com/a/210173
 
9:28 AM
for this cmc, however, you can choose which one to be truthy
@user41805 went funner than i thought
 
10:00 AM
Hi guys I am new to APL. I am thinking of settling with J as my main APL dialect of study. What will I be missing from other strains of APL?

Also does J satisfy the all criterion Iverson talked about in "Notation as a tool of thought" ? i.e;

- Ease of expressing constructs arising in problems.
- Suggestivity.
- Ability to subordinate detail.
- Economy.
- Amenability to formal proofs.
 
10:20 AM
@KamilaSzewczyk Not enough call for it, I presume.
 
three keystroke matrix determinant is awesome
 
@M4X_ Welcome. You've found the right place to hang out, then. I think J lacks in suggestivity as it doesn't have APL's glyphs. E.g. flip-upside-down and transpose and mirror ar and and in APL, while they are |. and |: and |."1 in J.
 
@user41805 you can also output with error code
 
@M4X_ Similarly, APL uses traditional mathematical symbols for where J uses <. ~: >. and × ÷ where J uses * %. Maybe the worst break with suggestivity is J's (ab)using [ ] { } as individual built-ins, not as grouping devices.
{ and } are not even of the same syntactic class in J.
 
10:56 AM
Thanks @Adám . Can't one use the ASCII characters (that you mentioned) to appropriately structure suggestivity in J?

My understanding of suggestivity is that you can write APL statements in a way that it can represent equivalent solutions to other problems?

I assume ASCII was simply introduced to make APL more ergonomic (special characters were inconvenient )?
 
11:12 AM
@M4X_ ASCII is very limited. J was planned as a rationalised APL, and the implementers went with ASCII, despite its severe limitations, due to the technological hurdles traditionally involved in enabling APL's glyphs. This was in '90. Ironically, Unicode, which finally provided a solution to APL's encoding problems, was launched in 1991.
@M4X_ But yes, syntactically, J and APL are very alike, so the ability to form ad-hoc DSLs is the same.
 
@Adám This clarified my doubts. thanks
 
ngn
11:45 AM
i never understood what this talk of dsls is about. if anything, apljk actively prevent you from making ad-hoc dsls - they don't allow the user to extend the meaning of the squiggles/digraphs or define new ones.
 
RGS
12:06 PM
@Adám It does, don't mind me -.-
 
@ngn i wouldn't say so
i made a thing which does exactly that yesterday, in 6 lines of APL
 
ngn
@KamilaSzewczyk does what?
 
extends the meaning of functions / allows you to define new glyphs with a functionality
or to remove glyphs
 
ngn
@KamilaSzewczyk in your own impl of apl?
 
Dyalog
 
ngn
12:13 PM
@KamilaSzewczyk something to do with the getter/setter overriding thing that morten showed recently? are you going to show it?
 
 dx←{
     ns←⎕NS ⍬
     ns._Neg←{0=⍵}
     h←{k v←↓⍉2(⊢⍴⍨÷⍨∘≢,⊣)⍺ ⋄ {⍵∊k:⊃v[k⍳⍵] ⋄ ⍵}¨⍵}
     t←'~' '_Neg'
     g←⍺⍺ ⋄ c←↓⎕CR'g'
     s←{{⍵/⍨2∨/0,' '≠⍵}⍵/⍨~+\⍵='⍝'}¨c
     b←↑,/'⋄',⍨¨{⍵/⍨0≠{≢⍵}¨⍵}s
     f←{'}',⍨⍵/⍨1=+\1 ¯1 0['{}'⍳⍵]}b
     e←ns⍎(∊' '(1↓∘,,⍤0){t h ⍵}¨60⌶f)
     0=⎕NC'⍺':e ⍵ ⋄ ⍺ e ⍵
 }
      ({~⍵} dx) 2 3 1 3 0
0 0 0 0 1
doesn't work with tradfns, but tradfns suck either way.
can be easily modified to support trains and execute
 
ngn
@Adám is that^ what you mean by "dsl"?
@KamilaSzewczyk this is an operator that replaces occurences of ~ in the source code.of its operand. i wouldn't say it redefines or extends the ~ primitive.
 
it quacks like a duck..
 
ngn
@KamilaSzewczyk quacks only if you put dx after it
 
yes?
i can't see how is this invalidating my solution
 
12:22 PM
@ngn yes, we need a homoiconic apl
 
ngn
@KamilaSzewczyk ok, let's assume this is a valid dsl. but you can parse the syntax of any programming language in any other (turing-complete) programming language or just do string replacement like you did, so what's apl's advantage with respect to dsls?
@user41805 we have k
 
i should learn k
 
@ngn No.
 
ngn
@Adám what's your definition and how is aplj better at it than other languages?
 
@ngn in APL this was just a few lines
and in JavaScript, you need to first pull a library which parses JS
and then do replacements on the AST
also, my APL repl segfaulted randomly again
but i forgot how to enable aplcore dumping so i guess i don't have much left at that point
 
ngn
12:39 PM
@KamilaSzewczyk do you? js has .replace() too, even if js is a less concise language than apl
 
@ngn well, yes, but that won't work
because you need to parse an expression, like a + b
and then swap it out to myAdd(a, b)
do you see the problem now
 
ngn
@KamilaSzewczyk the problem is that you have to parse?
 
the problem is that JS makes it much harder.
 
@ngn Allowing defining arrays, functions, and operators such that one can write somewhat natural-looking sentences without noisy syntax. E.g.
        except ← ~
           for ← ⊢
            in ← ⊢
multiplication ← ×
         table ← {⍵∘.⍺⍺ ⍵}
         those ← ⊢
         until ← ⊣,↓∘⍳
      (2 until 20) except those in multiplication table for 2 until 20
2 3 5 7 11 13 17 19
 
@Adám that's obviously exaggerated and will never work in practice though
 
12:42 PM
@dzaima Dumbed down example to show what I mean.
 
ngn
@KamilaSzewczyk if a language is well-suited for dsls it wouldn't force you to write parsers in the first place. js (since we've already picked it as an example) allows you to extend the prototypes even of built-in objects. (though it doesn't let you redifine ~ of course)
 
@ngn yes, that's why I personally consider Lisp a good language for DSLs, but I think APL will do too.
 
@ngn but APL with find&replace allows you to trivially define every kind of callable object. in k you can't define custom verbs or adverbs, just as you can't define ~ in JS
 
@KamilaSzewczyk looks like you need 1≤ in place of 1= in f←for {~{⍵}⍵}
 
ngn
@KamilaSzewczyk yes, lisp is a perfect example. apl isn't even homoiconic.
 
12:44 PM
thinking of a homoiconic APL dialect feels weird
@user41805 possibly
 
ngn
@dzaima yes, valid point (i don't think k should be advertised as a dsl-building language)
 
I wouldn't say that APL is good for DSLs, but it's better than many other languages
 
ngn
@Adám is there any difference between "dsl" and "library" then?
 
I don't know. I think of a library more as a packaged collection that serves to enable a certain type of functionality to the APL programmer, while a DSL would be for the end user, who might not even know anything about APL or programming.
 
@Adám you definitely still have to know how APL is evaluated regardless of what DSL is in front of you (assuming you don't have a custom parser, in which case APL isn't any better than any other language)
 
12:52 PM
True, but you might not know of it as "APL", just as the DSL your specific system uses.
 
ngn
that might make it "domain-specific", but what you showed still obeys the syntax and semantics of apl. i would say it is not a separate language.
css is an example of a dsl. it has its own syntax. it serves a specific purpose.
 
well
there's SystemC
which is considered a DSL and built using macros/templates
 
ngn
yeah, languages with macro systems (like c, even though its preprocessor is dumb) and/or good metaprogramming capabilities are better building material for dsls
 
1:12 PM
i wouldn't say the C preprocessor is dumb
yes, it's horrible, and it should be erased from the surface of earth, but you can do cool stuff with it
@ngn isn't the C preprocessor magic the same thing i did with dx before?
 
ngn
@KamilaSzewczyk "dumb" is my technical term for not supporting recursion and hygienic macros
@KamilaSzewczyk if you use the preprocessor, you don't have to do the parsing yourself
 
@ngn then how do you extend the domain of + :)?
 
ngn
@KamilaSzewczyk in c you can't. in c++ something like operator +(..)
 
well, that i know
but we were talking of preprocessor, right?
 
ngn
@KamilaSzewczyk it's too dumb for that :)
 
1:19 PM
yes
@ngn not supporting recursion is ambiguous
due to:
> if any nested replacements encounter the name of the macro being replaced, it is not replaced
 
ngn
@KamilaSzewczyk if i understand correctly, that relies on bugs non-standard behaviour?
"please don't use it" :)
 
@ngn ah it has quote, when you guys say k is a lispy apl i used to think it referred to both being prefix-y, i didn't realise this
 
ngn
1:37 PM
@user41805 when you say "quote", do you mean ' or ` or (quote ..)?
' is "each" (like ¨ in apl). `sym is a symbol (a scalar string, like atoms in lisp). i don't think there's an equivalent to lisp's (quote ..).
 
i kind of mean all of them, so ' or (quote ...) in lisp having ` as its equivalent in k
 
ngn
@user41805 yeah, if you're quoting only a lisp atom
 
by k not having (quote ...), do you mean you can't do `{function} in k? (yeah i noticed it not behaving as expected in your k)
 
ngn
i mean there's no k equivalent to lisp's quote in general
in k the ` is part of the symbol token, so `sym is perceived as a unit
 
so more like lisp ' then?
 
ngn
1:43 PM
yeah
`{function} would mean you're applying ` (the empty symbol) to a function object, which happens to mean "serialize" (at least in k9)
 
ah i see, so there's no way to 'dissect' a function as in lisp? (been a while, but i recall being able to perform list functions on a quoted function (forget the term))
 
ngn
@user41805 "dissect" as in "get the ast"?
 
yes, and manipulate it, like in lisp (looks like i remembered correctly tio.run/…)
 
ngn
@user41805 this varies between k versions - it could be .{func} or !{func}. it returns a list of a few things; among them should be the original src code, the ast, and the bytecode.
@user41805 functions are first-class, so you don't have to do anything special to put them in lists and apply to them the usual primitives
 
in ngn/K !{x+x} is ("{x+x}"
0x5060217f
0x0301020a
,`x
,(::))
what are the two hex numbers? and what's (::)
 
ngn
1:53 PM
@rak1507 it's (src;bytecode;srcmap;localsyms;constants)
 
cool
ah yeah bc my function was so small the bytecode was 8 bytes, so I thought it was a pointer to something
 
ngn
@rak1507 :: is the identity function (verb number 0). i put it there only as a placeholder to prevent the list from squeezing (e.g. if you put only ints in it, it would shrink, and i would no longer be able to assume it's a list of pointers)
 
Ah ok
 
ngn
@ngn oops, i lied there. there's no ast at that stage.
but you can still build it with `p@srcstring ("parse")
 
@ngn i meant like the lisp example in the tio link, so like (cdr '(lambda(x)(+ x x)))
@ngn didn't know about them, but doesn't seem ! and . give a structure that i can manipulate like the above
 
ngn
2:03 PM
@user41805 well, there's no such thing as quoted function in k. it's just.. a function.
@user41805 which k do you use?
 
your webasm one
 
ngn
right, so to build an ast, use `p@"source code". currently that returns some more junk, but it should be obvious where the ast is.
i misspoke earlier when i said the ast should be in .{func}
at the stage when . is called, the compiler has already produced bytecode and thrown away the ast
but as the src code is preserved, you can get it with ${func}, drop the leading { and trailing }, and parse it again with `p@
 
@ngn thanks, that's better
k evangelists should lead with homoiconicity (at least to aplers), i didn't know what i was missing
 
ngn
2:18 PM
k is a non-proselytizing monotheistic religion :)
 
not too sure about non-proselytizing but if you say so
how do I enable boxing by default I can't find it in configuration
 
@rak1507 RIDE or windows IDE? OS?
 
2:33 PM
windows IDE (and on windows)
 
then i don't know. Generally you want to turn it on, and then save the session to the default .dse; @Adám
 
sure I didn't do that before but I will do that
thanks
 
@Adám any reason {2⎕NQ⎕SE'FileWrite'⊣⎕SE⎕WS'File'⍵}'/opt/mdyalog/18.0/64/unicode/default.dse' just annoyingly quitely fails, instead of saying something about not being able to write the file in that directory?
 
3:38 PM
what's the simplest way to make a dfn where it does two completely different things depending on arity?
something like {⍺←value ⋄ ⍺≡value:... ⋄ ...} feels like a hack (and fails if you actually pass value dyadically)
 
@rak1507 {0=⎕NC'⍺':'monadic'⋄'dyadic'}
 
thanks
 
{0::'monadic'⋄'dyadic'⊣⍺} :D
 
lol
when does ⎕NC return a vector with more than 1 element?
 
@rak1507 when given an argument of vectors of strings (e.g. ⎕nc,¨'⍺⍺')
 
3:42 PM
ah
 
though imo it should return a scalar when given a simple vector. ¯\_(ツ)_/¯
 
yeah
 
oh, also a←4 ⋄ ⎕nc⍪'ab'
 
yeah
spotted that
 
wait the term is prime power, not tower, i always get that mixed up
 
3:46 PM
extended: 1≡≢∪⍭⎕
0=1|⊢⍟⍨2⊃∘⍸0=⍳|⊢
 
ngn
@rak1507 domain error
 
⎕IO←1
 
ngn
yes
 
uh
what input?
 
ngn
2,3,4.. (separately)
 
3:56 PM
works for me
what part domain errors?
 
ngn
try 1⍟2
 
that doesn't happen though
 
ngn
ah! lol
i missed the edit
 
oh right yeah I changed it because it worked better with ⎕IO←1
 
ngn
not a sin in golfing. ends justify means :)
 
4:00 PM
can't think of a way to get under 10 bytes
1≡∘≢∘∪2÷/∘∪⍳∨⊢
 
ngn
@rak1507 does it have to be a train?
 
no
 
ngn
1≡≢∪2÷/∪∨∘⍳⍨⎕
 
that as a full program + dfn were both 14 bytes too
oh clever
still not under 10...
 
4:22 PM
@rak1507 you can choose to use erroring as submission result
 
no idea how that helps
 
ngn
4:44 PM
@rak1507 12: 1≠∨/1↓∪∨∘⍳⍨⎕
 
that's nice
 
ngn
@user41805 are we allowed to choose values for true and false? can one of them be fixed and the other arbitrary?
in other words, can i remove the 1≠ :)
 
@ngn sure, go ahead
 
ngn
∨/∨∘⍳⍨~≢ returns 1 for not prime power, and another integer otherwise
 
can you get lower?
 
4:52 PM
this is some hardcore golfing right here!
 
5:39 PM
@dzaima It is shy.
 
@Adám ..why
i'd expect an error, no less, but a shy 1?
 
@dzaima Most ⎕NQs are for their side effect, so the function was made shy (not that I like shyness).
@dzaima 0 for success, 1 for failure. POSIX ftw.
 
6:10 PM
@ngn were you able to find the 7-byter?
 
 
1 hour later…
ngn
7:15 PM
@user41805 i tried but no
 
 
2 hours later…
9:36 PM
Hi all, this may be a silly question, but does anyone know where the full list of experimental features are for Dyalog 18? I thought the multiline one in Conor Hoekstra's latest video was nifty :)
 
9:48 PM
@LukasHermann Depends what you consider experimental.
You could consider anything -related experimental.
@LukasHermann Maybe look at the release notes?
 
@Adám Thanks!!
 

« first day (1495 days earlier)      last day (51 days later) »