6 ms·
As someone who has used APL professionally to maintain a legacy codebase https://en.wikipedia.org/wiki/Write-only_language https://en.wikipedia.org/wiki/Write-o
by useful 5y ago
As someone who has used APL professionally to maintain a legacy codebase
https://en.wikipedia.org/wiki/Write-only_language https://en.wikipedia.org/wiki/Write-only_language
Anyway, I like reduce, shape, membership, find, and/or, and ceiling/floor. I actually like dealing with arrays in this way.
IMO, that is why numpy/matlab is so much better than APL.
- jonstaab 5y agoWhat is your setup like? I was just messing around with it just now using homebrew's gnu-apl package, and it just seems like a toy language, for example scripting mode is sort of bolted on top of interactive mode, since you have to add an ")OFF" command at the end of your script. How do you handle modules?
- mlochbaum 5y agoGNU APL is mostly a reimplementation of APL2 from the 80s, with some additions that in my opinion do nothing to get it out of the 80s. Dyalog has namespaces, but scripting support is only due to be released in the next version, 18.1. So I don't know of any APL that allows module-defining scripts. This is really unfortunate since there's no technical reason to prevent it. With lexical scoping (Dyalog has it, GNU doesn't), it's easy to define a module system and I did this in my APL reboot called BQN: https://mlochbaum.github.io/BQN/doc/namespace.html https://mlochbaum.github.io/BQN/doc/namespace.html .
- lokedhs 5y agoBQN is really impressive, and implements a language which is similar to APL, but without a lot of the legacy baggage that Dyalog has gathered over the years. For someone that wants to get started with array languages and does not have any need to be compatible with APL, then this is probably the best place to get started. It also has good documentation, unlike my array language. I need to put a lot of effort into it to get even close to what BQN did.
- neolog 5y agoI see it's self-hosted. How much code needs to be written in another language in order to bootstrap the whole thing?
- mlochbaum 5y agoIn Javascript it would be probably around 250 lines: the current VM is 500 but that includes extra stuff for performance, and system stuff like math and timers that aren't part of the core language. This depends a lot on the host language. BQN requires garbage collection because it has closures so an implementation in a language without it needs to include a GC. JS has a lot of conveniences like closures of its own, and the ability to tack properties onto anything, so even other high-level hosts would generally take more code.
- neolog 5y agoI'm thinking Julia could be a good fit. It's garbage collected, pretty fast, and designed for numerical work.
- leephillips 5y agoAnd Julia has APL.jl, implementing APL within Julia, with the beautiful APL characters, using string macros. This library might contain some ideas for implementing your array language.
- mlochbaum 5y agoAgree with both of you: I've been planning to do an embedded BQN for Julia (as well as finish my NumPy one), and having found APL.jl in this thread it looks like a pretty good resource. There are some missing syntax features in the compiler that I'd like to finish first. If anyone else is interested in working on a Julia VM I think this would be a pretty cool project, and a nice way to learn some of how bytecode interpreters are implemented without getting into the weeds in a low-level language. Join the forums and ask about it!
- useful 5y agovarious interpreters have ways to make external calls via com/web/etc. APL is basically python calling C++/C#/Java/etc. Seeing pure APL for XML parsing is.. interesting. Most interpreters support saved/read of functions in a more procedural way.
- sundarurfriend 5y agoA lot of people seem to have trouble with symbol-based languages, for eg. regular expressions, some parts of Perl, or APL in this case. That seems to be part of the appeal of Python too, for a lot of people, that it's unusually low on non-alphanumeric symbols. I wonder if it has something to do with "Head-voice vs. quiet-mind" [1]. I'm generally on the non-verbal quiet-mind side, and find APL-like languages very intuitive and appealing. Debugging or maintaining them doesn't feel any more difficult than more verbal languages either. [1] http://web.archive.org/web/20210207121250/http://esr.ibiblio.org/?p=8558 http://web.archive.org/web/20210207121250/http://esr.ibiblio...
- jacoblambda 5y agoI think that quiet vs verbal mind personality difference is really what separates whether people like which languages. I personally can't stand languages that are "spoken description". I understand the appeal to others but the languages just don't mesh with my way of thought. When I'm programming or building a system I'm thinking in the sense of abstract transformations and structures not in any spoken structure. Often times for me it's easier to draw out what I'm thinking of rather than explain it since there's not necessarily a verbal representation behind what I'm thinking of until I sit down and try to come up with one.
- Syzygies 5y agoThere was study of Harvard undergraduates that demonstrated Greek letters made math harder. I tell my students that Columbia undergraduates are of course smarter, but still...
- xelxebar 5y agoInteresting. I was under the impression that Iversion intended APL to also read almost like English, provided you knew the names of operators and idioms. Aaron Hsu has some talks showing this off about his co-dfns compiler.