@cannadayr In S.map(([t,i,st,l]) => e => { ... }, e should be a reference to the heap. All that function does with e is to store it, so the body shouldn't need to be changed.
It looks like I was consistent about always naming environments (and only environments) e, which is somewhat helpful. But in my version an environment is a [vars,parent] array and ge returns the vars array, which I don't call e. In your version it should just return the environment's reference, so you'll have to change these uses.
I'm fairly sure get1, case 21 (which just inlines get1), and set are the only places that use those variable arrays.
It would probably make more sense to change get1 to take two arguments instead of a 2-element array i. Then get would call get1(i[0],i[1]) instead of get1(i) but case 21 could just be s.push(get1(ge(e,num()),num())).
@ngn Probably something related to overflows. If your APL code uses `+\`, it's not precise if intermediate values overflow to floats. I think there's a check on the argument type and length that lets scan be used in some cases. It could always be used with wrapping addition, but that would require dedicated code. For a left argument of 3 specifically, I think just adding up three slices would be faster, but again it requires handling overflow.
@ngn If you have a tower of ints, you still have to worry about what happens for, say, 3+/100 100 100 where the right argument is stored as 1-byte ints.
@Marshall yeah, you're right about that. i'm plotting a change in ngn/k. this gives the programmer less control over type widths, but it's a lot more convenient.
however, there is some widest type, and this algorithm should probably be using it, so 3+/a b c would overflow exactly when a+b+c overflows
but anyway, even implementing n+/ (for an odd n) simply in terms of stencil should make it faster, e.g. a magic fn like {k←⌊⍺÷2⋄k↓(-k)↓{+/⍵}⌺⍺⊢⍵}
@ngn Roger probably implemented the wraparound sum algorithm for Stencil then (Stencil has a ton of special code, but it tends to be too narrow to rely on). Should be possible to use it for +/.
I was invited to Iverson College once. I was looking forward to seeing Whitney there, but sure enough, he cancelled last minute because he had some kind of break-through, with kOS I think.
@phantomics Which to me very much lacked the recognition that occasionally non-APLers produce something worthwhile. Great to see so much of the community get together but there was a definite "we are the best, and how come no one will admit it?" vibe.
@Marshall Yeah, I think the involved very much shone with the philosophy that causes newcomers to eventually conclude that "APL is bad at cooperating with the outside world".
We need a free open source implementation of a rationalised APL, built from the ground up upon a modern environment.
I've been considering ways to build a community around all the "exotic" languages, including the vector family, Lisp, Haskell, Smalltalk, Prolog etc.
When I presented April at LispNYC a few months ago, many attendees had experience with APL and K; openness to one "unusual" language seems to predict openness to others
A more nuanced criterion comes from a concept I had of "two schools of software"
Languages like Fortran and C were designed by starting with a machine that could do certain things, and then creating a language to make those functions accessible to programmers
Languages like Lisp and APL started by creating a language according to an abstract concept of representing computation and then implementing that language concept with physical hardware
@phantomics Isn't COBOL exotic? The only reason I think it might not be worth studying COBOL (and I'm definitely not sure of that) is that it was heavily used for a good while and most of the useful parts have probably diffused into the programming world at large.
Roughly my thinking is that an "exotic" language should have design features that would seem unfamiliar and unusual to a typical programmer, and COBOL definitely fits that. Of course there are different levels and COBOL is only as exotic as something like Smalltalk and probably a little less than Lisp.
Makes sense. An exotic languages community would offer something new and different for programmers who don't know them and give veteran users a chance to shine, COBOL devs who worked at the big banks would have interesting war stories
@phantomics It would be interesting to pick a language and set a fairly large task for the group, and then discuss how it went and the questions that went up. Something like asynchronous-pair programming sections of the project but bringing disagreements or discoveries to group discussion. That would require a very friendly/relaxed group to not have issues though.
In the ideal case you could even end up contributing a useful library or something to that language.
@ngn The idea of a task is to "get inside" a particular language that's chosen at the beginning by the group, not judge how to make a good language or which language is better or anything like that.
I have professional recording equipment I've been using for livestreams and also the April presentation, which went really well, doing interviews with people could be interesting if I can get a steady stream of them, like once a month
The other element of the community could be discussion groups to do challenges like what Marshall described
@Marshall Agreed, I thought overall it was more like a family reunion than something actually about APL, which is probably great if you've been in that scene for decades but not so much otherwise
Yeah, same here. Roger actually focused exclusively on Ken, and that was a really nice part. (Though it annoyed me that he was so obviously reading a manuscript, I'll excuse him, because he's basically already written all these memoirs down.)
This parallels lots of arguments about lots of subjects too, btw. They'll always find another bad argument. Sometimes, you can even make people admit that even if you could counter that argument, they'd still not accept/do/reject [subject].
I find whenever I post APL to do with advent of code for example a reaction I get is 'how on earth do you type that?!?!? do you have to copy paste everything?!?!' but they will happily install an additional keyboard for typing lots of other stuff, particularly to do with language, but the idea of doing it for programming is unthinkable
> Criticisms of APL Eco-Systems Poor libraries & poor library support in the language Insufficient training materials and samples Closed, ageing community "Corporate" rather than "Hacker" vibe
@Adám this is entertaining because lisp has absolutely none of those besides no type declarations yes people sometimes still make bad arguments against it
@Adám i must be one of those people :) half-agree with: Weird Symbols, Operators vs Functions, and totally agree with: Dynamic Scope / Global by Default
A part I've found difficult is how accretive APL is; like if you start from the APL/360 manuals there's easier "hooks" to grab onto than with modern APL
Interesting. We keep getting (apparently) very positive feedback for it, despite it being so outdated and an eyesore. I was tasked with porting the content, but it is less than trivial.
The dialog between "APL creators" is a good way to expose the thinking behind language, it strikes just the right balance between technical and whimsical
Most language tutorials are super dry, but then some overcorrect and become nauseating in their attempt to be quirky and relatable, "Why's Guide to Ruby" exemplifying the latter
Sounds good. I'm taking off soon, but one more thing
I'm going to run the exotic languages community idea past some others and see what they think, does anyone have relative preferences for what kind of content venue they'd like? Videos/blog/chat/message board ?
@coltim I find APL/360 has a lot of great stuff that started to become diluted in the APL2 era.
And for those interested in talking about what makes a good APL(-family) tutorial, I'd still really appreciate feedback on the BQN tutorials that I've written so far.
@rak1507 What behaviour would you expect if the language gains a new glyph, and you then try to run old code that defines a glyph, in the new language engine?
Hmm. I didn't mean to wade in on things, especially given the occasion. So far I've approached APL (and array languages in general) from a relatively pragmatic position, which, regardless of merit, probably makes me not the most qualified person to ask. But, carrying that forward, I think that redefining builtins likely has limited utility (e.g. the whole "in python, redefine True as False to mess with your coworkers")
@rak1507 i think you should start using the "reply to this message" button. it's not clear what you're replying to when there are >1 simultaneous conversations
In principle, you can even trap errors and analyse the executed code, to extend the language. I used to do that in APL*PLUS to enable "direct definition" (a precursor to dfns).
Hm, I can't seem to find that video with John Scholes where in the middle of his presentation, a number is printed to the session, something he cannot explain. Later on, he has ⎕DL on a negative number, and then he understands!