7 ms·
APL at Its Core
- ac1235 8y agoFor those of you who also enjoy the Reddit crowd, here's a link to r/programming: https://www.reddit.com/r/programming/comments/8ysgc2/apl_at_its_core/ https://www.reddit.com/r/programming/comments/8ysgc2/apl_at_...
- anonu 8y agoAPL is cool - but the non-standard non-ASCII keyboard is a non-starter for reaching mass-market. Q sitting on top of K is the gateway drug to people using more APL-like languages and vector programming. However, we need an open-source alternative to KDB+. If you want to reach mass-market you need to be free and open and you need to provide something more than just a cool language. KDB+ adds a lot of important features for handling time-series, websockets, web programming and generally scaling up to a distributed system where you could connected different nodes to form a message bus or add your own micro-services framework on top. You can't do that yet with any of the open-source APL and APL-like frameworks I've seen.
- avmich 8y ago> However, we need an open-source alternative to KDB+. Would Jd (https://code.jsoftware.com/wiki/Jd/Index https://code.jsoftware.com/wiki/Jd/Index) be adequate here?
- stefano 8y agoIt requires a license (https://code.jsoftware.com/wiki/Jd/License#License https://code.jsoftware.com/wiki/Jd/License#License).
- avmich 8y agoFrom that link: > Non-commercial use is free. Do you mean that not only the DB has to be open source, but it also should be free-as-in-beer?
- stefano 8y agoIf you want mass adoption, yes. For whatever reason, few developers want to pay for their tools. Maybe we've been spoiled by all the open source ones. A few companies manage to get people to pay for tools (e.g. Unity, Visual Studio), but they're the exception, and it's more due to a lack of open source offerings with comparable features. No one would pay a license for a new JS framework or for a compiler outside of niches, which is where proprietary tools still survive. If you want mass adoption, you need a complete free offering (as in beer and as in freedom). Which sucks for the tool vendors, since that's a lot harder to monetize, if not impossible. On the other hand, it's a boon for people getting started since they can try out all these tools without a monetary investement, and it's great for companies who don't need to pay for the code they base their whole business on.
- alfalfasprout 8y agoIt's sad how Kx systems decided to double down on making KDB so proprietary. Had they made some part of the ecosystem open source, we'd see mass adoption and they'd probably see more money from support contracts. There really is nothing out there like KDB that comes close for realtime manipulation and storage of ultra fast time series data.
- anonu 8y agoI agree - could've gone the MongoDB route...
- deleted 8y ago[deleted]
- imbusy111 8y agoTo me this looks like 'write-once and forget' code similar to a complex regexp. Why is everyone raving about the incomprehensible syntax? I admit that this is the first time I see APL code.
- coldtea 8y ago>Why is everyone raving about the incomprehensible syntax? I admit that this is the first time I see APL code. You've answered your own question. It's only "incomprehensible" if you're not familiar with it. After you've studied it it is very powerful and very succinct. The article even gives an example: Just consider the extract !'\:/:. The ! operator means rotation in this context. If used as n!v it rotates the vector v by n. But we do not directly use the operator like that, we modify it using the adverb ', which generally denotes a f unctional map. Now we can do something like n!'m to rotate each row vector in the matrix m, that is each element of the vector of vectors m, by n, or more generally we can say something like v!'m to rotate each row m[i] in the matrix m by the corresponding element of v[i]. A good analogy I would give is the equally "cryptic" to the uninitiated, but equally fast and powerful, to those that mastered them, vi(m) text manipulation commands -- which also use a very similar concept of modifiers and targets and so on.
- sethrin 8y agoThe following video is probably reasonably well known, and I wish that I had a more intelligent commentary than to say that it blows my mind, but it does I think bear out the point of expressivity rather well. https://youtu.be/a9xAKttWgP4 https://youtu.be/a9xAKttWgP4 Conway's Game of Life in some 50 characters of APL.
- userbinator 8y agoThe analogy I like to think of is that APL is incomprehensible to users of more Latin-based programming languages in the same way that Chinese is: you have to learn it to use it. ...and once you learn it, it feels as natural as any other language.
- textmode 8y agocat 1.txt http://example.net/?p= https://www.example.com/?page= ... For a given URL prefix in the file 1.txt, print URLs for pages 25-35. Desired URL prefix is on line 100 of the file. cat 1.sh #!/bin/sh l=$(exec head -$2|exec tail -1); n=$3;while true;do test $n -le $4||break; echo $l$n; n=$((n+1)); done; 1.sh 1.txt 100 25 35 cat 1.k g:{_getenv x}; u:0:g "u"; l:0$g "l"; b:0$g "b"; e:0$g "e"; `0:{,/$u[l],x}'b _!e; u=1.txt l=99 b=25 e=36 k 1
- gd1 8y agoNo one will see this because my politics aren't left-wing enough, but the linked article is incorrect. You can define dyadic functions in kdb+, it is just not generally encouraged. To do so simply declare a function that takes two parameters in the .q namespace: q).q.toThePowerOf:{x xexp y} q)4 toThePowerOf 2 16f