« first day (1198 days earlier)      last day (1753 days later) » 
00:00 - 20:0020:00 - 00:00

00:53
@dzaima themes added. Light theme APL was a pain, fns/mops/dops are barely distinguishable but i couldn't come up with anything better
 
6 hours later…
06:48
@Bubbler Thanks. I've fixed those two.
 
3 hours later…
RGS
RGS
10:10
How can I specify a path to the .dws I want to )LOAD?
@RGS Doesn't just, well, specifying the path work?
RGS
RGS
I tried using )LOAD path/to/file/filename and )LOAD 'path/to/file/filename'
I think it should be without the .dws extension
@RGS Use backslash or file:// or ⎕LOAD or double-quotes.
@Bubbler No, that doesn't matter.
RGS
RGS
@Bubbler I tried both
⎕LOAD worked for me
thanks o/
10:14
@RGS Actually, now that I try it, it seems to work fine for me. I'd like to get to the bottom of this. Do you have spaces or other funny chars in the path?
RGS
RGS
Define "funny", but I don't think so
C:\Users\rodri\Documents\Programming\APLDyalog\Phase2_2020\Contest2020
that's the path I used; with and without .dws, with and without surrounding '
And that failed? Very odd.
RGS
RGS
also tried replacing C:\ with file:\ and file:\\
RGS
RGS
If I host the image on imgur then I can get it to display inline?
10:22
@RGS Yes, but even if you don't, you can simply select "from the web", and SE will transfer it.
I personally save my screenshots to file, and then upload them.
RGS
RGS
@Adám I totally forgot there were buttons to the right of the text box!
11:18
@Adám - A thought: Given that ⍬ matches the null vector, how about an option to print the null vector as the character ?
@JeffZeitlin Shouldn't '' print as that too, and ,'a' not as a?
@Adám - Hmmm... I'd say that if I can't programmatically distinguish the type of the null, then it should print as ⍬ if the proposed option is set.
Perhaps the option could be a bit more extensive, in that setting it would cause character vectors to be printed with delimiters.
@JeffZeitlin Try this, just for lols (restart APL when done):
⎕SE.⎕WS'Event'(2⍴⊂⎕SE.⎕FX,⊂'SessionPrint←{⎕←⎕SE.Dyalog.Utils.repObj⍺}')
Izzat gonna put me into a state where I'm going to have to crash something?
No, not at all. It'll just change APL so it outputs all arrays as expressions that would generate that array.
11:25
(OK, I just opened up a second instance)
      ⍳100
1+⎕io-⍨⍳100
It isn't something I'd want on all the time, but occasionally it is useful.
Golfed:
⎕SE.(⎕WS'Event'(2⍴⊂⎕FX,⊂'SessionPrint←{⎕←Dyalog.Utils.repObj⍺}'))
RGS
RGS
"Golfed" :-D
ngn
ngn
@Adám you should make this a user cmd
@ngn What exactly?
ngn
ngn
@Adám an easy way to switch on round-tripping
actually i always want it (without the ⎕io-s, of course)
11:29
Problem is that not everything can roundtrip.
There's also this one:
      ⎕SE.(⎕WS'Event'(2⍴⊂⎕FX,⊂'SessionPrint←{⎕←1⎕JSON⍺}'))
      ⍳10
[1,2,3,4,5,6,7,8,9,10]
      a←⎕NS⍬
      a.var←⍳3
      a
{"var":[1,2,3]}
ngn
ngn
@Adám what can't? namespaces?
@ngn Right, and functions, operators, large arrays, ⎕ORs…
i once wanted to add a roundtripping option for dzaima/APL, but i also decided to write it in apl itself and got stuck at making APL-y string escaping..
ngn
ngn
@Adám dfns and dops can print their source. trandfns, namespaces, and ⎕or-s were a mistakes in the design of the language - i would happily ignore them.
@ngn you would, but I can't.
Actually, wait a minute…
ngn
ngn
11:34
just print something like ... for them
the usefulness of a roundtripping format is much greater (especially when learning the language) than the importance of covering all edge cases
/me thinks that any APL-like language that doesn't support tradfns can't be called APL.
      ⎕SE.(⎕WS'Event'(2⍴⊂⎕FX,⊂'SessionPrint←{⎕←Link.Serialise⍺}'))
      a←⎕NS⍬
      a.var←⍳2 3
      a.fn←{⍺+2×⍵}
      a
 (
 fn←{⍺+2×⍵}
  var:  [(1 1)  (1 2)  (1 3)
         (2 1)  (2 2)  (2 3)]
 )
@ngn We definitely want this ^ eventually.
@JeffZeitlin so dzaima/APL is not APL (though there are several other things in it that don't follow any APL specification)
ngn
ngn
@Adám your (dyalog's) mistake is that namespaces are mutable and their keys are limited to identifiers
@dzaima - If it doesn't support tradfns, no, it's not APL. It's related to APL, and may be partly compatible with APL, but it isn't APL.
ngn
ngn
11:38
@JeffZeitlin why would you ever prefer a tradfn over a dfn?
@ngn Wrong. It was neither my mistake (predates my involvement) nor a mistake on Dyalog's part. Without the OO for the GUI, there would have been no Dyalog today. I don't think you can call a decision that saved the company a mistake.
And doing OO-based GUI without mutability is… odd.
@JeffZeitlin what is APL? and why would the existence of a single feature define it?
@ngn - Tradfns actually make sense when you need a fn to have side effects that may be more important than a 'return value'.
If it doesn't support tradfns, then it isn't ISO-compliant APL, but it can still be APL.
@ngn We've been over this loop before.
ngn
ngn
@Adám i didn't say anything about not using them for gui or not saving the company. my point is: they are mutable and the domain of keys is restricted.
11:40
(personally IMO tradfns have horrible, horrible syntax, though i'm open to adding parts of them to dfns if it makes sense)
@Adám - See, that's where we'll disagree - if there's a Standard for it, something that isn't compliant with the standard can't (or shouldn't) be called by the name.
I think we can all agree that ideally there should be only one explicit function syntax, with all the power of both dfns and tradfns.
Dyalog, being compliant (but extended from the Standard) is APL.
@JeffZeitlin so "APL" is stuck with the fact that 1 2 3+,1 doesn't error, for forever?
Why should it error?
11:42
Because you can't use a scalar function on arrays with mismatched shapes.
SHARP APL errors on 1 2 3+,1
And not necessarily "forever"; if a new Standard for APL comes out, where it is defined as erroneous, then a Conformant implementation would error.
Or I should say "Compliant"
@JeffZeitlin so i need to make a dzaima/APL standard? :p
@JeffZeitlin by what name? The name of the standard? ngn and dzaima never claim to be ISO-compliant. Neither did SHARP.
I contend that ngn, dzaima, and Sharp shouldn't have been called APL. The exception that might be allowable is if Sharp's implementation pre-dated the Standard.
@JeffZeitlin However, you could complain that Dyalog claims:
> At the heart of our business is the Dyalog interpreter, an advanced and highly-optimised language engine that bullshits bullshit and object-oriented features into an ISO/IEC 13751-compliant APL language core.
11:46
Yes. Dyalog is APL, but it's EXTENDED APL.
i.e., it meets the standard (ISO13751), but it offers extensions beyond it.
@JeffZeitlin You can't make a standard for something after various implementations have been made using that name, and then claim existing implementations are non-compliant with that name. Give your standard a new name!
@dzaima more importantly, why does the existence or non-existence of a standard define what I can or cannot call a language?
SHARP APL never claimed to be an ISO EXTENDED APL. Dyalog does claim this (though it isn't 100% true).
@Adám - That's why I say Sharp's might be allowable as "APL", if it predated the (original) standard.
12 mins ago, by Jeff Zeitlin
/me thinks that any APL-like language that doesn't support tradfns can't be called APL.
If you had said /me thinks that any ISO EXTENDED APL-like language that doesn't support tradfns can't be called ISO EXTENEDED APL. I think we'd all have agreed right away.
It be almost tautological.
/me thinks Alexa Presentation Language can't be called APL
11:50
Yes, because the standards - both the APL2-based 13751 and the APL\360-based older standard (don't know the number offhand) - define the language as having tradfns
(Arrgh. Forgot about silliness like Alexa Presentation yadda.)
that raises a good point - does the ISO spec ever say anything (probably outside of terminology in the spec) about the name "APL" specifically, without any reference to ISO, etc?
@JeffZeitlin No, that'd be ISO APL (ISO 8485:1989), not just APL.
@Adám - Point taken.
ngn
ngn
who cares anyway
Next, ngn will say that standards behind paywalls are worthless.
ngn
ngn
11:52
just make it easy to see what the result is, with roundtripping when you can. print tradfns as an emoji if you have to.
@ngn If they were not mutable, how would you define a global variable in a namespace? How would you define A to be 5 in #? But maybe that's the problem - it it the unnamed namespaces that you are talking about? If so what should they be like, and more importantly could a new thing be added to the language - a k style dictionary?
ngn
ngn
@Adám thanks for saving me some typing :)
I would contend, though, that - along the lines of current 'intellectual property' law - that a programming language/mathematical notation that is deliberately similar enough to ISO APL to be confused with ISO APL is "infringing", in the sense that it is deliberately engendering the confusion, and "riding on the popularity" of the ISO-defined language.
@PaulMansour I proper immutable dictionary type (with arbitrary keys) might be a better way forward. It wouldn't have to suffer from the extreme overhead of namespaces.
Is it a legal problem? Clearly not; the name isn't trademarked or otherwise protected.
11:55
I doubt that will hold. Nobody has patented or trademarked "APL".
@Adám I think it'd be plenty useful to have a setting to make just 0∊⍴ arrays print in a fancier format, Dyalog's whitespace spam is just completely utterly pointless & very much unreadable and unusable.
And with that, I have to get to my work computer.
@dzaima Well, max boxing is a bit more useful.
ngn
ngn
@PaulMansour let me answer the question with a question. how do you set the n-th element of a vector to 5?
I agree that a user command like box (or maybe just an extension to box) to print expressions in APL and JSON, optionally only for empty arrays would be a good thing.
ngn
ngn
11:56
if arrays can be immutable (i.e. modified in-place only when their refcount drops to 0), why can't namespaces work the same way?
If I change the colour of a displayed button, should that leave the original button in place, and simply create a re-coloured clone?
@ngn I'm sure I'm going to look very foolish in a moment, but here goes: v[n]←5
@ngn I have to run to meeting, but I'm going to ponder this.
ngn
ngn
@PaulMansour yes, and if you had u←v before that, u would still have the same value as before (without the 5 at position n). but that's not true of namespaces. they are always modified in place.
passed by reference
@ngn they of course could, but the question is more which is more useful (APL being "a tool of thought", rather than "minimalistic real-time performance-oriented language").
ngn
ngn
12:00
@PaulMansour exactly
I guess you could say that button←(⊂'red')@(⊂'color')⊢button would briefly cause two otherwise identical buttons to exist, but the old one would disappear due to ref-count going to 0.
I'm confusing that with immutable
ngn
ngn
@PaulMansour different people use different terminology. i've also heard "value semantics" and "reference semantics"
@dzaima one doesn't rule out the other
@ngn I certainly find thinking about mutable GUI objects much easier than some immutable things, whether that be by using reference-counting to show/hide, or having to collect the things to draw & redrawing everything constantly (which would go against performance)
a pseudo-example arguing for mutability - an appendable file - what could that look like in an immutable language? It'd have to be some pseudo-reference, due to the nature of flies. File descriptors are pretty much mutable integers, and referring to a file just by its name is probably suboptimal. (pretty much the same goes for GUI objects)
ngn
ngn
@dzaima i/o is different. i was talking about data structures in memory.
12:10
@ngn And GUI is a form of I/O, no?
@ngn so are you proposing to have no I/O in a language, or to have mutability?
ngn
ngn
@Adám not the components that represent the ui elements. they are data structures. only the code that draws them on screen or receives keyboard&mouse events involves i/o
@dzaima neither, but that's beside the point. namespaces are more similar to arrays than to anything with i/o operations.
one benefit of immutability (i.e. value semantics) is: the object graph is guaranteed to be acyclic. you can collect any garbage immediately without the need for mark-and-sweep gc.
@ngn there has to be some binding between the two though. mutability allows that to be just a reference, whereas immutable GUI objects would require some manual draw calls (either writing manual "did this actually change anything drawn" checks afterward, or wastefully redrawing on every change)
Sure. Another way to guarantee that is not to have pointers at all. Question is how useful it'd be.
@ngn purely technically I do agree that immutable maps are "prettier" but in practice I have never needed to deep/shallow-copy a map, and very often use mutability.
ngn
ngn
12:23
@dzaima that's sounds very java/awt/swing - draw() being a method call on the object. the apl way is to have all the data in arrays (and, as i suggest, value-semantics namespaces) and separate functions to manipulate the data.
@dzaima (moreover, purely in my opinion, immutable maps are just pointless. dzaima/APL doesn't have refcounting, so i don't really have a choice anyway, if I don't want O(n) modifications)
ngn
ngn
@dzaima you do have refcounting, it's just tucked away in (or delegated to) the underlying language (java) :)
but ofc java objects aren't immutable
@ngn afaik Java doesn't have refcounting either
ngn
ngn
@dzaima you may be right
in APL/J/k you can get away with refcounting pretty much for free because of the relatively big object:data ratio, but Java would just have a spam of reference count changes everywhere
ngn
ngn
12:39
java has multiple jvm impls. hotspot (the most popular one, at least when i used to do java) has multiple gc impls, configurable through -X.. and -XX.. options. i would expect at least one of them must make use of refcounting, but i can't be bothered to research this.
@Adám but consider also things like ⍬⍬ which is a non-empty array of empty arrays
@ngn Right, empty leaves.
13:05
Announcement: Dyalog's APL Problem Solving Competition is now open for 2020!
8
ngn
ngn
@PaulMansour to better illustrate what i meant:
      a←b←0 0 ⋄ a[1]←5 ⋄ b[1]
0
      a←b←⎕ns⍬ ⋄ a.k←b.k←0 ⋄ a.k←5 ⋄ b.k
5
RGS
RGS
@Adám what was the conclusion to the workspace path problem?
@RGS I have no idea why it didn't work by you.
RGS
RGS
fair enough
I just wanted to be sure that was the point we were at
Did you try with doublequotes? "
RGS
RGS
13:16
uh oh it just worked now
but now I didn't do copy&pasta
@ngn Right, I know exactly what you mean now. I have always considered this a feature, not a bug, but that is only because that is the way Dyalog implemented it.
@RGS I suspect you had a non-breaking space at the end of the line, or something.
RGS
RGS
I started writing the path and Dyalog started autocompleting it (nice!) and so I just auto-completed my way to the file
@RGS you had 2 spaces after )load, maybe that's it?
RGS
RGS
@dzaima that'd be terribly stupid on the interpreter
but that's not it
Just tried with multiple spaces after )load and it still works
13:18
First we had namespaces only for organizing functions into groups. Then we had GUI objects. I think unnamed namespaces came after all that.
@dzaima (saying that as dzaima/APL will fail on similar things. :p)
I make heavy use of unnamed namespaces to pass state around to all my functions, which can mutate the state. (Functional programmers freak out ...)
also wouldn't you still need to include C:\ with file:\\ (also, how about using forward slashes instead?)
Fake classes
@dzaima We tried all that. I suspect invisible non-spaces.
RGS
RGS
13:23
(It would be really nice to have a shortcut to fix the code in the editor without closing the editor)
so something like ESC, but without closing. maybe Ctrl+F for Fix
@RGS there is - FX
RGS
RGS
@dzaima Don't I have to type that?
using the Windows Dyalog interpreter
ah right, you're not using RIDE afaik (ninja'd)
RGS
RGS
@dzaima don-t worry
you made me use my brain
Options → configuration → keyboard shortcuts
it's literally the first shortcut available, just have to assign it to something
yeah, it works :-)
I'm confused how people do anything without that shortcut, but whatever
13:28
@dzaima I agree, but John doesn't want to set default bindings, especially since Ctrl (which I think is the obvious choice for all such things) is out of the picture.
RGS
RGS
@Adám who's John?
Is it a metaphor for users or is the actual guy in charge of the terp?
@RGS John Daintree. Guy in charge of the IDE (and many other things).
RGS
RGS
"Can be heard shouting at his computer"
iirc, he wrote that about himself
right?
Everyone writes those for themselves, I think.
RGS
RGS
the webinar starts @ 16BST but is there a community standard time for ppl to start to show up?
I thought the webinar was at 15 and I logged in a little ago but I was the only one in the room and decided to leave :-P
13:43
@RGS I'll be there at 15:30.
RGS
RGS
alrighty
Depending on how outgoing I feel I might try to join early as well
And if work is going well enough
@Adám Problem 9 has a language issue I think: "Imagine you work IBM (no, not that IBM, you work for Incrediby Big Mobiles) as a production planner"
we're missing something like "for" or "at" between "work" and "IBM", no?
right
14:14
Last phase1 problem has me beat...
but pleased I managed the rest without much hassle.
15:10
±doubled parsing performance by manually splitting patterns beforehand, instead of splitting on every test. ¯\_(ツ)_/¯
 
1 hour later…
RGS
RGS
16:30
@Adám I like the new APL Cart symbol for the TIO link much more than the previous tiny triangle
Also, what are you going to link to (documentation-wise) for APL Cart entries that have more than 1 glyph in them..?
@RGS Thanks. Matt and I hashed cam up with it together.
@RGS I wasn't intending to link to anything, but if you have an idea, I'm all ears.
RGS
RGS
@Adám right, I don't know... For functions that implement a particular algorithm, might be helpful to link to an explanation of said algorithm/concept; other than that, I have no idea. A TIO link with a broken down explanation of the code could be a possibility? But also a pain in the *** to do
@RGS A link to Jupyter's nbviewer…
RGS
RGS
@Adám Sounds reasonable if you group many/all functions in a notebook. I don't think it would make much sense to have a notebook for a single entry..?
And assuming you can add anchors to the nbviewer, but you probably can i.e. to link directly to the function and not just to the notebook
Depends on how complicated that entry is. Yes, you can link to any heading.
RGS
RGS
16:39
@Adám I'd say entries large enough to warrant a notebook just for themselves aren't big enough to be in APL Cart
But on the other hand I don't know what complicated entries APL Cart has
RGS
RGS
16:52
I actually like the idea of linking to a Jupyter notebook
@RGS Can I have your opinion on a thing? How should APLcart link to the documentation? With or without navigation?
RGS
RGS
@Adám You can have my opinion on all the things
The worst thing that can happen is me saying I don-t have a strong opinion on it
(lemme check)
(btw, in case we change it, you won't have lost any work, as the transformation is simple)
RGS
RGS
@Adám didn't understand your remark
I prefer with navigation because I can glance to the left and find a whole new world of possibilities
and without navigation I still have the small link up there to open the navigation, but it isn't as catchy
@RGS OK, that's what I thought too. I'll make the change.
RGS
RGS
17:08
(+1)
@Adám do you know Google's collaborative notebooks?
No.
RGS
RGS
Google Colab is the name, I think; it'd be awesome if APL worked on those
It's like Jupyter notebooks but hosted by google
More like Google Docs, but for Jupyter Notebooks.
RGS
RGS
So like a Google Drive but for jupyter notebooks; so you can run the python notebooks directly on google colab and you can send them to people and people can edit them
yes
The first step would be to have an easy way to access a containerised online APL interpreter.
RGS
RGS
17:14
@Adám containerised meaning...?
Can't break it for others, but not running a full VM.
RGS
RGS
And that being the first step means you can't do with Colab what you did to my local installation of jupyter? Like install a new kernel
Right, we could do that, I guess. But does Colab allow non-Python kernels?
Funny, Colab has "Ask on SO" as a menu-item.
RGS
RGS
@Adám I have no idea, I'm just throwing ideas out there
I only used Google Colab a couple of times
searching for "install kernel on google colab" on google looks fairly promising
Another alternative would be for me to finish my APL Python interpreter in blazing fast speed and have it interpret the APL code ahaha
(^ is not gonna happen, sorry... definitely not the "in blazing fast speed" portion of it)
@RGS Should work:
4
A: How to run Golang in Google Colaboratory

korakotFirst, you need to install the Golang kernel (gophernotes) from a normal Python notebook. !apt install golang-go libzmq3-dev %env GOPATH=/root/go !go get -u github.com/gopherdata/gophernotes !cp ~/go/bin/gophernotes /usr/bin/ !mkdir /usr/local/share/jupyter/kernels/gophernotes !cp ~/go/src/githu...

RGS
RGS
17:30
nice!
The advantage is that people can then run the notebook directly from the browser
@ngn I'll have you know I went to have a look at your code
for ngn/APL I mean
Because I'm writing a simple APL interpreter based off of this blog post serires but the post series is for Pascal
and parsing/interpreting a Pascal program is fairly distinct from doing the same with an APL program
And I wanted a little inspiration... But I didn't find your code very readable in the sense that everything is crammed into everything
and there's one-letter variables all over the place and whatnot... So I just gave up on reading your code 🙃
(woops, the link should've been https://ruslanspivak.com/lsbasi-part1)
ngn
ngn
@RGS oh, it's very readable. by me :) and obviously you haven't seen ngn/k's code
RGS
RGS
I believe you can read it... I just think it's fairly obvious the code wasn't written to be readable by other people ahaha
and please tell me you didn't write ngn/k's code like that, you just minified it afterwards.... right?? In terms of whitespace, at least; I don't mean the variable names.
ngn
ngn
@RGS i do. i write it like that. sometimes i expand a small section while i'm working on it, but then i make it compact again.
RGS
RGS
Alright, I find it weird but if it works for you...
I probably couldn't do it if I tried, I'd get lost :-)
ngn
ngn
@RGS try duckduckgoing "whitney incunabulum"
RGS
RGS
17:46
what should I open up?
I got very different results
Funny enough, I don't write APL like that (except when golfing), but I do write JavaScript like that.
RGS
RGS
I never saw code written like that in a context where it should be taken seriously
So I need you to expand my mind; what is the point of writing code like that?
Making millions…
K is implemented like that.
RGS
RGS
@Adám ... of bugs?
17:49
of dollars.
RGS
RGS
I still don't understand why code like that makes you rich
It isn't that if you use such a style you necessarily become rich, but some people do become rich writing like that.
RGS
RGS
@Adám of course, but for the people that wrote it like that and got rich... did that programming style make any difference?
I think so. I find that I have a hard time keeping the code in my head when I can't see it all at once.
ngn
ngn
@RGS seeing more at once, having more context at a glance
it helps keep the big picture in your head (regardless of whether you're making millions or not)
it's an acquired taste. if you switch to this style immediately, you'll probably bounce back to "diluted" coding soon. but if you aim to simplify everything you write, you'll get there eventually.
RGS
RGS
17:56
@ngn I can understand that but I don't comprehend
Because you have more characters in front of you but can you really find what you are looking for? It feels like the code doesn't breathe
Also, when you revisit an old piece of code, can you understand it?
ngn
ngn
@RGS otherwise you'd have to scroll or search and it's easy to forget where you are
@RGS usually yes. if not, i just rtfc until i do.
If not, I just re-write it.
ngn
ngn
@Adám yes! :)
RGS
RGS
@Adám But rewriting a function implies you know what the function should do
unless you are suggesting that if ngn were to check its ngn/k implementation and didn't understand, ngn/k would have to be re-written from scratch?
Modularised code helps to only have to rewrite that part.
ngn
ngn
18:01
@RGS if i don't understand my own code, it wasn't simple enough in the first place, and it does deserve a rewrite :)
I think Arthur Whitney keeps K in a handful of files, each fitting on the screen at once. Each new version of K has one or a few of these re-written from scratch.
(Though Shakti may be a complete re-write…)
RGS
RGS
well I'm still struggling with comprehending; I have a really strong Python influence under my belt...
But I don't like code with too much whitespace too, that's no good
maybe even worse than no whitespace at all
Maybe I should have a go at this, but I certainly can't do it in Python, or can I? Python pretty much forces "readability" (in my classical sense) on you
ngn
ngn
@RGS you can aim for concise code in any language
RGS
RGS
Concise ≠ without visual layout
ngn
ngn
there could still be layout, but do you need 4 spaces for indent, for instance?
a true golfer would use 1 space in python (only because 0 won't do) :)
RGS
RGS
18:08
@ngn I think 4 is actually a nice amount of spaces.
1 is toooooo little if you are not golfing
but maybe 2 is decent
I use 2 for JS. 1 looks like a word break.
Then again, my JS has almost no inter-word spaces.
ngn
ngn
some would say that layout and the length of identifiers should match the semantic density of the language
python is a bit verbose, so you have a point about the 2 spaces
RGS
RGS
@ngn I guess that makes sense from a point of view
@ngn I guess that's why I think 1 space would look too bad; Python has plenty of keywords and everything has long names
ngn
ngn
what about apl? it's very dense, almost a golfing language
RGS
RGS
@ngn following your train of thought, 2 chars (maybe 3) would be the maximum length for a var...
no?
ngn
ngn
18:12
@RGS yes, if 1 isn't sufficient :)
RGS
RGS
@ngn I know I have 52 latin letters
But I find a single letter to not be expressive enough (usually)
ngn
ngn
that doesn't mean you shouldn't put a comment on intialisation of non-obvious variables
RGS
RGS
@ngn but then why comment it if I could just name it with a carefully-chosen word?
ngn
ngn
@RGS because you write the comment once but use the variable many times
RGS
RGS
Assuming I'm not going to use the variable 435262454352 times
ngn
ngn
18:14
well, at least twice
otherwise you can inline it
RGS
RGS
Yes. but say I use it twice or thrice
I like to use a word, maybe two in camelCase or CamelCase or snake_case (depending on the language) that document the variable
ngn
ngn
@RGS matter of taste. i'd still prefer a shorter name.
RGS
RGS
yeah sure
I know we are not discussing some ISO standard
Well, I'm going back to my really verbose Python code :-P
ngn
ngn
where would mathematics and physics be if we had to substitute even more verbose expressions in "the square of the hypotenuse is the sum of the squares of the catheti"?
economy of notation is one of the principles ken iverson followed when designing apl
why should this principle apply to primitive functions but not to identifiers?
RGS
RGS
@ngn I agree it could apply to identifiers as well; I just don't know how to, in a sensible way
I could just go over my keyboard and use the first letter that is available... but I don't know if that would be effective
ngn
ngn
18:22
@RGS when in doubt, name it a :)
@ngn I disagree on that one. When in doubt, name it _
ngn
ngn
lol
we should have a mini-poll about that :)
Roger Hui says j
ngn
ngn
no surprise there :)
I.e. why exert yourself when your right index finger is already on J?
ngn
ngn
18:27
@Adám my middle finger is longer and would travel even less to trigger a keystroke, so maybe k? :)
Don't you rest your fingers on asdfjkl;?
ngn
ngn
@Adám i do
i see what you mean, but it somehow feels like i need less force to press k. it may be just me.
RGS
RGS
@ngn (+1) on this one
RGS
RGS
18:54
@ngn when you parse APL, what kind of strategy do you use?
First you tokenize the input?
And then what happens..?
ngn
ngn
@RGS i've forgotten :) reading my own code rn ..
@RGS yes, i tokenize first, and then it's recursive descent on the array of tokens
but it doesn't have to be necessarily that way
@RGS one significant problem with parsing apl is that you either have to do it at runtime (when you know the kinds of all variables: array | fn | monadic op | dyadic op) or you should forbid changing kinds. i did the latter.
@RGS i'm sure @dzaima can share thoughts about parsing too
RGS
RGS
@ngn I'm sure there's more than one way
recursive descent is when you try to match a series of possibilities?
ngn
ngn
@RGS it means having functions like parseName(), parseExpr(), parseTerm(), etc
or n(), e(), t(), etc :)
RGS
RGS
@ngn sure :)
ngn
ngn
each function consumes something from the "stream" of tokens and returns a branch of the ast
RGS
RGS
19:08
yes; the problem I'm having is with determining what "parse_" to call; does it sound reasonable to try and call one parse_ and if it fails, call another one..?
ngn
ngn
@RGS maybe. or you could peek at the type of the current token and decide which parse_ to call based on that.
@RGS my method is to use ±regex matching. The disadvantage being it's very inefficient and i probably wouldn't suggest doing this either
possibly a good strategy would be to create a lookup table for the first/last 4 tokens?
RGS
RGS
@ngn but sometimes it feels like I need to look waaaaaaay ahead, to check for operators and for functions and for arrays and for ...
@RGS if going with something along the lines of this you only ever need to look at the "latest" 4 tokens
ngn
ngn
@RGS a single-token lookahead should be enough to parse apl (assuming variables don't change their kinds)
19:14
which I think would be a runtime error, in Dyalog at least
RGS
RGS
@dzaima you sent me that link yesterday iirc but if doing this for APL is already hard enough then reading about it in J makes it even harder :P
@ngn then I'm probably struggling with writing down the grammar :)
will have another go at it
@RGS maybe helpful is this output of what dzaima/APL does parsing expressions (if i haven't linked this too)
ngn
ngn
@RGS i have only two mutually recursive "parse_" functions in ngn/k: expr() and body() - you could look for inspiration there
or you could try to write a parser for a simplified version of apl first
eg only monadic/dyadic primitive functions and numeric arrays
RGS
RGS
@ngn I'll try to avoid reading your code as much as I can :P at least for now
@ngn yup, going with this one. I already have a very very basic one. Looking to improve it
(i should note that i haven't touched any other parsing methods (mine not really being what that J parser is either), it's very much possible that what ngn's saying makes much more sense as is all-out better)
ngn
ngn
19:19
@RGS rome wasn't built in a day
RGS
RGS
@ngn neither was my parser :)
thanks for your inputs guys, g2g for now
@Adám is there a better way to say {⍺⌊(-⍺)⌈⍵}? I feel like I'm missing something with signs and magnitudes
@AntonDyudin If you swap arguments you can write (⊢⌊⌈∘-), otherwise (⊣⌊⌈∘-⍨)
An alternative algorithm: (⊢∘××⌊∘|)
I see an APLcart entry…
ngn
ngn
there could be a better one
@ngn Maybe a -∘⌊ reduction or something?
ngn
ngn
19:27
@Adám yeah, i was gonna try ⍣2
hah (0⌈⌊) is indeed kinda close
dzaima would suggest ⌊⍢|
just reducing the duplicate ⍺ right to left makes sense
ngn
ngn
⌊∘-⍣2 seems to work
@Adám i was just writing that message :D (but yeah, are there any requirements on ⍢f other than (⊢⍢f) ≡ ⊢?)
19:33
@dzaima Not theoretically. 1∘+⍢| is "increase magnitude".
@dzaima well i guess that f⍢g has the side-effects of (f g), though that's obviously satisfied, and the behavior doesn't conflict with (g⍣¯1 (f g)), but otherwise i believe ⍢g can do whatever it wants. There's nothing in the way of me completely implementing ⍢| now too
@Adám hm, i would have to be careful to make 1∘+⍢| 0 error
@dzaima Of course, in general, needs to check its result, just like ⍣¯1
@Adám mine don't. ¯\_(ツ)_/¯
if there was syntax for it, i could allow something like g←{⎕SIGNAL 11} ⋄ g•under ← {⍶,3 4+⍵}, so that 'h' 'i' 13 14 ≡ ('hi'⍢g) 10
@dzaima I think I understand, but that may be taking it a bit far… However, J's adverse operator could possibly do something similar.
@Adám it's indeed probably too much freedom, but that's the interface under implementations are exposed to. (also that notation completely breaks down when you want to define ⍵-under-s for dops, which would need to somehow get , original , , , and the "undered" object)
19:58
should 1 ¯1 ¯1 1 ≡ 1⍢|⊢1 ¯2 ¯3 4 be allowed (i.e. the "re-sign-ing" behaves as a regular scalar function) or no?
00:00 - 20:0020:00 - 00:00

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