7 ms·
Zoo of array languages
- feraloink 1y agoThis is wonderful: APL is there! And a visual APL keyboard too.
- srean 1y agoIt's missing Nial I think.
- kelas 1y agoi'm sure niall is missing it too :) what does he do these days?
- ludsan 1y agono uiua :(
- etatoby 1y agoCame here to say the same thing. Uiua is my favorite language by far. BQN is also a cool "Nu-APL" but Uiua is just a full generation ahead.
- ofalkaed 1y agoWhat makes Uiua a full generation ahead of BQN?
- evnu 1y agoUiua is the first one that made array languages "click" for me due to the formatter.
- gcanyon 1y agoArray languages are such a mind twist and so fun. I dabbled in J at one point, and I love explaining +/%# to people. But the real expressive power comes when you start to get into tacit expressions yourself, understand function exponents, and "get" under. Hmmm... maybe I need a refresher...
- cess11 1y agoThere's an APK, for dabbling on the phone at times when there's no larger computer available but still time to spend. https://code.jsoftware.com/wiki/Guides/JAndroid https://code.jsoftware.com/wiki/Guides/JAndroid
- liveranga 1y agoHaving J on the phone in your pocket is great. And lots of the "labs" (interactive tutorials) are built in too: 3 dots -> Help -> Labs.. Edit: I should also have mentioned that Termux on android can build ngn-k, goal and a bunch of other open source array languages too. There's also Rob Pike's Ivy language for Android too.
- ofalkaed 1y agoFor android and apl we also have dzaima's AndroidIDE which is the best android array implementation that I have found. https://github.com/dzaima/APL/tree/master/AndroidIDE https://github.com/dzaima/APL/tree/master/AndroidIDE
- 1-more 1y ago> I love explaining +/%# Based on the one thing I remember in APL I'm guessing the first two characters are "sum over some data structure" and the data structure is what the next two mean. What does it mean entirely?
- JoshGG 1y agoMATLAB is an array language.
- RodgerTheGreat 1y agoMATLAB doesn't have a FOSS implementation that runs in a browser.
- bee_rider 1y agoOctave covers all the Matlab functionality I need, not sure if it runs in a browser. I mean if you have the source code for something there must be some way to get it to run in a browser these days, right?
- kelas 1y agoof course it runs in a browser - pretty much everything you can build using clang will run on the web. including linux kernel and llvm itself. to hell with peanuts: i'm pretty sure someone must even built cpython interpreter to wasm target, why not. there is no limit of what can be achieved by a group of motivated people with zero sense of direction. k, however, makes quite a bit of sense on the web - also on your phone. and time to prompt is going to be MUCH faster than python and octave. and i mean their native builds :) https://kparc.io/k/ https://kparc.io/k/ backslash is reference card, cmd+[] some examples
- radiator 1y agoit is one of their cousins
- ljosifov 1y agoYeah - IDK why it never makes it to these lists. R too. Matlab being 2D matrix first/default gets it right for me there. IK matrices trivially translate to arrays, still: find 2D to be extra expressive on human level, for zero price paid. I get it it's all the same to the cpu. 2D rows-columns rectangle of data being the simplest data structure both necessary and sufficient covering a 1) matrix 2) spreadsheet 3) SQL table 4) directed graph of nodes and edges. (in the past I've read someplace that lists are for pie eaters, but wouldn't know myself
- marcentusch 1y agoThis is cool. Wish there was more examples for jtye/k so I would have a better chance of learning to use it. Also missing Uiua.
- nathell 1y agoIs this written by Arthur Whitney himself?
- gitonthescene 1y agoThe zoo is a collection of web interfaces to a number of array languages written by several people including ATW.
- kelas 1y agothis is a gross undeappreciation of a truly remarkable effort by my dear friend and associate. also, at least one of the languages presented is due to him. you can call him @ktye. he's too modest. it is not a Kunstkamera or some computer cryptozoology extravaganza. many things are shown here, from different eras, but some are not - they are evolving. and progress takes sacrifice. cheers k. ps. we usually spell atw as atw :) he also goes by a. don't chicken out, send him an email. he's a very friendly guy. just like me.
- thristian 1y agoAPL and K are still pretty daunting, but I've recently been dabbling in Lil[1], which is something like a cross between K and Lua. I can fall back on regular procedural code when I need to, but I appreciate being able to do things like: 127 * sin (range sample_rate)*2*pi*freq_hz/sample_rate This produces one second audio-clip of a "freq_hz" sine-wave, at the given sample-rate. The "range sample_rate" produces a list of integers from 0 to sample_rate, and all the other multiplications and divisions vectorise to apply to every item in the list. Even the "sin" operator transparently works on a list. It also took me a little while to get used to the operator precedence (always right-to-left, no matter what), but it does indeed make expressions (and the compiler) simpler. The other thing that impresses me is being able to say: maximum:if x > y x else y end ...without grouping symbols around the condition or the statements. Well, I guess "end" is kind of a grouping symbol, but the language feels very clean and concise and fluent. [1]: https://beyondloom.com/decker/lil.html https://beyondloom.com/decker/lil.html
- fainpul 1y agoI assume this is the same as this? # python [127 * sin(x * tau * freq / samplerate) for x in range(samplerate)]
- thristian 1y agoPretty much, yeah! The difference is that in Python the function that calculates a single value looks like: foo(x) ...while the function that calculates a batch of values looks like: [foo(x) for x in somelist] Meanwhile in Lil (and I'd guess APL and K), the one function works in both situations. You can get some nice speed-ups in Python by pushing iteration into a list comprehension, because it's more specialised in the byte-code than a for loop. It's a lot easier in Lil, since it often Just Works.
- RodgerTheGreat 1y agoA few more examples in K and Lil where pervasive implicit iteration is useful, and why their conforming behavior is not equivalent to a simple .map() or a flat comprehension: http://beyondloom.com/blog/conforming.html http://beyondloom.com/blog/conforming.html
- Pompidou 1y agoR is also an array language, but a non-iversonian one. Another good ressource for array languages is https://aplwiki.com/ https://aplwiki.com/. r/apljk on reddit is also active.
- countrymile 1y agoThat's my understanding too. R never seems to make these lists.
- kelas 1y agonumpy is also an array language, with a userbase that of (R+k)^10 never seems to make these lists :)
- rana762 1y ago[dead]
- rana762 1y ago[flagged]
- seanhunter 1y agoAt one time I briefly spent a bunch of time learning kdb/q. I remember one particular day when I wrote a non-trivial program and it worked first time. I was so shocked I thought I must have suffered some kind of brain aneurism or something.
- kelas 1y agooh, gosh. sorry for your loss. if you don't mind me asking, do you also remember the day when you wrote some non-trivial program in any language and it "worked" the first time, whatever that means (i presume "correctly")? what was the language? are you sure you've made a full recovery from that shock as well? on a serious note, APL (and, by proxy, its descendants) invented REPL (dubbed "dialogue approach") long before the people who coined "REPL" even came to be. When that happened, C lanugage wasn't around either. Fortran was, granted, and sure enough it "worked" every time. you didn't even have to try, just punch it up on a punchcard, stick it in, wait a while. done. flawless. on a closing note: writing correct programs takes skill and happens in iterations. the faster you can iterate, the faster you can justify your money's worth. the less you type, the more you think. less code less bug. does that help?
- BoiledCabbage 1y ago>on a serious note, APL (and, by proxy, its descendants) invented REPL (dubbed "dialogue approach") long before the people who coined "REPL" even came to be. While I have enjoyed learning array languages, and think they are still underrated, Wikipedia seems to disagree with this statement above. According to wikiepdia, REPL seems to have been coined after Iverson created his notation, but before the first APL was ever written. https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93prin...
- kelas 1y ago> seems to disagree no, actually i think Wikipedia got it right: "The 1974 Maclisp reference manual by David A. Moon attests "Read-eval-print loop" on page 89, but does not use the acronym REPL.[7] Since at least the 1980s, the abbreviations REP Loop and REPL are attested in the context of Scheme.[8][9]" The first APL interpreter was implemented on System/360 in 1965. Iverson got a Turing in 1979.
- veridianCrest 1y agoArray languages: where your first working program feels like a happy accident.
- OneDeuxTriSeiGo 1y agoProgramming in an array lang "should" generally feel like using a calculator. You are working in a REPL, starting with small expressions to verify they are roughly doing what you want and then composing them to build up until you can plug it all together and now have a formula you can plug into the calculator to plug and chug all the rest of your data. So in that sense yeah it does kind of replicate the magic of the first time you got a complex equation or BASIC program to run on your TI back in your school days.
- kelas 1y ago> your first working program feels like a happy accident. if you don't mind sharing: how did your own first working program felt like, and what was it written in? by the way, did it work, or did it work correctly? it's a small but important distinction.
- bee_rider 1y agoDumb question from an outsider: are array languages competitive with something like C or Fortran in their niche performance-wise?
- gopalv 1y ago> are array languages competitive with something like C or Fortran The REPL is what matters - also while being performant. Someone asks you a question, you write something, you run it and say an answer, the next question is asked etc. I've seen these tools be invaluable in that model, over "write software, compile and run a thousand times" problems which C/Fortran lives in.
- gitonthescene 1y agoPerhaps a more precise question is whether you can write programs as performant as those written in C or Fortran and the answer is it depends on the program (and more likely the programmer). The languages tend to do memory management for you which means giving up some control. Most use “immutable” data structures which force more contraints. But for the loss of control you get stuff like fancy SIMD implementation for nothing. All and all there’s a cost/benefit calculation but that ratio can get quite low.
- graboid 1y agoI assume that in most array languages, you also create "words" or however you want to call functions, to reuse code. I wonder about a purely aesthetic issue: how does it look to interleave those symbols with user-defined words that by nature will be much, much longer, i.e. "create-log-entry" or "calculate-estimated-revenue".
- tailrecursion 1y agoI never did any real programming in APL, but I studied it over about 2 months. When you get used to the symbols, reading spelled-out words feels like reading in slow motion, or being stuck in molasses. Most (not all) APL code I've seen uses very short names, often one letter names, for function names. And APL programmers are famous for cataloging "idiom" which are short phrases for common subroutines. In other words, it's best practice to repeat 3- or 4- symbol phrases instead of defining a subroutine. Of course, there's nothing about an array language that requires using symbols; but for some reason most do.
- ofalkaed 1y ago>Of course, there's nothing about an array language that requires using symbols; but for some reason most do. The idioms become words and you read them like words, you don't step through each letter of a word when you read it, you recognize the shape. The same thing happens in APL and its ilk, any commonly used sequence is instantly understood as its function without having to parse each individual symbol and what it does.
- tailrecursion 1y agoYes the symbols in a way are the letters of APL, and the phrases are the words.
- kelas 1y agoin k, we say "primitive operators are verbs", and "lambdas, functions, variables, literals are nouns". higher-order functions (over, scan, each, etc) are called adverbs.
- mirawelner 1y agoToday I learned that there is such a thing as an array language! This is so neat! Need to learn all of them.
- skruger 1y agoStart here: https://xpqz.github.io/learnapl https://xpqz.github.io/learnapl or here: https://xpqz.github.io/kbook https://xpqz.github.io/kbook
- jacobgorm 1y agoI once took a graduate course from Larry Snyder on ZPL. I found it pretty neat because it made communication costs very easy to reason about.
- marcentusch 1y agoi made a site for trying out the jtye/k version, since it was missing from the zoo: https://mao-syseng.github.io/k-playground/ https://mao-syseng.github.io/k-playground/ coming from javascript world this is super interesting, i will try and document some of the stuff i learn on that site is well.