18 ms·
Try APL
- cochne 5y agoSeems nice in theory, though I'm immediately turned off by having to reach for special characters not on my keyboard.
- detritus 5y ago⍨
- mirekrusin 5y agoJulia solves this very gracefully with LaTeX-like input, ie. you type \lambda<TAB> which expands to λ
- Wezl 5y agoSome APL environments such as ngn/apl[0] allow tab completion like |o<tab> results in ⌽. This is probably available on tryapl.org too, but I can't test it when it's down :/. It may also be available in the full dyalog apl product and IDE. EDIT: see https://news.ycombinator.com/item?id=27462828 https://news.ycombinator.com/item?id=27462828 too [0]: https://github.com/abrudz/ngn-apl https://github.com/abrudz/ngn-apl
- augustk 5y agoTo avoid this you typically use a character keymap with APL characters accessible with AltGr and Shift+AltGr, for instance AltGr+i for iota and AltGr+r for rho etc. After a while you learn the keystrokes and if you need a less frequently used character you can click on it in the language bar.
- melling 5y agosomeday soon we’ll be able to use voice input to say these characters. Of course, I’ve been wrong for about a decade. but we have to be getting close
- leephillips 5y agoI’m glad I work at home.
- b2gills 5y agoYou can if you put in the work to set it up. There are two (nearly identical) talks by Emily Shea - Perl Out Loud https://www.youtube.com/watch?v=Mz3JeYfBTcY https://www.youtube.com/watch?v=Mz3JeYfBTcY - Voice Driven Development: Who needs a keyboard anyway? https://www.youtube.com/watch?v=YKuRkGkf5HU https://www.youtube.com/watch?v=YKuRkGkf5HU
- tosh 5y agoIf you want to learn more about array programming languages there is a new podcast series at https://www.arraycast.com https://www.arraycast.com with some banter, philosophy, history and a collection of related resources https://www.arraycast.com/resources https://www.arraycast.com/resources
- olodus 5y agoFound it when their first ep was posted here on HN a few months ago. Had seen array langs before but never dared to sit down with them. Their pod made me take the plunge. These langs are fascinating. As someone who likes func programming normally it feels related but with reduce on steroids.
- NextHendrix 5y agoAre there companies still producing modern keyboards with APL in mind? I like the idea but can't see how it would be practical with a normal keyboard.
- tosh 5y agoIt looks like Dyalog are selling keyboards > A different keyboard is not required to enter Dyalog glyphs. However, if you would like one, Black Cherry G80-3000 keyboards with Dyalog glyphs engraved are available in UK, US, DE and DK layouts. USB and PS2 adapters are included. The keyboards have been tested using both Microsoft Windows and Linux https://www.dyalog.com/apl-font-keyboard.htm https://www.dyalog.com/apl-font-keyboard.htm I wonder if there are keyboard sticker sets available somewhere. I think I've seen some in the past for video editing software.
- sidpatil 5y agoUnicomp was selling them for a while, if I remember correctly. I don't see them on their website anymore though (but maybe I didn't look hard enough.)
- bombcar 5y agohttps://www.pckeyboard.com/page/product/USAPLSET https://www.pckeyboard.com/page/product/USAPLSET - they seem to still have it - or at least a keyset. You can order it custom also: https://www.pckeyboard.com/page/product/KBDCFG https://www.pckeyboard.com/page/product/KBDCFG - US APL.
- the_only_law 5y agoYou can still get them, only on certain keyboard though. I want to say you can purchase the individual key caps as well.
- the_only_law 5y agoThis was initially downvoted, perhaps because I didn’t post confirmation , so in case no one believes me: https://www.pckeyboard.com/page/product/KBDCFG https://www.pckeyboard.com/page/product/KBDCFG - choose a color and than select Language -> US APL https://www.pckeyboard.com/page/product/USAPLSET https://www.pckeyboard.com/page/product/USAPLSET - keycaps https://www.pckeyboard.com/page/product/00UA41P4A https://www.pckeyboard.com/page/product/00UA41P4A - premade
- armonge 5y agoI can't be the only who though Alexa Presentation Language
- cupofjoakim 5y agohehe, just clicked "2 + 2" followed by pressing enter and got SERVER ERROR. HN hug of death, I presume? Otherwise either me or the tool is very bad at math.
- TimTheTinker 5y agoI assure you, APL is not bad at math. It's been around almost as long as COBOL. https://en.m.wikipedia.org/wiki/APL_(programming_language) https://en.m.wikipedia.org/wiki/APL_(programming_language)
- useful 5y agoAs 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?
- zelphirkalt 5y agoGot a server error trying a few examples from the shown tutorial: ~~~~ TryAPL Version 3.4.5 (enter ]State for details) Thu Jun 10 2021 14:30:06 Copyright (c) Dyalog Limited 1982-2021 2 + 2 4 4 2 3 + 8 5 7 12 7 10 ⍳100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 !10 3628800 +/⍳10 55 +/⍳10 SERVER ERROR ~~~~
- SamBam 5y agoYeah, I'm guessing Hug of Death.
- Jtsummers 5y agoIf APL interests you, I worked through (most of) Mastering Dyalog APL [0] a while back. It is very well paced and organized. The vast majority of it also works with GNU APL, though not all. [0] https://www.dyalog.com/mastering-dyalog-apl.htm https://www.dyalog.com/mastering-dyalog-apl.htm
- vlmutolo 5y agoEverything here is pretty easily accomplished using vanilla Python (numpy counts as vanilla at this point). I'm having trouble seeing what the advantage is of an "array-based" language over a well-designed array library like numpy. import numpy as np from collections import Counter print(2+2) print(np.array([4,2,3]) + np.array([8,5,7])) print(np.arange(1,11)) print(np.arange(1,100001).sum()) print(np.arange(1,11).prod()) avg = lambda x: x.sum() / x.shape[0] print(avg(np.array([1, 6, 3, 4]))) throws = np.random.randint(1, 7, size=(10000,)) print((throws == 1).sum()) print(Counter(throws)) print(Counter("Mississippi"))
- busterarm 5y agoTerseness and composability. Here: https://medium.com/@jansson.sebastian/apl-in-the-eyes-of-a-python-programmer-7b1b955f7134 https://medium.com/@jansson.sebastian/apl-in-the-eyes-of-a-p...
- bombcar 5y agoIt's interesting how many programming languages seem to have "accessible to those not trained in it" as a design goal (offhand I can think of SQL and COBOL, but also BASIC and you see it even in Python, etc). But there are trade-offs doing that, and "amount you can look at at once" is a huge one.
- busterarm 5y ago"amount you can look at at once" is severely underestimated.
- yiyus 5y agoThis. What I find really annoying is how many people confuse this property ("accessible to those not trained in it") with readability.
- bombcar 5y agoIt's a shame, too, as the most "dense" recent language we had was perl and that got universally made fun of as "line noise" - which I feel influences people more than they think.
- zwieback 5y agoIn the 90s I installed an optical CMM at an IBM plant and they had PCs with APL keyboards sitting in the clean room. I was impressed that they would use something like that in a production area, not really sure what they did with it but the keyboard looked very impressive. I think without the special keyboard APL is a no-go these days.
- TacticalCoder 5y ago> I think without the special keyboard APL is a no-go these days. Unicomp, the company who bought the rights and tools for the venerable IBM Model M keyboards, do still sell to this day both IBM Model M keyboards and sets of APL keys (!). https://www.pckeyboard.com/page/product/USAPLSET https://www.pckeyboard.com/page/product/USAPLSET
- deleted 5y ago[deleted]
- pradn 5y agoWould APL work as well with the unusual symbols replaced by keywords? Any with APL experience know?
- tazjin 5y agoThere's J, which doesn't use the random Unicode things: https://en.wikipedia.org/wiki/J_(programming_language) https://en.wikipedia.org/wiki/J_(programming_language)
- Jhsto 5y ago> Would APL work as well with the unusual symbols replaced by keywords? Hot take: take a look at numpy. In general, I would say no. One of the main points is that the notation is terse so that the experienced readers can at a glance see what is going on. Notation as a tool of thought, and all that.
- robomartin 5y agoNo. The power of notation is significant enough that you would lose a lot. Someone mentioned J. It’s an abomination. Iverson made a huge mistake taking that path and likely contributed to APL’s trip into becoming a curiosity. I have written about this before on HN. Context: I used APL professionally every day for about ten years and was quite active in the community at the time.
- sswezey 5y agoIt what ways is J an abomination? APL (and to a degree J) are on my bucket list of languages to learn. I’d always read that J was a sort of spiritual successor to APL.
- rscho 5y agoHe holds a grudge against J, but not everyone does. I write research code in J and it's a very good little language. For instance, scripting is much easier in J. (Dyalog) APL is much more like an APL machine (in the sense of the LISP machine).
- 5y ago
- mlochbaum 5y agoSince this seems to have brought TryAPL down, there are other options listed at [0]. In particular, ngn/apl[1] is a JavaScript implementation and runs client-side. But it's limited relative to Dyalog (used on TryAPL) and no longer under development. [0] https://aplwiki.com/wiki/Running_APL https://aplwiki.com/wiki/Running_APL [1] https://abrudz.github.io/ngn-apl/web/ https://abrudz.github.io/ngn-apl/web/
- dang 5y ago> Since this seems to have brought TryAPL down Apparently that always happens: Try APL in your browser - https://news.ycombinator.com/item?id=9774875 https://news.ycombinator.com/item?id=9774875 - June 2015 (27 comments) Try APL online - https://news.ycombinator.com/item?id=4090097 https://news.ycombinator.com/item?id=4090097 - June 2012 (4 comments)
- patrickthebold 5y agoThe main reason I want to learn APL is for the white-boarding exercises during interviews. Most places will let you write in your strongest language.
- haskellandchill 5y agoHaha using APL in interviews (outside of finance) would be legendary.
- randomswede 5y agoWhen I was more regularly doing coding interviews, I would pick a problem suited for the strengths of the candidate's self-identified strongest language, but basically go "use whatever language you want, but beware that if it's not one of <short list>, I will have to transcribe your code and run it for the final assessment". I had Haskell, OCAML, and Ruby thrown at me (no, none of those were on the list). None actually ran on the first try, but I could rehab the Ruby to working (it was a silly mistake, only a small amount of score knocked off), but I could not rehab the Haskell nor the OCAML, so that ended up with a "recommend no-hire". Bit of a shame, had they chosen the Python that the CV indicated they preferred, it may well have been a "strong hire" (but, failure to produce runnable code, that can't be easily fixed, in a language explicitly recommended against indicates that there are some possible red flags).
- haskellandchill 5y agoBit of a shame? It was your decision. I don't see that as a red flag unless the candidate had time to produce running code on their own development setup. In a timed interview producing running code is irrelevant in my opinion, but hey you chose your rules and got your results.
- gaogao 5y agoYes, but go with something too far off the beaten path and you just get https://aphyr.com/posts/341-hexing-the-technical-interview https://aphyr.com/posts/341-hexing-the-technical-interview, which while really fun, doesn't get callbacks. (I've always wanted to try doing a white-boarding interview in a visual language like Scratch)
- mamcx 5y agoThis little thing caught my interest: APL takes care of binary-vs-decimal inexactness too, so 3×(1÷3) is really 1: 3×(1÷3) How is this done? How well it scale? I suppose well, because APL is good for math, rigth? But then I remember that must be slow...?
- gugagore 5y agoTo be honest, I don't know what that claim means, but know that `(1 / 3) * 3` is exactly 1 under plain-old IEEE floats. The "fun" is with, e.g. `0.1 + 0.2`. I just tried on the website 0.1 + 0.2 - 0.3 2.775557562E¯17 which agrees: julia> 0.1 + (0.2 - 0.3) 2.7755575615628914e-17
- deleted 5y ago[deleted]
- mlochbaum 5y agoThat must be a reference to tolerant comparison, but the way it's written is bizarre. Comparisons in APL are (optionally: you can turn it off) subject to tolerance, meaning that numbers with a small enough difference are treated as equal by comparison or search functions. There are probably better resources but I describe it at [0]. However, Dyalog just uses IEEE doubles (with an error in place of infinities or NaNs; also you can configure to use higher-precision decimal floats), no different from JavaScript. The result of, say, 0.1+0.2, is not the same as 0.3, it's just equal under tolerant comparison. [0] https://www.dyalog.com/blog/2018/11/tolerated-comparison-part-1/ https://www.dyalog.com/blog/2018/11/tolerated-comparison-par...
- bostonsre 5y agoIt was used heavily for legacy trading and accounting applications at a fortune 50 company that I worked at early in my career. I don't recall any performance discussions at the time, but we were processing a large chunk of money on a handful of expensive ibm power pcs.
- 7thaccount 5y ago
- BiteCode_dev 5y agoI suppose if arrays language get popular enough, we will get a module to use them as a DSL for libs like numpy, just like we have regex for strings, instead of a whole language dedicated for them. It would be a win / win, you gain the strength of J, K and APL for array processing, without the weakness of them for anything else. And just like with regex, you'll get fat disclaimers in doc telling you to not get carried away too much as it can quickly become unreadable.
- gugagore 5y agoThe regex DSL only works for strings. I lament that I cannot use something regex-like to match general sequences, e.g. a sequence of tokens, instead of only strings (sequence of characters). The operations could be the same. There are classes, and operators for matching 0, 1, or more repetitions, etc. Array languages are powerful especially when you have arrays with arbitrary elements, including arrays themselves. Good luck using a regex DSL to match a sequence of strings, where you might want to define a string class (analogous to a character class) as a regex itself.
- mumblemumble 5y ago> I lament that I cannot use something regex-like to match general sequences, e.g. a sequence of tokens You can. It's not typically built into a programming language's standard library. But there are plenty of general-purpose automata-building libraries out there, and some of them do provide DSLs. At least to the extent that the regular expressions you're using are actually regular (many aren't), all a regex is is a domain-specific specialization of nondeterministic finite automata. I sometimes lament that I don't see them, or hand-coded automata, more often. This was CS101-level stuff when I was in college, and it's pretty easy to code your own even if you don't have a good library available in your language. And, for problems where they're appropriate, using them typically yields a result that's simpler and easier to maintain than whatever ad-hoc alternative you might see instead.
- hcarvalhoalves 5y agoThere are a few, here's one: https://clojure.org/guides/spec#_sequences https://clojure.org/guides/spec#_sequences
- JacobiX 5y agoI really like APL but I cannot imagine myself depending on a closed source tool-chain. I've heard that the GNU APL is order of magnitude slower than Dyalog APL, but I can't find a benchmark to confirm that.
- mlochbaum 5y agoNot to claim any are better than Dyalog, but there are options: https://aplwiki.com/wiki/List_of_open-source_array_languages https://aplwiki.com/wiki/List_of_open-source_array_languages . I think dzaima/APL and April are both all right. Personally, I think GNU is not a good design: for example it has no lexical scoping or even control structures, essentially requiring you to use goto for program control. BQN is my own effort and I would say it has more serious ambitions than these. If you're not attached to the APL language specifically, I'd take a look.
- deleted 5y ago[deleted]
- moonchild 5y agoYes, GNU APL is quite slow. There was some primitive implemented in GNU APL (as part of the interpreter, in c). A pure-APL implementation running on dyalog outperformed it by a considerable margin. If you're looking for a performance, opensource APL, try j. Though if performance is not a priority then, as the sibling says, dzaima/apl or april should be more than adequate.
- 5y ago
- sondr3 5y agoI had a blast learning to write and read APL for a course at my university where we chose and presented the papers from HOPL IV. If you want a fairly quick and easy read about the history of APL I can heartily recommend the paper "APL Since 1978". A small taste: `twoSum ← {1↑⍸⍺=(⍵∘.+⍵)}`, a dyadic function to find the indicies of (the) two elements in an array that sum to ⍺, for example: `9 twoSum 2 7 11 15` will return `0 1`. Though I doubt I'll ever write any larger programs with it, I've had a lot of fun with it.
- haolez 5y agoI've heard that R is an array language. Can it compare with the likes of APL?
- gmfawcett 5y agoThe closest language to APL/J/K is NumPy, the numerics library for Python. It was deliberately designed in the spirit of an APL, but without all the squiggly characters.
- goatlover 5y agoJulia has builtin language support that kind of array handling, including broadcasting.
- leephillips 5y agoYes, there are a handful of languages where you can operate on arrays (without looping), including Fortran. But this doesn’t make them true array languages like APL.
- mbauman 5y agoNote that Julia has explicitly[1] taken much inspiration from APL to a further degree than NumPy does IMO. 1. https://github.com/JuliaLang/julia/search?q=apl&type=issues https://github.com/JuliaLang/julia/search?q=apl&type=issues
- no-s 5y ago> but without all the squiggly characters I so liked the APL squiggly characters (mostly Greek letter based glyphs). Made for very succinct code. Combined with right-to-left precedence resulted in very low overhead to write and read code. Most people who complained about it APL as “write-only” seemed to be outside the community of serious APL programmers. Once you learned to read the language it was very easy to comprehend at regular reading speed... In contrast NumPy seems absurdly wordy, and waiting for the completion menu in an IDE tends to derail my train of thought. However I do tend to like NumPy for being APL-like, so it’s not a damning contrast as far as getting things done.
- he0001 5y agoAPL is something that has been on my TODO list for a long time. To me it’s tantalizing to express a problem with pure symbols instead of a mix of it. While APL is cool I’ve always felt that coding languages are mostly wrong. Also natural languages also feels blocky, inefficient and sometimes alien.
- jpmattia 5y agoLast used APL in 1981; We had keyboards specialized for the APL char set. IMO Its pithy syntax was just not worth it, even back then, so haven't returned since and don't see any reason to break my 40 year hiatus.
- beagle3 5y agoAPL's greatest contribution is its semantics, not its syntax. (Some parts of the syntax are brilliant and would be awesome if adopted by modern languages. Others ..... not so much).
- throwaway17_17 5y agoWhich pieces of APL would you see fitting in a modern language? Simply curious about preferences of people who already enjoy the semantics and would find the APL syntax ideal.
- Wezl 5y ago(not parent) personally I would like to see [trains](https://aplwiki.com/wiki/Tacit_programming#Trains https://aplwiki.com/wiki/Tacit_programming#Trains) in more languages, though the way they are implemented in APL is pretty spotty (e.g. the length of a train changes its semantics)
- beagle3 5y agoI think adopting the “each” syntax would help every language that has containers - including Python and C# It is semantically more like “map” than “foreach”, but syntactically emphasized the applied function rather than the fact that it is applied to the container - and that shows especially when nested - f””x or f”[2]x means “apply at depth two”. Compare that to a nested map/foreach There are other syntax features I like, but most of them do interact with semantics (some more, some less). This one is useful in any language.
- papito 5y agoTopical! One of the most recent Corecursive episodes has a guest with a fascinating take on APL, while the episode is completely unrelated. https://corecursive.com/065-competitive-coding-with-conor-hoekstra/ https://corecursive.com/065-competitive-coding-with-conor-ho... Get yo actuary tables on.
- agbell 5y agoThanks for sharing! A question I had with APL was how do you actually type it in, and it turns out you just use a back-tick as a prefix, like a leader key in vim. Conor walked my through solving something with TryAPL in this video: https://www.youtube.com/watch?v=lG-CcPb7ggU https://www.youtube.com/watch?v=lG-CcPb7ggU
- Avshalom 5y agoYou can also set it as an altlayout on your keyboard. I'm on linux so I set it to holding Winkey switches to APL.
- elwell 5y agoHas anyone used APL to implement web frontend? In the GOL example it shows how to use ⍴ to reshape into a matrix and then use ↑ to pad it out, and then the structure is displayed in the console. I'm imagining some kind of declarative JS+CSS frontend framework where the APL-ish source code maps intuitively to the visual representation in the DOM (or canvas).
- razetime 5y agoI doubt there is one. I know of Dyalog's backend and web service frameworks, but I don't think there has been a use of APL's notation for HTML/CSS/JS programming.
- lwhi 5y agoHow do you key the ⍳ character easily?
- Jtsummers 5y ago`i on this site. If you use another editor (including, I believe, Dyalog's actual APL implementation, but I always used emacs when I was playing with APL) you can change the prefix character. I always preferred . because there is no reaching for the character (on the Dvorak layout at least) and it doesn't conflict with much other than decimal numbers (where you may need to type .. to get the desired result).
- mlochbaum 5y agoUse `i to get it. If you hover over the character in the language bar at the top, the text shown has some indications of how to type it. Here, "Prefix: <prefix> i", with the prefix being a backtick. The version with a tab afterwards is longer but could be easier to remember for some characters.
- deleted 5y ago[deleted]
- Heliosmaster 5y agoIf you are interested in trying APL in an interactive notebook, try it here: https://nextjournal.com/try/mk/dyalog-apl https://nextjournal.com/try/mk/dyalog-apl
- cardanome 5y agoDoes anyone know of an input method for APL that works similar to an IME that you would use for Japanese? Basically you type the name of the operator in latin characters and get the proper symbol autocompleted. I only see direct key to symbol mappings which might be fine for a full time APL dev but offer a bit too much of a learning curve for just trying it out.
- Jtsummers 5y agoThe linked site uses a couple methods: `i => ⍳ (iota) ii<tab> => ⍳ In some editors you can change the prefix character (in emacs I think the default is . or I changed it to . almost immediately). Also in emacs (though I didn't try this with APL) you can use an entry method based on TeX so if you type: \iota You will get ⍳
- abrudz 5y agoThe RIDE interface (https://github.com/dyalog/ride https://github.com/dyalog/ride) allows you to type double-backtick and then a search word. Screenshot: https://i.imgur.com/kagYC73.png https://i.imgur.com/kagYC73.png
- WorldMaker 5y agoThe Windows emoji keyboard (Win+. or Win+; whichever is more comfortable for you) has a lot of the Unicode math symbols under its Symbols tab (marked with an omega). It has a pretty good IME-ish type to search experience for regular emoji, but doesn't support type to search under the Symbols tab. (I wish it did and hope it is something they consider adding.)
- keutoi 5y agoEmacs has a good quail-completion system for `GNU-APL`.
- lokedhs 5y agoI'm taking the opportunity to mention my project that implements a language that is inspired by, and is mostly compatible with APL. It has some major differences, such as being lazy evaluated and providing support for first-class functions. It also supports defining syntax extensions which is used by the standard library to provide imperative syntax, which means you can mix traditional APL together with your familiar if/else statements, etc. At this point there isn't much documentation, and the implementation isn't complete, so I'm not actually suggesting that people run out to try it unless they are really interested in APL. I just took this opportunity since APL is mentioned so rarely here. https://github.com/lokedhs/array https://github.com/lokedhs/array There is an example of a graphical mandelbrot implementation in the demo directory, that may be interesting.
- shrubble 5y agoThere is Aplette which supposedly integrates nicely with other Unix tools. It's a port/update of the earlier openAPL source code, which I think was done by Ken Thompson? Here: https://github.com/gregfjohnson/aplette https://github.com/gregfjohnson/aplette
- neopointer 5y agoI once used a (very bad) tool called Mediation Zone [0], and they used APL as a scripting language inside of the tool. Worst experience ever. [0] https://www.digitalroute.com/mediationzone/ https://www.digitalroute.com/mediationzone/
- 7thaccount 5y agoIt seems like they're very successful from their website. What was bad about it? I would personally love to have a built-in APL scripting language for interacting with data.
- jacoblambda 5y agoBased on the other comment, it looks like it's another language that happens to shorten down to APL in name rather than APL "A Programming Language". It looks like some internal Java derivative language which sounds like could be rather painful if not done well.
- 7thaccount 5y agoOhhh gotcha. Yeah, I'd hate to use just a crappy Java. I think either Salesforce or SAP does something similar.
- abrudz 5y agohttps://www.artinsolutions.com/competencies/mediationzone%C2%AE/ https://www.artinsolutions.com/competencies/mediationzone%C2... says "Business logic of these agents is defined in APL – Application Definition Language, which is based on Java language." which doesn't sound like the APL I know. https://careers.digitalroute.com/jobs/98847-implementation-consultant https://careers.digitalroute.com/jobs/98847-implementation-c... has a code sample (https://stuffthatiliketoshare.files.wordpress.com/2014/07/notepad.png https://stuffthatiliketoshare.files.wordpress.com/2014/07/no...) which does not look like APL at all.
- Syzygies 5y agoIn the mid-seventies at Swarthmore College, we were mired in punched card Fortran programming on a single IBM 1130. The horror, a machine less powerful than the first Apple II. My job six hours a week was to reboot after each crash. People waited hours for their turn to crash the machine. I let a line form once people had their printouts. I'd find the single pair of brackets in a ten line listing, and I'd explain how their index was out of bounds. They thought I was a genius. Late one Saturday night, I made a misguided visit to the computer center while high, smelled sweat and fear, and spun to leave. Too late, a woman's voice: "Dave! I told Professor Pryor he needed you!" We didn't know that Fred Pryor was the economics graduate student freed in the 1962 "Bridge of Spies" prisoner exchange. Later he’d learn that I was his beagle’s favorite human, and I’d dog-sit to find steaks for me I couldn’t afford, but for now I feared him. So busted! Then I heard this voice “See these square brackets? See where you initialize this index?” He was spectacularly grateful. One cannot overstate the rend in the universe that an APL terminal presented, catapulting me decades into the future. I quickly dreamed in APL. For $3 an hour for ten hours (a massive overcharge) I took a professor’s 300 line APL program translated literally from BASIC, and wrote a ten line APL program that was much faster. One line was classic APL, swapping + and * in an iterated matrix product for max and min. The other nine lines were input, output. The professor took years to realize I wasn’t also calling his code, then published my program. Summer of 1977 I worked as a commercial APL programmer. Normally one never hires college students for the summer and expects them to be productive. The New York-based vice president was taking the train every day to Philadelphia because the Philly office was so far underwater, and desperate to try anything to save himself the commute. He knew Swarthmore had a terminal, and heard about me. At my interview I made a home-run derby of the questions from the Philly boss. The VP kept trying to intervene so he could put me in my place before hiring me. The tough questions were “dead key problems”. How do you write the following program, if the following keys are broken? Our client was a mineral mining company, our task a reporting system. The reports were 2-dimensional projections of a 9-dimensional database. The accountants wanted all totals to be consistent across reports, and to be exactly the sums of their rounded components. I broke the news to our team that we needed to start over, rounding the 9-dimensional database once and for all, before generating each report. This took a few weeks; I wrote plenty of report generation helper routines. My coworkers overheard me say on a phone call that I was being paid $5 an hour, and at the time I didn’t understand which way they were shocked. I didn’t have much to do, the rest of the summer. The mining company VP found me one morning, to ask for a different report, a few pages. He sketched it for me. He found me a few hours later to update his spec. He loved the printout he saw, imagining it was a prototype. “It’s done. I can make your changes in half an hour.” At a later meeting he explained his own background in computing, how it had been key to his corporate rise. Their Fortran shop would take a month to even begin a project like I had knocked off in a morning, then weeks to finish it. He pleaded with me to pass on Harvard grad school and become his protege. Some Lisp programmers had similar experiences, back in the day. Today, APL just sounds like another exotic language. In its heyday it was radical.
- einpoklum 5y agoIt's not the same without a decent APL keyboard :-( Even for the on-screen keyboard - at least make it have a few rows, not everything on a single row. Jeez.
- barbazoo 5y agoHow practical is a language that uses all these non-ascii symbols? Do developers remember the alt-codes or do they use visual IDEs like the one OP linked or maybe even special keyboards?
- naikrovek 5y agoThere was an APL keyboard. And, the APL interpreter/compiler was weird. if you typed an F followed by a backspace, followed by an L, it would merge those into an E, as if they were typed on top of each other, like a typewriter.
- besnn00 5y agoMakes sense because some special functions were meant to be expressed as a combination of symbols. Natural logarithm was ○, backspace, star ; circle was used for logarithms and star was used for both exponentiation and the constant e.
- lanstin 5y agoBack in the day it was special keyboards. (Source I had an internship in 1984 or so, and at night I could use the mainframe for fun. I wrote a calculate digits of Pi with APL program. I had a slowly converging algorithm and the machine despite being bad ass was quite a lot smaller than my iPad, but it was awesome. I did have a deep maths background so was used to at least all the Greek letters).
- dharmaturtle 5y agoIf I were to use a language like this, I'd use AutoHotKey to map certain strings to symbols. I already have several, e.g. α = qalpha β = qbeta ↑ = qup ∀ = qall ¬ = qnot Since you read code more often than you write it, I think it is actually preferable to work with a language like this.
- anthk 5y agovi/nvi/vim has the :ab command with does literally that on typing. In ~/.exrc/.vimrc ab qalpha α ab qbeta β ab qup ↑ ab qall ∀ ab qnot ¬ Also, for rlwrap users: https://github.com/utkarshkukreti/apl-inputrc https://github.com/utkarshkukreti/apl-inputrc
- truth_ 5y agoI recently listened to this podcast episode titled CORECURSIVE #065 From Competitive Programming to APL With Conor Hoekstra[0]. I learned a lot things there. I highly recommend it. [0]: https://corecursive.com/065-competitive-coding-with-conor-hoekstra/ https://corecursive.com/065-competitive-coding-with-conor-ho...
- hhyndman 5y agoBack in university (1974), I took a course in AI. The prof wanted us to write a brute-force solution to solve the 8-queens problem -- any language! I wrote the solution in APL in about an hour and it only had 3 lines of code. The rest of the class spent days on their terminals and keypunches trying to solve it. Most solutions took hundreds of lines of code. I got a D from my professor. I questioned why and was told that it was unreadable, and that the solution was inefficient. This annoyed me because he didn't know APL, and I figured that since I solved the problem in one hour, while the rest took days, it was very efficient. I protested the result with the department head (who liked APL) and ended up getting an A+. As you can imagine, all the rest of my assignments, written in a variety of languages, were graded by that AI prof with significant prejudice. I passed nonetheless. I loved APL and ended up working for one of the major APL providers as my first job out of school.
- coopreme 5y agoGreat story, it’s stories like these that make me still hold onto my undergrad work (as bad as it is). Maybe one c#, Visual Basic, asp, php, t-sql and other esoteric projects will be looked at as relics of the past.
- S4M 5y ago> I got a D from my professor. I questioned why and was told that it was unreadable, and that the solution was inefficient. That is such a bad faith argument, how can a brute force solution be efficient or inefficient?
- jiggawatts 5y agoConstant factors, heuristics, memory usage, etc... There was a discussion on array programming languages here recently where someone proudly showed off a K language solution to a simple problem, stating that the K solution was efficient because it could solve it in 1.2 microseconds. I used Rust to solve it in 5.5 nanoseconds, which is nearly 200x faster. Both used "brute force" with no cleverness, but there's "bad" brute force and "good" brute force. I've had a similar experience at university while using Haskell. It's a very elegant lazy pure functional language, but it's glacially slow. The natural, low-friction path is very inefficient. The efficient path is unidiomatic and verbose. I hear people making similar observations about F# also. It's fast to program in, but if you also need performance then it is no better than more mainstream languages -- in fact worse in some ways because you're "going against the grain".
- IOT_Apprentice 5y agoI'm curious why there was not larger adoption of this language and why it was lost by the wayside. One of the commenters mentioned that the symbology made it alien to average folks who did not have the background in that notation. That appears to imply that the domain learning curve was too steep for the folks who don't "think" in that fashion. Hmmm.
- 7thaccount 5y agoI think some linear algebra knowledge certainly helps a lot, so that's a good point. A lot of APL doc talks about concepts such as "Rank" and "Inversion" and "Transpose". That is a little math heavy. The other problem is that I would bet that a lot of the early use for APL was done better by Excel spreadsheets on desktops. By the time APL moved off the mainframe, it was too late. Of course, I'd imagine as far as code maintenance goes, APL beats a very large spreadsheet with a lot of VBA. Excel also has built-in charts and other functionality that is far clunkier, even in the best APLs.
- leephillips 5y agoSolving a problem by writing a verbose loop lets you think along the surface of the problem. The APL way almost requires thinking harder before writing any code, and visualizing the transformations of arrays geometrically. The APL coder often works in a hammock with a pencil and paper, spending much of the time staring out the window. The conventional programmer spends most of the time tapping away. Many people resist this deeper mode of thought, because it hurts, or they’re not used to it. I think that is the root reason that array languages did not become more popular. The reason that Lisp did not become mainstream is similar. It’s not the parentheses, nor the weird characters. It’s the focus that effective use of these languages requires. Of course they are more powerful—far more powerful. But only as extensions to a thought process that normal people do not enjoy or can not exploit.
- ingas 5y agoYes. A lot of programmers are lost without step-by-step debug. That's why concurency problems becames unsolvable for them.
- Phiwise_ 5y agoNice. Now one doesn't need to purchase a specialty keyboard to write in APL.
- razetime 5y agoThe general method of input most people use for APL is an IME with a shifting key, see: https://aplwiki.com/wiki/Typing_glyphs#By_method https://aplwiki.com/wiki/Typing_glyphs#By_method
- MarkusWandel 5y agoI did APL programming on an IBM mainframe on a co-op work term (in 1986) and later found an APL interpreter for a Z80 CP/M machine I had (a Superbrain) and strictly for nostalgia reasons, hacked together a character ROM for that machine so the thing would display properly. At which point a housemate walked up to it and coded the Sieve of Erasthosthenes prime number algorithm in something like 11 characters and out came a list of primes. Holy. And I thought I'd grokked APL. This is so long ago, that I had to google it. Here it is, OK, more than 11 characters but maybe the code is not exactly the same. (~v∊v∘.×v)/v←1↓⍳100 ⍝ primes to 100. 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 Taken from here with explanation how it works: https://dfns.dyalog.com/n_sieve.htm https://dfns.dyalog.com/n_sieve.htm It might be added that when the ratio of human:computer processing power was still more in favour of "human", insanely cryptic "hero languages" were popular. Thinking about the lowest-level of scripting in text formatters, APL, the vi macro langauge, and the nastier aspects of Perl. These days, readable code trumps all, and it's the compiler's job to turn it into incomprehensible gibberish.
- whereistimbo 5y agoI thought reading APL was like reading Chinese hanzi or Japanese kanji, if you are getting used of it, it would be very efficient instead of English of French, for example.