7 ms·
Array languages are very cool. I'm more of an APL guy myself though.
by 7thaccount 4y ago
Array languages are very cool. I'm more of an APL guy myself though.
- magicalhippo 4y agoDo they all read like noise[1]? [1]: https://codeberg.org/ngn/k/src/branch/master/a19/20.k https://codeberg.org/ngn/k/src/branch/master/a19/20.k
- t-3 4y agoIf you want to understand the thinking, read Iverson's Notation as a Tool of Thought. These languages are optimized for the user rather than the learner, so the curve is steep but rewarding.
- anthk 4y agoEver used dc(1) in Unix?
- magicalhippo 4y agoNever heard of it till now. Interesting, reminded me of my mom's HP-15C calculator I played with as a kid.
- 7thaccount 4y agoSwiss micros sells high quality remakes of many of the HP calculators, with a couple of high end new creations of their own. Works of art and engineering for sure. Not as good as my top end TI for just getting stuff done though. My dad has a 15c as well. Fond memories there.
- jasomill 4y agoSpeaking of works of art and engineering, the three HP Voyager series calculators on my desk (12C, 15C, 16C) still work as well as they did several decades ago when they were new. As does the other 15C that I regularly carry around and occasionally drop.
- 7thaccount 4y agoMy father only had a problem with the battery leaking in a bigger HP calculator that had these expansion modules. His 15c is also still working since the 80s.
- rpz 4y agoReads like music to me
- magicalhippo 4y agoAt least music sheets have a clear structure, I don't see any in the examples like the one I linked to. Of course it could be that the examples I've seen just happen to be written like IOCCC entries.
- yjftsjthsd-h 4y agoYou can't see structure in a language that you don't know? I mean, sure, one possibility is that there just isn't a structure, but that's really not the obvious option here.
- magicalhippo 4y agoI can see structure in most new programming languages I'm exposed to. I might not immediately understand what the code does, but usually there's some sense of rhyme and reason. Though most languages are not as terse as this.
- tlack 4y agoThese languages are from a different branch of the computer science language tree. The verbs are different. The same verbs usually work similarly for all data types. Each of those symbols (verbs) are jam-packed with meaning, and most looping is implicit or very natural, and overall code constructions are very terse. It's like reading a nice short poem rather than a 700 page book. It can go too far, of course; there is some middle ground to be found. If you have time, reading into the language a little more deeply may be illuminating, because it changes the way you think about the very nature of the task at hand.
- lokedhs 4y agoIn some of the example programs written in KAP (my APL derivative), I tried to write it in a style that makes people unfamiliar with the array style more comfortable. This code could of course have been written in a style similar to some of the more extreme examples, and they would have been significantly shorter in that case. https://github.com/lokedhs/array/blob/master/demo/advent-of-code-2021/ https://github.com/lokedhs/array/blob/master/demo/advent-of-...
- razetime 4y agoI hope you have taken some time to understand K's philosophy and goals before making this comment. A tutorial exists here: https://github.com/razetime/ngn-k-tutorial https://github.com/razetime/ngn-k-tutorial if you'd like to understand why this solution is good.
- magicalhippo 4y agoIt was just an honest question. I've just peeked at APL, J and K due to posts here on HN, and the sample code I've seen mostly reads as noise to me, so I was just curious if there were any array languages that would be approachable to me. The tutorial does help a fair bit, though glossing through it, it doesn't really explain why it has to be so exceptionally terse. I mean the matmul[1] sure is impressively short in the end, and with a background in computer graphics and simulations I can absolutely appreciate working on arrays rather than singular values. But I'm sure one could get the same computational result with a bit more approachable syntax. [1]: https://github.com/razetime/ngn-k-tutorial/blob/main/c-thinking-in-k.md https://github.com/razetime/ngn-k-tutorial/blob/main/c-think...
- gitonthescene 4y agoOr, or, and here me out here, you could learn the syntax in order to make a more informed assessment. Do also seek out geocar’s posts. They are well written and to my mind convincing. https://news.ycombinator.com/item?id=27393682 https://news.ycombinator.com/item?id=27393682
- magicalhippo 4y ago> you could learn the syntax in order to make a more informed assessment I'm fairly sure my assessment wouldn't change even if I did learn the syntax. It would still read like noise. The only difference would be that I could understand the noise. I've read and worked on enough super-terse code in other languages to feel confident in that. > Do also seek out geocar’s posts. They are well written and to my mind convincing. I guess it comes down to how ones brain is wired then. For example, I have the exact opposite reaction to multiple pages of code vs terse one-liners compared to geocar[1]. I don't have trouble remembering what range() does because it says so right on the tin, unlike for example + in k (addition or, surprise, transpose). [1]: https://news.ycombinator.com/item?id=27223086 https://news.ycombinator.com/item?id=27223086
- flocke 4y ago[dead]