« first day (1612 days earlier)      last day (1035 days later) » 

12:49 AM
idea: golfing language that's just an APL transpilation layer - using jelly chain structure, have two copies of each primitive function in monadic and dyadic form and that way you avoid the need for brackets or sub-dfns by making it more truly tacit :p
since arity depends on context / position within trains and thus you need brackets or use of composition to change the structure to get the arity you want (IIRC)
 
if you're changing syntax of monadic vs dyadic behavior, it'd have to be more than transpilation
but yeah, i've thought about having an APL-like golflang with separated monadic & dyadic cases, i just have no clue if that is what Jelly already is (or what things there are to learn from it)
 
well, Jelly chain structure is totally different from APL trains (from what I can tell) and the built-ins are more golf oriented ofc
but yeah by transpilation i mean like, you'd just parse the code and then just convert to equivalently working APL code
 
i guess that could work, but scoping probably becomes a mess
(though i guess you don't really use variables in golfing)
 
true. although jelly doesn't really have variables so you wouldn't need to deal with that i think
the inverse would be very annoying because of that but going from a jelly-like thing into APL should work without needing to worry too much about that, at least AFAICT
 
1:18 AM
Some of the things in Jelly that might interfere with the transpilation are the register and very few (just one? or more?) atoms that modify the argument in place. We can simply avoid them in a new lang I guess
 
yeah. the register is quite uncommon and is typically only used in weird situations to save a byte or two and can just be done without it
i think atoms that modify the argument themselves are just head/tail? not sure, but yeah, it really wouldn't be much of an issue for them to have no side effects, TBH
 
 
4 hours later…
5:45 AM
@RGS Not 2): Try it online!
@hyper-neutrino The tree-view is enabled by default on TryAPL: Try it!
 
oh. nice :D
 
@hyper-neutrino ⎕←2-×⎕NC'⍺' gives 1 when the function is called monadically, and 2 when it is called dyadically. Try it online!
 
@Adám 3
 
Haha, very funny.
 
5:53 AM
(And 3 when makes no sense.)
 
@Adám oh, that's cool
 
See also APLcart
 
oh, I see
so from randomly testing i see ⎕NC'x' seems to give 0 if undefined, 2 for a value, and 3 for a function
 
You do know we have ⋄]help ⎕NC, right?
 
5:57 AM
oh yeah
probably makes more sense than throwing random things at it to determine via experimentation
 
@hyper-neutrino The tc operator from the dfns workspace might be of interest too: Try it online!
 
ooh, this is cool, thanks.
wait you can just do ⎕←--- without quotes?
 
@hyper-neutrino
┌─┴─┐
⊢ ┌─┼─┐
  - - -
 
... oh wait that's what that means
 
How come there's at the end
 
6:09 AM
⎕←(---)
 
@hyper-neutrino
┌─┴─┐
⊢ ┌─┼─┐
  - - -
 
¯\_(ツ)_/¯
 
@Bubbler The ⎕← gets translated to to coerce shy values (usually assignments) since ⎕← is otherwise prohibited.
 
oh
⋄---
 
@hyper-neutrino
┌─┼─┐
- - -
 
6:15 AM
okay
 
However, not I think about it, it probably isn't really necessary.
 
⎕←----
 
@Bubbler
┌─┼───┐
⊢ - ┌─┼─┐
    - - -
 
And this is totally wrong
 
oh, huh..
why did i stop stripping these agian? was it to make ⎕←a←3 work?
 
6:16 AM
@hyper-neutrino 3
 
@hyper-neutrino Yes. The problem is on my end. I'll have a look at it.
 
ah, alright :)
 
@RGS Guards, error guards, and literals.
 
6:54 AM
@Bubbler Fixed: ⎕←----
 
@Adám
┌─┼───┐
⊢ - ┌─┼─┐
    - - -
 
No, I mean, will be fixed in a min.
⎕←----
 
@Adám
┌─┴─┐
- ┌─┼─┐
  - - -
 
@Bubbler @hyper-neutrino Fixed ^
 
ooh, nice :D
 
6:58 AM
You can even see my change on GitHub.
 
ah. unfortunately i do not really understand :p hopefully eventually
 
@hyper-neutrino Quite simple, really: Down on line 103/104, 1 means "respect shyness", while 0 means "ignore shyness". Now, up at line 26, I remember if the value is shy (i.e. it does not begin with ⎕←) before I strip the ⎕← away.
 
I don't think I really understand shyness - i'm looking at aplwiki.com/wiki/Defined_function_(traditional)#Shyness
 
@hyper-neutrino I disagree - while the help will definitely give you the answer, throwing random things is perfectly valid way of learning and I think you're less likely to forget if you've "discovered" something for yourself than if you just read it (not that remembering the nameclass numbers is particularly important)
@hyper-neutrino Most functions will print their result in the session even if you didn't ask for it (that is, a ⎕← or "print" function is not required) unless the function returns a shy result (or no result)
 
7:14 AM
@RikedyP well, the thing is when i did ⎕←⎕NC'⍴' i got ¯1 and I thought that meant "primitive" but looking at the page that's not actually what it means
 
@hyper-neutrino ¯1
 
so i guess a bit of both is needed - experimentation to play around and looking at the actual docs to make sure i'm not misunderstanding :p
 
@hyper-neutrino That sounds like the way to go :P
 
Agreed.
@hyper-neutrino More experimentation to confirm could also be needed. E.g. if you tried $ and empty string and space etc. you'd probably conclude that it means "invalid".
 
RGS
@Adám yeah that doesn't leave much room to work with :P I can only get it to work from ¯1 to ¯1+2*15 or from -2*15 to 1...
 
7:17 AM
Want my solution?
 
@RikedyP ah, i see - thanks. so how would i define a shy func for example? like say i wanted {+/÷≢⍵} to be shy
 
RGS
Not yet, I'm going for a walk and I'll think about it while I'm outside. Walking gets my creativity to flow.
 
tried doing {a←+/÷≢⍵} and it does what i want but is probably wrong
 
RGS
@hyper-neutrino nah nah, that's it.
 
@Adám that's also true - i didn't really put enough things into it to get a meaningful result yet
 
RGS
 
if you want letters variable names untouched you can also assign to _
 
oh so that is just how you do it? lol okay
 
huh. okay, thanks. was worried it was a hacky workaround mostly, lol
 
CMC: make a dfn shy without affecting any variable names.
 
RGS
7:21 AM
@RGS seems I'm missing some words on shy tradfns
 
(Off-hand, I can think of two major approaches.)
 
i don't suppose {''⊣⍵} is a real answer? :p
oh wait no it still outputs a blank line lol
 
0 0⍴… is also not an answer.
 
{{}result} ?
 
oh i think i remember seeing that somewhere
 
7:22 AM
@Razetime No, that's "no result".
 
in the game of life video, i think?
 
ah well
 
Is it the same but the inner dfn is shy using assignment?
 
"Shy" means that it doesn't display, but if you try to use the value, it is still there.
 
⎕←{{_←⍵}⍵}3
 
7:23 AM
@RikedyP 3
 
@RikedyP Ah, that's a 3rd approach. Very nice!
 
dzaima's APL always returns the last line unless is prefixed
 
I feel betrayed

⎕←'Good bot'
 
lol
ironic
 
⎕←'Good bot'
 
7:24 AM
@Razetime Good bot
 
@hyper-neutrino Could the bot detect edits?
 
⎕←'⎕←''yes i made sure to avoid this'''
 
@hyper-neutrino ⎕←'yes i made sure to avoid this'
 
@Adám i have never worked with that in the past but i could try
 
It'd be kind of cool if it'd edit its own response when you edit your message.
 
7:26 AM
@RikedyP you can't reply with multiline code blocks, and every line in a multiline code block must be code for the whole thing to become a block
 
It'd also need to scan for edits to other messages that it hadn't reacted to before.
 
back to the sandbox i go :D
 
7:52 AM
@hyper-neutrino OK, fixed.
 
ooh, very nice thanks :D
 
 
2 hours later…
10:07 AM
@kimmolinna Seen your tweet. Also thanks for the ClickHouse instructions which were forwarded to me. Are you using APL for processing and then a combination R stuff and Vega for presentation?
 
 
1 hour later…
11:16 AM
@RGS Oh yeah, mine too will only work in a specific range, but slightly different: negative anything, to positive 2*15 less 1.
 
11:41 AM
@PaulMansour Mine too.
 
@Adám Do you count the diamonds as bytes?
 
RGS
@PaulMansour right, but that's a decent solution. I'm essentially saying I could only implement half of it, and the other half returns the opposite result
 
12:01 PM
@PaulMansour Yes, but not f←, just from and including { until and including }
 
@Adám I can't figure out how you get 5 fewer bytes!
 
@PaulMansour Let me know when you want me to reveal mine.
 
@Adám Anytime
 
@PaulMansour Try it online!
 
@Adám Aha, I had almost the same, but I used two error guards where you used one, and used an 11 rather than a 0 for the first error guard.
Never occured to me to combine the two consecutive guards.
 
12:15 PM
@PaulMansour Nice golf; my 11 can be 0 for only 19 bytes. Try it online!
 
@Adám Nice!
 
12:27 PM
CMP: Is this bookmarklet useful?
javascript:((()=>{with(new XMLHttpRequest){open(`POST`,`tryapl.org/Exec`);setRequestHeader(`Content-Type`,`application/json;charset=utf-8`);send(JSON.stringify([0,0,0,prompt()]));onload=(_=>alert(eval(responseText)[3].join`\n`+`\n`))}})())
If you create a bookmark named "⍎" then, on any website, you can click in your bookmarks bar pop up an input field. Enter an APL expression, and you'll get an alert with the result.
 
to me personally, it wouldn't be, I always have a session open anyway, but in general it seems cool
 
It's good that those instructions has been useful. I had almost one year layoffs so I had time to test different kind of things.
I'm using data.table in R as a database. I have done an interface for R in Dyalog. It's using Rserve binary server for data transfer between r and Dyalog. In Dyalog I use conga library for connection. The DyalogAPL is a swiss knife for me. I use it for formating a proper CSV-files, creating vl/JSON-files for vega-lite etc.
JupyterLab is a tool for presentations for me. I can easily show scripts and graphs in a same place. It's useful in CLA negotations because the
 
12:47 PM
@Adám oh, nice. Haven't seen that. Thanks! I'll bookmark this page.
@Razetime I downloaded Mastering Dyalog APL and read the index. It's a thick book and I just wanted something I could read like on a weekend. So that's why I started reading Learning APL with APLX. Although, I think Mastering Dyalog APL is really nice to get a deep dive into the language. I definitely will read it.
 
1:18 PM
Except for joining on newlines, I've written my first APL fizzbuzz!
(⊃⍪⌿){(⍵,,/(0=3 5|⍵)/'Fizz' 'Buzz')[1+⌈/(0=3 5|⍵)]}¨⍳100
It's horribly long and probably overly messy, but I'm very proud of it ;)
 
@AndyAquino nice to know!
 
@lyxal Razetime got it joined on newlines
↑⍕¨(⊃⍪⌿){(⍵,,/(0=3 5|⍵)/'Fizz' 'Buzz')[1+⌈/(0=3 5|⍵)]}¨⍳100
very cool
 
protip: when using /(reduce) on an array, you usually need a before it since a lot of the time it returns a boxed result
      ⍪{⊃(⍵,,/(0=3 5|⍵)/'Fizz' 'Buzz')[1+⌈/(0=3 5|⍵)]}¨⍳100
┌────────┐
│1       │
├────────┤
│2       │
├────────┤
│Fizz    │
├────────┤
│4       │
├────────┤
│Buzz    │
├────────┤
│Fizz    │
├────────┤
│7       │
├────────┤
│8       │
├────────┤
│Fizz    │
├────────┤
│Buzz    │
├────────┤
│11      │
├────────┤
│Fizz    │
├────────┤
│13      │
├────────┤
│14      │
├────────┤
│FizzBuzz│
├────────┤
│16      │
├────────┤
│17      │
├────────┤
│Fizz    │
├────────┤
│19      │
├────────┤
│Buzz    │
 
protip: when joining strings into a simple string, just use monadic
@lyxal Congratulations, and welcome to the cult.
 
@Adám are there any joining benefits? :p
 
1:29 PM
Other than wielding the awesome power of array manipulation? Well, one more thing to drive away sleep…
 
      ⍪{⊃(⍵,∊x/'Fizz' 'Buzz')[1+⌈/x←0=3 5|⍵]}¨⍳100
some improvements
 
@Razetime Since you have there anyway, why not just use that to pick with?
 
@Adám This used to be significantly slower.
 
@PaulMansour What did?
 
@Adám super ravel vs disclose of cat reduce.
 
1:33 PM
⍪{(⍵,,/x/'Fizz' 'Buzz')⊃⍨1+⌈/x←0=3 5|⍵}¨⍳100
 
@PaulMansour I think special-cased, just like ,/
 
Could be now. But, regardless of speed, I think ∊ can cover up a lot of coding errors, that can bite you somewhere else. A lot of people use it because they have no idea why some of the items in the array are simple and some are not.
Obviously it does have its uses though.
 
@PaulMansour Agreed. What should have been instead is apl.wiki/Raze.
 
@Adám Ah, interesting.
@Adám It appears ∊ is now faster than ,/. I vaguely remember Roger discussing this a few years ago. He must have done something about it!
 
:-)
 
1:47 PM
@PaulMansour Probably my stackless traversal changes, or some later tweaks.
 
RGS
2:04 PM
@Adám ahhhhhhhhhhhhhhhh clever
 
@Marshall Ah cool.
 
 
3 hours later…
RGS
5:34 PM
Can anyone help me with this? I created a link to a folder that didn't exist, and it didn't complain
(I assumed the folder would be created for me)
Then I created a function, the function was fixed, but it wasn't saved to the filesystem :P
oh nvm
I can't type paths
 
5:52 PM
I had a go at implementing the Knuth-Morris-Pratt substring search - or at least the prefix calculation (one of the Rosalind problems). I can't see an array way. Is there one? brilliant.org/wiki/knuth-morris-pratt-algorithm
However:
      cmpx 'prefix d' 'pfx d'
┌→───────────────────────────────────────────────────────────────────┐
↓  prefix d → 2.1E¯1 |    0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕                               │
│  pfx d    → 9.2E¯1 | +341% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕│
└────────────────────────────────────────────────────────────────────┘
The tradfn destroys the dfn.
This makes me sad.
 
6:06 PM
@xpqz does this work? avoids the 1↓
 
      cmpx 'prefix d' 'pfx d'
┌→─────────────────────────────────────────────────────────────────┐
↓  prefix d → 2.3E¯1 |  0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕│
│  pfx d    → 2.3E¯1 | -1% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕│
└──────────────────────────────────────────────────────────────────┘
!!!
 
yay
 
@dzaima So dropping the head of the list is the expensive op.
 
@xpqz yeah, O(n)
(but of course with a very low constant factor because APL)
 
Dropping the last object avoids the re-alloc?
Maybe?
 
6:11 PM
if the argument has refcount 1, it should, but i don't know if dfns are smart enough to recognize the last use of
@dzaima (fwiw, in CBQN (and J too I believe?) 1↓ is an O(1) operation, as slices of arrays are a core part of the array model)
 
Note to self: APL isn't Scheme.
 
@xpqz who'd've known
 
:D
Anyway -- thanks; I'll try to remember that take-head-recurse-tail requires a bit of care.
 
(trying to directly port to BQN is going awfully, with all the conditionals. maybe i should just look at what it's actually doing and go by that)
 
@dzaima Here's a c++ version that's pretty clear: gist.github.com/xpqz/461d6a1564ab4e9be69374e665fa1031
(not one of mine...)
 
6:23 PM
no tail call recursion probably means it won't work much anyways :/
 
RGS
KMP is such a lovely algorithm
First time I learned about it I was 🤯
 
It really is a masterpiece.
 
what argument were you testing with? i think i got a working BQN solution
 
Here's a short one for correctness:
      pfx ⎕←s
CAGCATGGTATCACAGCAGAG
0 0 0 1 2 0 0 0 0 0 0 1 2 1 2 3 4 5 3 0 0
The one I used for timing is very long.
 
@xpqz yep, gives ⟨ 0 0 0 1 2 0 0 0 0 0 0 1 2 0 0 0 1 2 3 0 0 ⟩
oh wait, that's wrong
 
ok fixed, gives the correct thing now
 
You need to drop the first line, and join the others
 
seems to take about 120ms
 
@dzaima (code)
@dzaima (Dyalog takes 200ms, so not too much faster than it :/)
 
7:10 PM
@dzaima and i can't seem to improve that at all..
(perf report - 8.6% of time is just spent freeing scopes, and 9% is block calling overhead)
https://dzaima.github.io/paste/#0VZFBT8MwDIXv/RW9cI0Sp2kbTrABEggYGnCOQppp07q1dBu/H9tZhrjle3bi95xW1PqqLA9hGKNbTTEWlWgqVFan/ax3QSHrFjn@@P7p8aPQogZEPJZGX5ez@Y2qLaqGmnYdpEtaaIMchn3nAhDSm@MmbBNC/TeCWJKJ1TBxGYTV6bG7ZAlEay51hWgIN@7hVc2RKuqO3@kqVOcSUElR6at3O9UVSliTnUt2bppakqzOcmVTIDAtZN0fpiO9rFLutZ@mZEoJo3nU7XLpRkJuPw5jauet0Wig0brOthZIYCmfo4SZ@qNPy0GWl9UpRGX56uKNmxXl812XWjkfJ4JkXVMgScOCcpOfYiGFbf6jzj45BwqS93fyPULLtiPuOtJ4FJLz9/uPl03G6MN6R1Dlf0I3iPxtjv91CFtSJF9@Xsw/kRqb3VbsFsD8Ag#BQN
 
7:45 PM
Not sure this has been posted here yet: github.com/interregna/arraylanguage-companies
If you know any companies using APL (SimCorp, etc) ... would be awesome if ppl could open Pull Requests or even just Issues asking for the companies to be added
I would love to see a comprehensive list
 
aplwiki.com/wiki/Talk:Jobs already exists which could be useful
also aplwiki.com/wiki/List_of_famous_APL_users but there's not much on it
 

« first day (1612 days earlier)      last day (1035 days later) »