@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?
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..
@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 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.
@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.
@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 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.
@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!
/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
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?
@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?
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.
@Adám I think it'd be plenty useful to have a setting to make just0∊⍴ arrays print in a fancier format, Dyalog's whitespace spam is just completely utterly pointless & very much unreadable and unusable.
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.
@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.
@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").
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.
@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)
@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)
@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.
@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)
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
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, 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.
@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.
@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
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
First, 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...
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.
@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.
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.
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
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 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
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..?
(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)
@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
@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)