« first day (1472 days earlier)      last day (1198 days later) » 

2:01 AM
CMC: Tie or outgolf me in Evaluate Left-or-right using APL. I have 23-bytes solution in vanilla Dyalog APL.
 
damn
I got it
Shame that < and > don't work , would be nice if there was some a w so a<w = a and a>w = w
 
<moon-child> easy, a←⊢
 
2:16 AM
Can't pass functions as arguments
Although I'm not sure what you mean
 
maybe it's HTML artifacts?
moon-child: How does the message (the one starting with "Shame") render to you?
 
It's purely ascii so I don't know why there'd be a rendering issue
 
If <w = a and a> gets stripped, you just see aw = w
 
Ohh
Improper filtering? weird
 
so the obvious answer is indeed a←⊢
 
2:22 AM
<img src=x onerror=alert('hi')>
(does that work? lol)
 
@rak1507 Maybe add some explanation of how the code works and why?
 
On it
 
<moon-child> oh, yeah, hmmm. Idk why the < and > got filtered out
<moon-child> oh, I see
 
(actually the same approach could be shorter in Jelly, as it has all the necessary built-ins to mimic it)
 
argh, alignment is hard
 
2:32 AM
Write explanation in TIO and copy that
They don't perfectly align when the monospace font doesn't support the chars anyway
 
yeah
oh well it'll have to do, it's still obvious enough which bits correspond to what
fun challenge, I initially started writing something that would parse it recursively lol
 
I have a custom stylesheet that renders all the textarea and code in DejaVu Sans Mono
 
Oh clever
 
It only works for me, but it works very well for me, so I just write all explanations to align in my view and hope the others understand
 
I think I've fixed the alignment
 
2:38 AM
@rak1507 The explanation is a little off. "length of the left argument" → "last index + 1", and the train is a dyadic train, so you should say x (f g h) y → (x f y) g (x h y) instead
 
True
(⍎'(⊣⊢)'['(<>'⍳⍞])/'<>'
         '(<>'⍳⍞          take the input ⍞ and get the indices of '(<>'
                          this fills with the last index + 1 if not found, saving 1 char
  '(⊣⊢)'[ stuff ]         index into '(⊣⊢)', replacing <> with ⊣⊢, the left and right tack functions
 ⍎                        evaluate this as a train
                          APL trains of the form (f g h) when applied to left and right arguments x and y produce (x f y) g (x h y)
                          This translates directly to this language
decent?
So much easier to explain things using symbols rather than words :p
 
Looks good
 
2:54 AM
back to doing my physics homework... :(
 
@rak1507 abusing APL trains is big brain
 
@Razetime it's nice that it works out to be like that
 
(Now that I finally got Electorate, I can upvote your answer yaya)
 
What's Electorate?
 
Gold badge
 
2:57 AM
What does it allow you to do?
 
nothing at all
I just like having more than 1 gold badge
only tag badges and rep give you privileges
 
Why does having it mean you can upvote the answer?
(sorry, I'm probably being a bit thick here)
 
electorate requires you to vote on 600 posts
and maintain a 1:4 answer to question vote ratio
I upvote too many answers
 
Ahh
I don't really pay attention to badges or rep that much really
I cannot believe my answer to the rod cutting problem got 8 upvotes that's just obscene, people really don't take into account how hard the answer was to make when they vote, it's a shame
 
when questions get more attention, more non code golf voters come in, who vote for really short answers
 
3:03 AM
True
 
so don't beat yourself up about it
 
I'm not beating myself up, it's just annoying to me that people view it and the JS answer equally, when the JS one is clearly superior in every way, other than code size
 
not very clear to new people
 
Maybe
 
3:22 AM
in The Nineteenth Byte, Oct 21 '20 at 0:09, by Bubbler
How to get 10 upvotes on an answer: See a new code golf challenge popping up, solve it quickly in APL, and post as first answer with some fancy MathJax.
 
lol
 
 
7 hours later…
10:15 AM
@Adám i'm having a weird problem
 inter←{
     op←⍺⍺
     single←{
         s←⎕AI[2]
         _←(op)⍵
         s-⍨⎕AI[2]
     }
     times←{
         ⍺←1
         time←single¨⍺↑⍵
         20<+/time:⍺
         (⍺+1)∇ ⍵
     }
     times ⍵
 }
when i run it as 5 (!inter) 1 2 3 4 5, it loops infinitely
when i step it in a debugger, recursion somewhat breaks, and it starts recursing in the operator, and i get a value error, sometimes it returns correctly
 
@KamilaSzewczyk that sort of makes sense - you break out of the infinite tail recursion only when the execution of all single calls takes longer than 20ms, and the debugger probably makes things slower
(oh, not the value error part)
 
 
3 hours later…
12:58 PM
If we think of tacit as a function composition DSL with its own grammar, this grammar is context-free and entirely parseable, is that true?
Or maybe even regular; my school days are too far behind me.
 
@xpqz a b c d could be (fn op) fn fn or fn(fn fn fn)
 
So that ambiguity stems only from the fact that some operators can also be functions.
This dfns.dyalog.com/n_tacit.htm suggests at least to me that it's parseable? What am I missing?
 
@xpqz A restriction of APL expression grammar is context free if and only if the type of every variable is known statically. So if for example you only allow variables to be functions then it would become context free.
@xpqz You can't distinguish cases like {X f Y} and {X f A} without knowing types.
 
@xpqz I give you the expression f←a b c d. Parse it. (hint: you can't)
 
@xpqz If you only have primitives, then APL is parseable in general. No, I was talking about user-created names.
 
1:10 PM
Quite. Hypothetically, I could write a 'compiler' that takes a single-line dfn and makes it into a train if the type of each variable is known.
 
@dzaima any chance of a copy-pasteable version?
 
@xpqz not without me typing it :p (this was pre-paste)
 
I might try it at some stage in python for the learns.
 
@xpqz On further reflection, this doesn't really say anything about parsing tacit code. It's translating dfns to tacit functions, but not all tacit functions can be produced this way. Looking over the seven rules, you'll note that each of them ends in either a tack ⊣⊢ or another dfn to be expanded. The result is that this procedure can only produce trains that end in another train or a tack!
 
1:16 PM
@xpqz If you did it in APL you could potentially utilise 60⌶
 
@xpqz here - turns out my project for it still had a commented line for that
@dzaima (the no-op monadic operator ¹ there is my way of signifying that its operand is a guaranteed-monadic function (⍤⊢ in the picture but that doesn't really make sense))
 
@xpqz If you stick to a strict naming scheme, then APL is parseable. BQN makes that naming scheme a core part of the language.
 
@Adám (Document)
 
dfnification fails to complete though:
https://dzaima.github.io/paste/#03Zg7bsQgEIb7nAS0sZQ9QE6G0kbJal2kSx0pkmvHKVyk4SicJDPgB8ZmDBu8ZrPyYobHzPePsEFmqmwKdfpUZaVe3tnDozp9qHOrylc01fMb3o4HGAWXrBh034N5/uHQocovqadBRZsNx98dKwooNvGMTmVtu0ULHcPdcY0txrmstXtZ68bIEESM1SDoXLbcDoT@sanlfLz5wjIiLvtrYAuBCC9bCgB6bxVh8QrDgJoBMZUolG4uWhngtFkAWQi7Isk2Vyg2UuUJ1gfYGa2@Bhxy5Ic3bLoZM3rwRMdXfnOKUfSQMKwHtaa6tND2FA5sRvO5uYgtwrBFGLYYsDvmC8ht/klLOL/QAoSm95OLIHbNqauILjq7cUetl8TSvi0RUfy6O2AZidiFNMoxIdz1NCyjBRF0r0ciliAT5oQpxfLQjw8QPI7PVbe2I7V3c@L0o5zpuy9NGvhaJjidjJVczF@bIYmYpIHOQoIdwPMG@gfKLhSVRJD1wLpKvAszIf@m7OM2sQ3xVrTJU
 
@dzaima what does the superscript 1 mean?
 
1:23 PM
5 mins ago, by dzaima
@dzaima (the no-op monadic operator ¹ there is my way of signifying that its operand is a guaranteed-monadic function (⍤⊢ in the picture but that doesn't really make sense))
yay dfnifier actually completes \o/ (i forgot i need to specify arity for the input, otherwise it's impossible)
https://dzaima.github.io/paste/#03ZhNboMwEIX3PYmtFCk9QE5mdVu1UVh013WlSqwpXbDoxkfxSTpjG7AdbIYUEpMqBcY/8743cgyBMVU2hTp@qbJSrx9sf1DHT3VqVfmGoXp5x9PTDkbBR1YMuh8hPP1y6FDlt9TT4EKHDcc/2fIHVhRwWC07JpbtdlJDZje5rN30GKEAnAMJbDEistYystaNF0jJ9upiCbVJOZTB5I6k0UA97p0mAFiCgP0XwbsigECYQIHe7cMkPnQg0wFIdsQcKDsXo6zA2szQHJhM4GSbPx4b@HJH7ESygayviYk82YL2T0eboBWd1g8fpxUWFwakkJ08PbczNYSHtmc6vxnNx0J7nTYiaEYEzYjojVgXF3g5t9C3RByJwdKoHaH9CG0mbkSQrGhsfYlOhI2bcNS8Y/fVuD9bUUfRtSf6xScIq0/MXX@DSSMRLsNgrY0vwGQv1Tse
 
My apologoies; my eyes missed the fact to typed that two messages ago... :/
 
That's really cool
 
@dzaima What language is it written in?
 
@Adám java ofc
the transformation rules:
https://dzaima.github.io/paste/#0hVU9i9swGN7zK14yxRAITrodHQzl4JYSel3KcRRfYvXcO9tBdu5ITZZObWn2jqV0uNnQwR3zU/xL@urTkqxLQ0ikV88rPXreD11WNM0/XF1fXcPbN9HF64vzd/AS8uQRLvVKPQLA72wGN3GZrqCicV6SgmZxlRY50O19UuJ6PZ6QELrDnwDIHCZkwcfjKXA7msgiQMt4Px2A2QfHYIC7b7/AhLNl/nH3ZsDh7ibc3F2YusOTsCl4FGZLz96Rh3cPtVhHYfflBzeaYPBzhgFjLXHJ1F3j35aQM3hI6A5uaHGX5LZoEyZRL8Fndng4lYO5q4RGg4R7kXpzZgN3Y5erVEJGC9eUYMwQHFuwdz62QRQyDK7jQIu5WTL/aJ4t2WI0l9FRECHKqshRiQrix3gHhBYZrIkQpBac92LnY@uoWWyqNEs/JRzLmSFEJ1mg8MhQUORhxUjxKP4mL9zsZSblwW6qY4u@//XgVkGUa6@51oI6X2HG/dlo1Jcfluarc29hitKs2UWzmN5BwtKlusVViEtI0u
 
CMC: Implement ^ in APL.
 
1:28 PM
Tres cool.
Imagine having that hanging on a ]command ...
 
@Adám no thanks
 
lol
 
1:54 PM
Hi guys, I want to create an APL interpreter. Is there a resource that clearly describes how to do this properly?
 
@dzaima in your transformation rules, what do mP and pP signify?
 
@M4X_ What's the best approach hugely varies between different goals. Performance? statically or dynamically parsed?
@xpqz let me check. i have no clue lol
A_mP disallows the thing to contain or at any depth. A_pP requires it contain or at any depth
so {"A1pP f2 A2mP", "A2 f2⍨ A1"} means that you reverse args only if as a result you'd bring arguments to the right side
 
@dzaima I am looking for a learning experience really. I was thinking of doing it in Nim.
So I will probably be more interested in the easier solution
 
@M4X_ this is a thing I like to link about how APL expressions are interpreted. There's also this, but it isn't completed yet.
@dzaima (first link is really about J, but the same thing applies to APL)
 
Thank you very much
 
2:09 PM
the important thing to note is that APL traditionally can't be statically parsed. So a big decision you must make is whether you parse at runtime (which results in overhead), or at compile-time (which restricts things quite a bit)
 
2:36 PM
@dzaima (that could be notated more sanely, but the condition system i have sucks, and i couldn't be bothered to make it better. If ignoring , that's equivalent to {"A1 f2 A2", "A2 f2⍨ A1", "A1∋⍵", "A2∌⍵"}, but adding the "or ⍺" part is impossible)
 
@dzaima Thanks!
 
@dzaima (not that that really matters, the current rules do almost nothing about dyadic functions and work only on a tiny subset of cases)
 
@M4X_ This question comes up a fair amount, so I made an APL Wiki page with some links. There's not much out there. If anyone here knows more resources, particularly for interpreters, please add them!
 
2:55 PM
@Marshall the last two links in mlochbaum.github.io/BQN/implementation/vm.html 404s for me.
 
@xpqz Fixed. I also got to switch the link from bcases.bqn (now simple.bqn) to bytecode.bqn, which has tests specifically for VM testing.
The VM document is somewhat outdated overall, as there are some new VM-provided functions that are needed and LEB128 isn't used any more.
Know your compiler ABCs: April, BQN, Co-dfns, dzaima/BQN.
 
3:26 PM
@Marshall Really nice. Can you add dfns.parse?
 
4:05 PM
@Adám Dunno why you're asking me, but I added it.
 
4:40 PM
I left my APL session running for a while
and it segfaulted for no reason
 
5:01 PM
 
noted, thank you
@KamilaSzewczyk actually can you go to Help → About and copy that and paste it to me somehow or send to rpark at the domain what is dyalog dot com please?
 
there isn't much inside it
Interpreter:
  Version: 18.0.39712
  Platform: Linux-64
  Edition: Unicode/64
  Date: Dec 11 2020 at 01:07:55
 
Doesn't include RIDE version?
IDE: something
 
it does, but i'm not sure how can it help
IDE:
  Version: 4.3.3463
  Platform: Linux x86_64
  Date: 2020-07-07 10:44:21 +0100
  Git commit: 0cd6e9faf39a5d6a5f5caa94d1ff51743d5cdd75
 
5:07 PM
@KamilaSzewczyk Nor am I, but the more info the merrier
 
i can mail you my aplcore
if it's of use to you
 
ooh yes please
 
i should write a script to automatically compress my aplcore and mail dyalog when the interpreter crashes
 
loool
I'm afraid supports email would fill up if you did that :P
 
did you receive the e-mail?
 
5:09 PM
or rather, I would like @Adám to confirm whether doing that is actually a good idea, but he is sabbathing
Vince gets the support emails
support at
 
okay, forwarded there too
 
although end of day has passed today so I can't do much
but yeah thank you for reporting / sending :)
 
5:32 PM
no problem
 
 
3 hours later…
8:17 PM
if i wanted to copy over my current workspace to the child isolates, how would I do that
so that if i have a variable a, it can be used within an isolate too
the documentation mentions 'DRC'⎕CY'something', but i'd preferably not save that anywhere
> The listenproperty is used to enable callbacks
I set it, just like the documentation shows it, but i still get an error about callbacks not being enabled
also:
      {⍵+##.a}IÏ 2 3
36:VALUE ERROR: Undefined name: localaddrs
Run[69] :If ~ok←(⊂addr)∊localaddrs[;2] ⍝ remote
                        ∧
 
8:42 PM
hm, okay, i got it to work with usual stuff like the root namespace, but how can i pass around dfn-local variables? {a←3⋄{##.a}IÏ⍵}1 2 3 doesn't work, a←3⋄{##.a}IÏ 1 2 3 works
section 3.1 seems to explain that, but is there a way to pass around a custom namespace?
Inside an isolate, the special symbol ##(aka “Parent”) refers to the root (#) of the parent process - and not, as one might expect, the space inside which the isolate was created (as would be the case for a normal namespace).
i tried passing around a namespace, but that didn't work
      {op←3 ⋄ {self←⊃⍵⋄self.op}IÏ ⎕this,¨⍵}1 2 3
FUTURE ERROR: 6: VALUE ERROR: {self←⊃⍵ ⋄ self.op}: iEvaluate[13] (,⍕(⍕rc),': ',(
0⊃res),{(⍵∨.≠' ')/': ',⍵}1⊃res,'' '')iSpace.qsignal rc
      {op←3 ⋄ {self←⊃⍵ ⋄ self.op}IÏ ⎕THIS,¨⍵}1 2 3
      ∧
      {op←3 ⋄ {self←⊃⍵⋄self.op}¨ ⎕this,¨⍵}1 2 3
3 3 3
 

« first day (1472 days earlier)      last day (1198 days later) »