« first day (1380 days earlier)      last day (1275 days later) » 

2:30 AM
CMC: Given an expression, deduplicate duplicated parentheses: (4+((((2+1))+3)+5))+((6))(4+(((2+1)+3)+5))+(6)
 
@Adám So, remove any pair of parentheses with another pair just inside them? Are parens assumed to be matched?
 
2:52 AM
@Adám This seems to work, but has to check a lot of things.
The idea is that an opening paren is redundant if the next character is also an open paren, and the character after the next paren at the same uneven depth (which is necessarily closed) is a closing paren. With uneven depth, opening parens have one higher depth than their closing pairs, so that last closing paren will be its pair and the one before the close pairs with the one after the open.
 
3:12 AM
Or I guess you could just take matched pairs with even depths, and find which ones are immediately inside others. That works too.
 
 
4 hours later…
ngn
7:28 AM
@Adám regex allowed?
 
@ngn Of course.
 
ngn
7:50 AM
@Adám 68 bytes: '(\1)'∘{a←'PP([^PQ]*)QQ'⋄((1↓¯1↓a)⎕r⍺(a⎕r⍺⍣≡))⍣≡('PQ',⍵)[⍵⍳⍨'()',⍵]}
 
@ngn Please add backticks to be sure there are no backslashes etc. being taken as markdown.
 
ngn
ok, but backticks usually make it worse
 
How so?
 
@ngn two backticks (on each side) never make it worse, unless your code ends with a backtick, which it probably won't in APL, or starts with a space, which it won't
 
@ngn Doesn't this fail if the input has Ps or Qs?
 
ngn
7:54 AM
@Adám replace P and Q with arbitrary chars that are not allowed in expressions and don't need \ in regexes
 
ngn
8:05 AM
1 byte shorter without regex: {⍵[i~∊r∩r+⊂1 ¯1]⊣⍵{⍺='(':s,⍨←⍵⋄⍺=')':s↓⍨←1⊣r,←⊂⍵,⊃s⋄0}¨i←⍳≢⍵⊣s←r←⍬}
 
ngn
8:19 AM
i missed an easy -1
 
@Adám awful O(n^2) BQN solution, 61 bytes (and the golf of extracting 𝕩/˜ to {…}⊸/ golfs Marshall's to 62)
more golfed Marshall's, 60
 
 
1 hour later…
9:34 AM
@Adám that guided tour you recommended, is it just for dyalog apl? If I'm to do this I'd rather stick to J which seems more alive and is FOSS. Sorry if the question is considered rude in an APL chatroom, consider me as a stranger visiting an unknown land, not knowing the local manners
 
@xificurC I only know Dyalog APL well, so I can't really give a good intro course to other APLs. Yes, J is FOSS, but I wouldn't say it is more alive. The main developer of J now develops Dyalog APL, which is seeing a rapid evolution lately. But don't worry, it isn't rude at all; J is 100% on topic here.
 
@Adám thanks. I was just thinking, if I was ever allowed to scrub something up in an array language at work there's no way I'd get my employer to agree to buying a license. Is there the slightest chance dyalog is getting GPLed as well? If it's the same main developer :)
are the differences between dyalod apl and j significant? I'd hope both to provide the same mind bending experience and that e.g. 80% of the knowledge would be transferable
 
@xificurC These days, you can actually use Dyalog APL for free until you make money off it, and even then there's a threshold, and only after that, the default is 2% of the profit directly made using it, iirc. The main dev of J isn't the main dev at Dyalog. FOSSing Dyalog APL is being considered, but there are various reasons to hesitate.
 
I meant "if the former main J developer is now the main developer of dyalog APL". Should have been more clear. Out of curiosity, what are those reasons, to hesitate?
 
@xificurC The main difference between APL and J is APL's use of single symbolic glyphs, while J uses ASCII only, and often resorts to bi-glyphs or even tri-glyphs. I find it much easier to parse APL, knowing that each symbol is one thing only. Dyalog APL also has more a pleasant function definition experience. However, the J language is somewhat more consistent, having been designed with the lessons from APL. The mind-expansion is probably about the same, and quite transferable.
 
9:50 AM
@Adám I guess I'll give it a spin, if your offer is still open. It'd probably go about slowly, as I'd jump back and forth during my work, if that's OK with you.
 
@xificurC For one, all the people that work at Dyalog live off their Dyalog salary, and Dyalog's income is almost exclusively from licence fees.
@xificurC That's fine. I'm also pretty busy at the moment (I'm presenting at an online conference next week) so I can't spend as much time teaching people as I'd want to. Do you want to begin now?
@xificurC Just to confirm, you want me to introduce you to APL, right?
 
gotta get used to this chat experience :D
 
:56057611 It would ping me with a prefix of my name too.
 
@Adám I'll be off to prepare lunch in a few minutes, but I guess we could at least get a running environment up for me. I'm on an ubuntu 18.04
the executable, editor, keyboard setup or w/e necessary
and to confirm, yes
please
 
@xificurC You can download a full system here but the limited online interpreter is adequate for early exploration.
Enjoy your lunch. Just ping when ready, and I'll get back to you when I can.
 
9:57 AM
@Adám one is expected to type in those glyphs with a mouse? In the online interpreter
 
@xificurC Hovering over each glyph in the Primer tab will show you how to enter it with a keyboard.
 
10:11 AM
@Bubbler thanks. I tried installing the full system, had to restart my machine, it rebound my keys, important ones :) Also, didn't know how to exit the interpreter :)
 
@xificurC )off to exit
and yes, it hijacking the super key is entirely stupid and awful and you're not the first to restart your machine after that
my solution is to clear the file /opt/mdyalog/18.0/64/unicode/aplkeys.sh but that has to be re-done for every install/update
 
@dzaima and if you get rid of those bindings you what, create your own?
 
@xificurC yeah
 
yeah, the super key is quite important, especially if you're runing dwm or other window manager, not a fullblown DE
 
@dzaima setxkbmap -query to get your old setup, and setxkbmap -layout whateverIsTheOldLayout,apl -option grp:switch for altgr-keys (don't have the list of other options for grp rn). Doesn't work at all if you already have multiple layouts
@xificurC yeah. apparently some people at dyalog use it though or something, so we seem to be stuck with this extreme system-breaking stupidity
 
10:17 AM
@dzaima just because they use it doesn't mean it has to be enabled by default
 
@xificurC I highly recommend installing RIDE which includes a language bar and backtick input like the online interpreter.
 
@Adám but it still hijacks the super key
@xificurC eeeeeexactly...... it DEFINITELY DEFINITELY shouldn't be the default.
</n-th occurrence of this rant from me>
 
@xificurC I'm trying so hard to convince my colleagues about that. I'd really appreciate if you could write a short email to support@dyalog.com saying something like "Running Dyalog can lead to data loss because it hijacks the Super key, blocking critical functionality for those that don't have a full desktop environment, and forcing them to reboot their machine."
@dzaima The more emails, the merrier ^ ― hint, hint.
 
10:53 AM
@Marshall Yeah I mean, it's cool - at a certain point might as well be an alphabet rubik's cube tho. Although... now I'm thinking it should be a take on the APL type ball? What you've got here is pretty close to a decent array langs logo for topanswers tho
 
11:14 AM
@Adám OK now I'm thinking of "APL" + the logos of J,K,BQN,Julia(circles),NumPy in the cube
 
@RikedyP That may be more viable, as each logo is likely to fit into a square.
 
@Adám @Marshall honestly the BQN logo is genius
Bit of a stretch in a different direction, but adopting the 4D cube projection is a possibility as well upload.wikimedia.org/wikipedia/en/8/84/4-cube_solved.png
 
11:40 AM
@Adám I can do that, no problem
 
12:09 PM
@Adám I think I've changed my mind and that design by committee (including, combining logos into one logo) is trash. Let's just take the APL wiki grid of circles and be done with it?
 
@RikedyP As a logo for what?
 
@Adám topanswers.xyz/apl
 
@RikedyP Hold on, did we decide the scope?
 
@Adám Well not really, but I figure de facto it's basically the same as the scope of this room no?
 
@RikedyP Doesn't have to be at all. Also, if so, then Julia and NumPy are off-topic.
 
12:13 PM
@Adám Well nobody will come here or there for help with Julia or NumPy. But I do think that comparisons between APLs and Jl/NP are on topic
 
12:32 PM
I have asked for help on numpy here, when I first started learning APL, I was translating numpy to APL, but now more often I'm trying to translate APL to numpy
 
:-D
 
@Adám I don't think it's more alive than Dyalog, but J's been seeing a fair amount of development lately (led by my old high school teacher, Henry Rich!). The big change is a new direct definition syntax (no lexical scoping though; it's just a cover over existing explicit functions), and there are many more in the release notes.
@RikedyP Most of the credit should go to @Razetime.
 
@Marshall I don't quite get how the {{}} syntax can be allowed. {{ is already meaningful code.
And apparently, }} is valid syntax too, though I can't seem to find valid arguments.
 
12:48 PM
@Adám It's a breaking change. See the last section however; {{. or {{: don't trigger it and {{ without a trailing dot or colon would be very rare.
 
@Marshall This seems like ambiguous syntax. A first in J, no?
 
@Adám } is an adverb (monadic operator). I can't imagine ever wanting to apply it twice.
 
Any idea why they didn't use e.g. (.).?
 
@Adám ok, break my brain
 
@xificurC Sorry, can't right now, but I'll get back to you.
 
12:53 PM
@Adám sure
 
@Adám From the announcement, "The importance of DD and the better readability over alternatives such as (. and ). weighed in that difficult decision." It's fully specified so I don't think you can really call it ambiguous, but it's definitely a type of word formation J hasn't seen before.
 
J, readability?
 
@rak1507 Everything is relative…
 
ngn
@Marshall +1. not "ambiguous".
 
ngn
1:21 PM
so, all array languages converged to some form of open-close punctuation to represent lambdas. given the prefix-infix syntax inherited from apl, it would have made more sense to add a pseudo-verb (just like "←" is a pseudo-adverb) that treats the rest of the expression like the body of an anonymous function.
(yes, apl has a problem with diamonds in parens, but that's a separate, more superficial issue)
 
diamonds?
 
ngn
@Razetime i mean (a⋄b) is not valid apl, so you can't have more than one statement in a lambda, like: f←(λ a⋄b)
 
oh the thing
alright
 
@Razetime ``
 
 
1 hour later…
2:47 PM
@RikedyP Some improvements:
 
@Marshall I think we gave up on this idea - sorry
@Marshall Thank you though it looks better
 
@RikedyP Are you going with the APLWiki one? It really doesn't seem right to reuse that.
 
@Marshall Nah currently we're leaning to have in topanswers.xyz/apl as Dyalog to start with - I'm not really sure
 
@RikedyP I can understand, but that would probably keep me off it at least.
 
@Marshall Even if the scope was just APLs and APL -descendents?
@Marshall We are deciding between scope the same as: 1) Array languages 2) APL Orchard (APL-likes J/K/BQN etc.) 3) APL Wiki (from APL's perspective) 4) Dyalog APL
4 seems easiest to manage
 
3:05 PM
@RikedyP Yeah. I felt like the circles were conveying the wiki aspect more than the array aspect (articles stretching off to the horizon) so it seems weird to use it for a non-wiki.
 
@Marshall That logo comes from APLTeam anyway
 
@RikedyP What kind of management tasks are there? I don't have moderation experience but I'd be interested in helping out if I can get a dedicated place to ask BQN questions.
 
@Marshall There is the possibilty of having a topanswers/dyalog topanswers/bqn topanswers/apl topanswers/arraylangs?
 
@RikedyP I know, but it didn't really make sense to me in that context.
@RikedyP Yes, but that also makes it much less likely that anyone would be around to discuss BQN. Isn't that sort of separation better handled by tags?
 
@Marshall Well the main thing is that we're sitting on this great forum in topanswers.xyz/apl, the only thing holding back is deciding "what is the scope?" - we're tempted to just say Dyalog to start because it has TIO integration ready to go and the logo is already there
@Marshall I personally think making it same scope as the Orchard makes sense, but then what icon to go with?
@Marshall Still massively invokes "where is matlab?" "where is octave?" "where is BQN for that matter?" - I still think either 4D cube projection or APL Wiki logo is best we've got so far
 
3:19 PM
@RikedyP I don't think those issues are that big of a deal? It would also be fine to say something like "this forum is focused on Dyalog, but array programming in any language that supports it is on topic".
@RikedyP The 4D cube is pretty cool. I'm not really going to push for my design (it would take a lot of polish to actually look good), but pick the logo based on the scope, not the other way around!
 
@Marshall well that's why I started all this discussion about a logo
 
@Marshall @RikedyP Maybe "This forum is focused on APL, mainly the Dyalog implementation, but array programming in any language, and in particular APL-like languages, is on topic"
 
Technically the rule for a wide scope should be something like (0) any features of direct APL descendents (Matlab probably doesn't count?), or (1) array programming features of any language. The one-sentence summary shouldn't be that complicated though.
 
I just looked up what is BQN, the last commit is very reassuring ;) github.com/mlochbaum/BQN/commit/…
 
@xificurC In case you're wondering, I'm sure I could come up with a list twice that long for either Dyalog or J.
 
3:35 PM
@Marshall That's fine that'll just be in a sticky post at the top. You won't be too put off if the logo happens to be the Dyalog logo?
 
@Marshall I just found the commit message funny. But I'm left wondering, how do all these languages (Dyalog,J,BQN) perform?
 
@RikedyP Not at all. I assume we'd change it anyway if discussion turns out to be mainly about non-Dyalog languages, but that seems unlikely.
 
@Marshall Alrighty - will try and make it public soon as possible then
 
@xificurC Dyalog is generally a lot faster for operations on large arrays, especially if it can use booleans or small integers, since J doesn't have these. My own BQN implementation has completely horrible performance, but dzaima/BQN is all right—I'm guessing a little slower than J for large arrays but I haven't benchmarked. For code that's mainly scalar dzaima/BQN is actually the fastest since it's compiled to bytecode.
 
@Marshall Isn't k/q fast but $$$expensive$$$?
 
3:46 PM
@RikedyP Lots of people say that, but I tend to find on inspection that they don't actually know what they're talking about. Not to say that it's false, just that I haven't seen much hard evidence either way.
 
and how do they compare to more traditional languages like C or Java
 
@xificurC Comparably, I believe
 
forgive the stupid, vague questions, but it's better to have a few anecdotes than nothing
 
@RikedyP Anything but comparably!
 
@Marshall lol
 
ngn
3:48 PM
@Marshall lol. seriously?
 
@ngn Maybe it's the classic problem of benchmarks on specific tasks being used as evidence, when real world usage tends to muddy it up so much as to make the comparison a bit useless?
 
@ngn Do you have benchmarks for me then?
 
@ngn I'm just speculating
@Marshall Well this suggests otherwise
 
ngn
@Marshall do you? why should the burden of proof be on me?
 
@xificurC they're way more easy to write fast code in if all you're doing is vectorizable stuff, but beyond that it's not that pretty
 
3:49 PM
@Marshall Had to make the joke.
 
@ngn the original message literally said "Not to say that it's false, just that I haven't seen much hard evidence either way" and you still "lol"ed at it
 
ngn
@dzaima fud
 
@ngn If you're going to claim k/q are very fast relative to other languages, then yes you need to prove it. That comment wasn't directed at you; I don't remember you making any strong statements like that.
 
@dzaima not that pretty meaning performance or code/syntax?
 
@xificurC all or none of the above, depending on the language and situation
 
3:52 PM
@dzaima This sounds truthy - also note that getting to the point after about a year of using an APL or APL-like you find you have most of the tools to tackle a lot of problems in fun ways (as in buliding your own solution from scratch).
 
ngn
@Marshall i know it's not personally at me, but your comment was ridiculous
 
@ngn Your response was, what is your point?
I was parrotting an oft-stated conjecture about k & q (with 0 personal experience)
 
ngn
@RikedyP k is faster and simpler, without any doubt
 
@ngn So then... this proof that was discussed?
@ngn Not to say you are wrong (I was saying the same thing as I'd heard it)
@ngn For the record - I personally don't care, but I've heard what I said a lot, that k/q are fast in computation but expensive in monies. You're now the one making concrete claims
 
@xificurC If your problem is naturally array-oriented, and you stick to array programming, a well-written Dyalog program can beat a reasonable C or Java program some of the time. The effort to make such a program ranges from trivial to heroic. Somewhat rarely, Dyalog can beat any portable C program on a current compiler because it's able to use vector instructions (they're detected at runtime). It all depends very much on the kind of problem you're solving.
 
ngn
3:57 PM
@RikedyP i'm sorry. i have no incentive to spend time and effort proving it for you. go find out for yourself (if it matters)
 
@ngn +←1 it doesn't
 
ngn
and yes, it's pricey :(
 
@ngn Yeah how does ngn/k do?
@ngn Actually what do you work on mostly these days?
 
ngn
@RikedyP depends on what you want to measure, but in my experience it's almost always slower than the original
but only a little slower, so it makes me proud :)
 
@ngn things going for k in speed: no closures (should be insignificant if there are big arrays, and not be a big penalty even in bad code), smaller binary (should almost never matter either - you won't be using all of the language anyways), no GC (APLs can have that too, and it shouldn't be hard for an impl to almost never use it), and a slightly different primitive set (this i can't comment much about; including no high-rank arrays in this point for simplicity). anything i'm missing?
 
4:06 PM
@Marshall This sort of goes without saying among APL users, but I should point out that code that doesn't use arrays effectively will be very slow in Dyalog and J: certainly worse than Python or Lisp. dzaima/BQN is somewhat better because of the compiler, but I doubt it beats those languages.
 
how do I get non-overlapping windows of a matrix?
 
ngn
@dzaima i think most importantly the attitude to engineering is different. everything is simpler and smaller in k compared to apl/j. speed improvements come as a side effect. what you mentioned are instances of how this attitude is applied.
 
@Marshall how should I interpret the part "code that doesn't use arrays effectively"? I get that some problems are naturally fit for arrays and that some can be converted to them, but I'm not sure what are you implying, that badly written APL code will be slow or that there are problems that APL will be slow with, like algos or idk
 
ngn
@xificurC aka "loopy code" :)
 
@ngn is this what you're talking about? bitbucket.org/ngn/k/src/master/readme.txt
which k is that? :)
 
ngn
4:14 PM
@xificurC yes, it's my re-implementation of k5 (or k6)
 
@ngn what is loopy code and is it a fit or not? I don't speak the language of this tribe!
@ngn very cool! I've only seen kona until now
 
ngn
@xificurC apl/j/k are great at doing things like 1 2 3+4 5 6, in which operations can be vectorized. in a conventional prog lang you would write a loop that iterates through the elements one by one.
a clever c compiler, for instance, might notice the opportunity for vectorization and emit appropriate code
the apl interpreter doesn't need to be that clever, as the arrays are ingrained in the language
and it has more opportunities to do things in bulk
but sometimes people who come to apl write code as if it's c/java/.. - they use loops, and thus take away the interpreter's ability to optimize the code
there are also certain classes of problems that can't be solved well with array programming - loopiness is inherent in them
 
@ngn thanks, I'll try to remember that "loopy code" is pejorative
@ngn, how does one learn k6?
 
@ngn that "attitude" you're speaking of shouldn't be exclusive to k. And I still don't agree that simplicity and brevity is a way to get performance (other than by either choosing to complete less, in which case it's not a fair comparison, or thinking more about how to write something definitely, which should be done regardless).
 
ngn
@xificurC for learning i usually recommend github.com/johnearnest/oK, it has a great manual and online demos
 
4:23 PM
@Razetime If you're using then give the right operand a second row identical to the first row.
 
cool
 
@Adám shouldn't you be encouraging understanding instead of copy-pasting though?
 
ngn
@xificurC unfortunately k5-6 is now abandoned. i say unfortunately because that was my favourite line of dialects. arthur whitney (the author of k) moved on to working on shakti (aka k9, see shakti.com) in which he made many changes.
 
@dzaima APLcart's purpose isn't to teach APL, though with understanding of APL's syntax, and the ability to look up the meaning of each symbol, it is fairly easy to pick out what the code does, if not why.
 
@ngn you can keep carrying the torch :) Are you dissatisfied with shakti?
 
ngn
4:30 PM
@xificurC so, if you're looking for something that is used a lot in finance now - you should study the previous version, k4 (which comes with q). if your horizon is like more than a few years - you should keep an eye on k9 (shakti).
 
@Adám as it is right now, i'd say it's often worse than just extending dfns with all its entries - they are often unreadable because of the trainification, and, unless you actually name each thing you copy, you don't have any reference of what it's supposed to be either
 
ngn
@xificurC dissatisfied - no. i think shakti has every chance to beat its predecessors in terms of performance and popularity. i just liked the previous syntax and set of primitives slightly better.. it might be some cognitive bias. also, shakti is under development, so things can change.
 
@Adám what exactly does this mean?
 
        {⊂⍵}⌺(2 2⍴2)⊢4 6⍴⎕A
┌──┬──┬──┐
│AB│CD│EF│
│GH│IJ│KL│
├──┼──┼──┤
│MN│OP│QR│
│ST│UV│WX│
└──┴──┴──┘
 
oh ok
 
4:38 PM
However, watch out for sizes larger than 2×2 as begins in the corner, so you may have to make adjustments to the matrix before and after cutting it.
 
wait it both pads with spaces on one side and cuts away on the other?!?!>?!
 
@dzaima Yes, hence my dismay with it, and my various proposals to amend it.
 
ngn
@dzaima i have never seen anyone/anything go as far as k in minimalism
 
@ngn how about you writing APL?
 
ngn
@dzaima ngn/apl? you know, that was my first attempt and of course not minimal in any way. ngn/k is much closer :)
 
4:42 PM
@ngn i meant as in writing APL code, not an implementation
 
ngn
@dzaima golfing?
 
How do I make a multiline string literal?
 
@Razetime you don't
 
ngn
@Razetime char matrix? or char vector with ([]ucs 10)-s?
 
ok, just using ⎕UCS 10
char vector
 
4:45 PM
@ngn or anything else you've done with APL. k shouldn't have much of an advantage to APL if one already knows the ways of k attitude
 
@Razetime If I need a lot, I tend to define a helper N←{⍺,(⎕UCS 10),⍵} so I can write 'abc'N'defg'N'ghi'N''
 
ngn
@dzaima but the apl interpreter wasn't written with such care. it's nowhere near. so, even when you write tight apl code (language issues aside), you're still at a disadvantage.
 
@ngn i thought i listed most of the language advantages in this list though? surely there's not much more an interpreter could do differently enough to actually give an observable performance boost
 
ngn
@dzaima this list? those are big issues. of course there are many smaller ones. otoh: for instance, the direction of reductions and scans
 
@ngn (yep, wrong link) scans are just an obvious mistake (among the other obvious primitive-level mistakes - singletons, axis syntax, etc), not an inherent thing to APL (see dzaima/APL). And scan is approximately the only one that meaningfully can affect performance (and when it does, it's obvious)
 
ngn
5:14 PM
@dzaima another one: iota vec vs k's odometer (now removed from k9)
 
ngn
:D cool
it looks strange in io 1
 
@dzaima never occurred to me that it's somewhat like k's !
(if you're somewhat concerned about another primitive changing quad, it's a better alternative to having separate branches for each value, and i definitely wanted to keep both around for a while until i could decide on one (which i still haven't))
 
 
3 hours later…
7:56 PM
@ngn 10010b doesn't work in ngn/k, oK lists it as a boolean list
 
ngn
@xificurC right, they aren't 100% identical. mine doesn't have bit booleans (it might later)
 
@ngn this, {$[x;(x-1)o(y,2**|y);y]}[3;2], w/e it should do, doesn't either
 
ngn
@xificurC is that an example from oK?
 
@ngn, yes, with an explanation
> The variable o can be used as an infix operator within function definitions:
 
ngn
oh.. i know what it is. "o" is treated as a verb in oK, like in the original k
 
8:04 PM
this did something {(o;o)}[] (another example)
ascii art bird
 
ngn
"o" means "the function i'm currently in", like down-triangle in apl. in ngn/k i treat it as an ordinary identifier (deliberate choice), so it can't have a left argument.
@xificurC did you already know some k?
 
@ngn no, I went through some tutorial once, using some k I don't remember. It was an html page with plaintext. Not sure which k version either :) Was a while ago
I also read like half of the J primer twice in my life, didn't stick though
 
@xificurC Quick intro to APL now?
 
ngn
@xificurC i can't offer professional lessons like adam, but ofc i'd be happy to answer any questions if you have any. there's also a dedicated k room (less active though)
 
@ngn How do you make a living these days?
 
8:11 PM
hi @Adám, I'm leaving in like 5 minutes, sorry. Tomorrow? I'll be around from 9am (it's 9pm now)
 
@xificurC Probably best to wait until mid next week then, since I'm not really supposed to work tomorrow, though I'm still very busy preparing for my presentation.
Sorry to disappoint. I'm usually much more available.
 
@Adám OK, no problem, I'm patient
@ngn thanks, I'll play around and surely have some questions
 
ngn
@Adám rare short projects, savings, thrift
 
This might be a bit of a taboo question but talking of making a living, where is the money in array languages? I like the idea of trying using one for actual real life software, but at least to me it doesn't look like there are that many options, outside of using kdb
 
@ngn That'll only buy you so much chocolate and wine… We have this thing called RIDE that could use some tender love and care by a JavaScript wizard, but I guess you're not interested.
@rak1507 Not taboo at all. I'm not sure what you mean by a lack of options. Money is certainly made using APL and other array languages.
 
8:17 PM
javascript, isn't that a forbidden word here? :)
 
Maybe I've just been looking in the wrong places, do you know of any companies that use APL and other languages to get an idea of what sort of work is done with those languages professionally?
 
ngn
@Adám haha, i'd help, but my laptop is broken right now
 
@rak1507 Always remember to check APL Wiki :-)
 
ngn
(i'm using a very slow 32bit netbook atm)
 
Thanks @Adám
 
ngn
8:24 PM
@xificurC right tool for the job :)
 
@rak1507 A few significant examples are not on those lists. While a couple, I don't have permission to mention, among those that I can mention are the European Commision's use for economic statistics, and then there's SimCorp, whose main product, Dimension, is simply a Dyalog APL application (well, the back end is Dyalog APL; they now use a C# frontend).
 
Wow, that's pretty cool
 
@xificurC Not at all, especially not when used to implement an APL or an interface to APL. I use JS frequently (doesn't mean I like it, though), both privately and for Dyalog. E.g. APLcart is entirely written in JavaScript, and our next version of TryAPL uses a pure client-side JS frontend too.
 
the end user doesn't really care what's running in the background as long as it fulfills the desired goals. Nevertheless all tools need some UI, at least a command line one. And when one moves from programs to systems one needs to interface with other software, which nowadays mostly means http+json and databases, at least in my line of work
 
ooh new tryapl
 
8:34 PM
@xificurC Right, so we have a tool called HttpCommand, and a JSON/REST server (Jarvis), plus built-in conversion of arrays and objects to/from JSON: ⋄ ⎕JSON 'abc' (⍳4)
 
@Adám ["abc",[1,2,3,4]]
 
@Adám just ping me next week when you have time and we can begin, whenever suits you
 
OK, will do. Back to PowerPoint/APL Wiki I go…
 
@ngn {x*x}5 returns 25, {x*y}5 6 returns {x*y}[5 6]. Another example from oK that doesn't work is
> (*<2*) / monadic, equivalent to {*<2*x}
 
ngn
@xificurC are you missing a ";" between 5 and 6?
 
8:39 PM
{x*y}5;6 returns 6, I expected 30
ah, {x*y}[5;6], hmm
not sure what (*<2*) is supposed to mean
 
ngn
it's either {x*y}[5;6] or {x*y}/5 6. i'll explain in a mo.
@xificurC btw, i have an online interpreter: ngn.bitbucket.io/k/#cJ78qmFFa4Eq5ye/KphRtbuWA
 
RGS
@xificurC I am no Adám, but I can have a go at introducing you to APL tomorrow, if @Adám gives me a +1
 
+←1
 
ngn
@xificurC ; is the universal separator. in (a;b) it separates list items. in f[a;b] it separates args or a[i;j] indices. in {a;b} it separates statements
 
@ngn Ooh, that's news to me. Adding to APL Wiki…
 
ngn
8:45 PM
@Adám the advantage of having a small interpreter :) i can compile it all to wasm and put it in a static web page, and it still loads fast
@xificurC where did you see that? a sequence of tokens that ends in a verb is usually composition/projection, e.g. (1+2*) is a function like {1+2*x}
 
@ngn While the current article may be as terse as you like it, feel free to embellish :-)
 
ngn
@Adám i like it that way :) let the software speak for itself
 
Does coding in array languages influence the way you code in non array languages, particularly low level ones like C? I imagine it would be pretty hard to code in a similar style in such a low level language but does it have any influence?
 
RGS
@rak1507 For me (and I do little to no code in low level langs like C), the main influence APL has had is in the way I think about solutions.
You imagine algorithms and solutions in a different way, even if you can't code them directly like you would in APL.
 
@rak1507 It certainly influences my JS. I tend to write in a heavily array oriented concatenative style.
 
RGS
8:55 PM
And the fact that you can now imagine different solutions gives you a wider range of options to consider when you are actually about to write code... Which should help you write better solutions, if you give enough thought to what road to go down
 
ngn
@rak1507 yes
 
Cool, I know writing APL has influenced my code in other high level languages but I didn't know if it would translate to stuff like C
 
@ngn at oK manual
@rak1507 look at the source code of these interpreters :)
 
They're all so unreadable to me I would have no idea what it was doing
 
@RGS alright, what timezone are you? I'm CET (2200 here)
 
RGS
9:02 PM
@xificurC 2100 here, so just show up tomorrow when you feel like it, I'll be lurking around
 
@rak1507 just like APL :)
 
haha
 
@rak1507 See this.
 
ngn
@xificurC you've probably figured it out already: 5 6 is a single object in k (and apl), so the dyadic function {x*y} gets only one argument
 
@Adám thanks
 
ngn
9:04 PM
@xificurC arguments are usually passed with square brackets: f[x;y]
 
@ngn yep, the other thing I don't grok yet
 
ngn
f x without brackets is equivalent to a single-argument call f[x]
when you pass fewer args than required, a "projection" is formed (aka partially applied function, aka "currying")
so the {x*y}[5 6] you saw in the output was such a projection
one of the most beautiful things in k is the unification between function application, array indexing, and dictionary lookup - they all share the same syntax: f[x;y] - function application. a[i;j] - array indexing. d[k] - dictionary lookup
 
@xificurC If you're in the mood for a primer marathon, I'd also be interested in what you have to say about the two (fairly long) tutorials I've made for BQN so far. Don't interrupt your K readings for it of course.
 
ngn
@xificurC what arg did you use for (*<2*)?
monadic < is "sorting-ascending permutation" (called "grade up" in apl or sometimes just "up" in k), so its argument should be a list
 
9:25 PM
> inputs to modifiers are called operands because modificands is just too horrible
Why not call them mods? Like you apply a mod to a game to make it behave differently.
 
@Adám That sounds a lot more like a modifier itself than a modifier's input.
Operand isn't that bad; J has the same mismatch.
 
Well, there's also a mismatch between function and argument. Function's should be called orators, no? ;-)
 
@Adám "mods" feels like something that can keep getting applied, whereas adding an operand to a modifier changes its type. ( could be called mod though, but that's unrelated to BQN)
 
I have to say BQN's symbols are very nice and consistent, it seems really well designed overall
 
@Adám i'd also say making the names too "linked" without clear instantaneous separation would probably lead to a lot of confusion
 
9:32 PM
@Adám "An orator must have subjects for its arguments" is a reasonable thing to say in English! Only problem is understanding it brings you no understanding of BQN.
(I did see the ;-) but chose to ignore it.)
 
@Marshall ?
@Marshall They're very nice, imo.
 
@Adám Catch an error, like J's ::. It's supported in dzaima/BQN, but not my BQN. I am still pondering if there is a good way to allow it to access the error message, or if there should be block-level syntax for it instead of a modifier.
 
@Marshall Ah, so it is a
 
9:47 PM
@Adám Yes, I used the triangle for some sort of vague hazard-ish connotations.
 
Makes perfect sense.
@Marshall How about exposing an error object as the local name 𝕖 to it?
 
@Adám That'd mean an extra forced variable slot on every function.
 
@dzaima No, it'd only be there for the right operand of
 
@Adám Then 𝕖 would have to work very differently from other special names. Either it's some kind of global or it just gets teleported into block functions somehow (and does it teleport into deferred block modifiers?).
 
@Adám would F←{𝕖} ⋄ G⎊F be invalid then?
 
9:53 PM
How is ⎊ used in context?
 
@dzaima Yes.
@rak1507 Like {⍺←⊢ ⋄ 0::⍺ ⍵⍵ ⍵ ⋄ ⍺ ⍺⍺ ⍵} in Dyalog APL.
 
@Adám so is now not a 2-modifier, but a completely separate syntactical structure?
 
@dzaima Why?
 
@Adám because ⊢⎊{𝕖} behaves differently at compile-time from ⊢○{𝕖}
 
@dzaima Oh. I didn't think about compilation.
 
9:55 PM
@rak1507 Example from the markdown processor. The left operand gets the result of an expression; the right just says to use the string "ERROR" if that fails (it is evaluated on the original arguments, but since it's an array it acts as a constant function).
 
@Adám well, it behaves differently in the runtime too, there's nowhere where it is just a regular 2-modifier
 
Ah yes, I should have written {⍺←⊢ ⋄ 0::⍺(⍵⍵⊣⊢)⍵ ⋄ ⍺(⍺⍺⊣⊢)⍵}
 
10:26 PM
@dzaima Do you know when you added the (a ⋄ b) vector notation and the [a ⋄ b] major cell notation to dzaima/apl?
 
@Adám around here
@dzaima (yay)
 
@dzaima Hm, TIO's version has (a ⋄ b) but not [a ⋄ b].
 
@Adám yeah, i had (a ⋄ b) for a lot longer. note that (1 2⋄)≡1 2 in the TIO version
 
@dzaima Ah, ok, then it is safe to say that you added the proposed array notation (except forcing square brackets' major cells to rank≥1) in the spring of 2020.
 
@Adám yeah
@dzaima huh
 
10:46 PM
\○/
 
11:34 PM
0
Q: How to switch APL documents in Alexa without returning a new document?

giobirkelundWhen developing my Alexa skill, Each time I want to change user's screen in my skill (using APL), I return a new APL document. However, this is slow because it must load the document each time. Is there a better way to do this instead of returning a new document each time? I have found some info ...

 

« first day (1380 days earlier)      last day (1275 days later) »