5 ms·
Origins of J
- kstrauser 3y ago“…and that’s why we have code formatters.” That’s neat and impressive. I’m glad I’m not required to read or understand it.
- rbonvall 3y agoOnce I put the effort to understand code like this and it turned out it's straightforward once you learn the conventions: https://news.ycombinator.com/item?id=19421524 https://news.ycombinator.com/item?id=19421524
- deleted 3y ago[deleted]
- gfv 3y agoIt really doesn't help that it's written in ancient K&R C, but if you spend ten or so minutes just staring at it, familiar shapes and patterns start to appear. (Give it a try!) Incidentally, it's in line with how APL code looks like an alien artifact at first, but you get used to it fast if you have spatial reasoning to wrap your head around reshaping and transposing.
- hackernoteng 3y agoIf you focus on the middle and move your head back and forth eventually you see a 3D image of Dykstra pop out and he doesn't look happy at all.
- kelas 3y agoporting from k&r to iso is super easy. fun, too.
- JaumeGreen 3y agoTalked about this in other times (through other links): * https://news.ycombinator.com/item?id=8533843 https://news.ycombinator.com/item?id=8533843 [2014] * https://news.ycombinator.com/item?id=28491562 https://news.ycombinator.com/item?id=28491562 [2021] * https://news.ycombinator.com/item?id=25902615 https://news.ycombinator.com/item?id=25902615 [2021] * https://news.ycombinator.com/item?id=34050715 https://news.ycombinator.com/item?id=34050715 [2022] A commentary about the code https://news.ycombinator.com/item?id=22831931 https://news.ycombinator.com/item?id=22831931 [2020]
- cianigga 3y ago[dead]
- mihaic 3y agoI was expecting the story of the letter J, that Indiana Jones and the Holy Grail has taught me had appeared only in the 15th century as a letter separate than "I".
- olestr 3y agoAnd I was expecting the Outlook J smiley. Been a while since I've seen it in the wild now. https://superuser.com/questions/1181497/text-smiley-faces-show-up-as-the-letter-j-in-emails https://superuser.com/questions/1181497/text-smiley-faces-sh...
- kingwill101 3y agoI had the same thought . Maybe the title should be updated to better reflect this
- zengid 3y agoObligatory posting of Bryan Cantrill's interview with Arthur Whitney https://queue.acm.org/detail.cfm?id=1531242 https://queue.acm.org/detail.cfm?id=1531242
- bcantrill 3y agoThe full audio of that was recorded but was never released -- this is reminding me that I should loop back with ACM to see if they still have it and can release it. In particular, I want to see how long the pause when Arthur responded to my question "What do you think the analog for software is?": I won't give away his answer, but it more or less detonated my brain -- and it took me what felt like minutes (but was surely only seconds?) to put myself back together and ask a follow-up.
- 082349872349872 3y agoI agree with Arthur's answer, but unfortunately it runs afoul of Conway's Law: auteurs have a voice* and are capable of producing software in that style, but large organisations? By necessity, they must produce something qualitatively different, that anyone can slot anything into anywhere, optimised for superficial comprehensibility over elegance. * sometimes small groups? Doug McIlroy said he was lucky to have managed a software group whose members would sit around in the lunch room and brainstorm (reminiscent of the Little Prince?) not what they could add, but what they could remove. « Par ma foi, il y a plus de quarante ans que je dis de la prose sans que j'en susse rien, et je vous suis le plus obligé du monde de m'avoir appris cela. » —JBP
- kelas 3y agosir, please - make an effort. recover that audio. it is a f%ck#g shame that CHM failed to do their job and lost the legendary footage of the celebration of KEI. Arthur took the last word and opened with the iconic line “deeds of great men don’t need words, they need more deeds, so i’ll keep it short”. check out who else took the mike that afternoon: https://computerhistory.org/events/celebration-kenneth-iverson/ https://computerhistory.org/events/celebration-kenneth-ivers...
- hackernoteng 3y agoArthur Whitney is a mad genius. We were an early customer of KX systems and I programmed with KDB for a few years. Arthur Whitney once sat at my desk and helped me debug my code. Very nice guy. Super smart and hilariously knowledgeable about the low level performance of chips, caches, etc. Ask him how many nanoseconds it takes to divide an array of doubles by an array of ints, and he knows. He just knows.
- 7thaccount 3y agoThis kind of story is what I enjoy so much about HN. I wish Kdb+ or Shakti had dramatically lower costs for those industries that don't have access to banking cash. I know open source versions exist, but I understand them to mostly be toys and not really production worthy.
- deleted 3y ago[deleted]
- DrDroop 3y agoK is at the end of the day a fancy calculator, I think for most workloads you can use the open source version called ngn/k
- avmich 3y agoThis - https://github.com/JohnEarnest/ok https://github.com/JohnEarnest/ok - can also be used sometimes...
- anotherjhacker 3y agoSure, a fancy calculator that supports rather efficient execution on ridiculously large machine farms. What some people might call the implementation language for a database engine.
- kelas 3y ago> k is a fancy calculator [put your favorite Java here] is also a fancy calculator by the virtue of Turing completeness. what’s your point?
- countWSS 3y agoThe code in C that suppose to be written like this is usually never written first like that, its like pretending writing minified js by hand from scratch. Usually the code is contracted and "minified" from large program to fit entire program into 1-3 screens, the person who manually "minified" it to that state will know its expansion but other people will dismiss it as obfuscated C, its an old technique to fit lots of code into 80x25 type terminal. Not surprising since J is optimized for code density per screen.
- clausecker 3y agoNope, Whitney just codes like this.
- colonwqbang 3y ago> Not surprising since J is optimized for code density per screen. I don't think that's the whole story. J is dense like traditional mathematical notation, but can be executed by machine. Experienced J programmers use it to convey mathematical ideas. See for instance: https://www.jsoftware.com/jwiki/Puzzles/Unit_Fraction_Sum https://www.jsoftware.com/jwiki/Puzzles/Unit_Fraction_Sum Although I can't read the notation, I appreciate the role it can play. Plain C (or whatever) code isn't an efficient vehicle for ideas like that. Numpy/matlab comes closer but J is a stronger approximation of traditional maths notation.
- crabbone 3y agoI like J. Especially because it has a saner way to write it (it doesn't have to look like as if you accidentally forgot a null terminator in C strings, all the traditionally short identifiers have a long and understandable form). I feel like it's very regrettable that the superficial aspect of J (the very hard to read syntax) is standing in the way of some very nice ideas. To comment on mathematical notation. Before I was a programmer, I was a typographer. During my study in art academy, I invented a bunch of fonts, one of my long time projects was to make Hebrew look more like Latin fonts for example (this is a long-standing issue in Hebrew typography, with several historical attempts, but still not quite resolved). Afterwards I worked in a printing house, paginated a newspaper, typeset a bunch of books etc. Among my coworkers (esp. in the newspaper) I was sort of known for trying to automate stuff, so, I was often suggested as a candidate for "difficult" typographical tasks, like setting sports tables, chess diagrams, music sheets and the most damned and hated kind of typographical work: math formulas. I've helped publish a course book on linear algebra for a university. It was a multi-year project which I joined in the middle. I have never seen so much pain, struggle and reluctance as I've encountered while working on this thing. People tasked with proofreading demanded extra pay for proof-reading this stuff, and still wouldn't do it. Just put it away and later explain that they had other things to do. The lady who had to translate the mostly hand-written, or sometimes typed on a typewriter manuscript would just skip work on the days she was supposed to input the manuscript into our digital system. Everyone passionately wanted this project to burn in hell. And the reason for this was the mathematical notation. Typical proofreading techniques don't work on math formulas. The text is impenetrable to anyone, often even to the people who wrote it, including both the author and the editor. Parenthesis are a curse, because in the manuscript they are one of the elements that is most commonly forgotten or misplaced. Single-letter variables are the other one. Overloading the same symbols with different meaning is yet another one. It gets worse when the same symbol is used in its normal size, subscript and superscript. ---- When I talked about my experiences to people with degrees in math, they way they tend to respond to this is by saying that "math is overall so hard, that mathematicians don't typically notice the extra struggle they incur on themselves by the bad language choices, it pales in comparison to the difficulty of the main problem they need to solve". And, I kind of can see it... on the other hand, I see no reason _the students_ have to endure the same torture. They aren't solving any novel mathematical problems. Their task is usually reading-comprehension combined with memorization. And then I saw Sussman book where he uses Scheme to write math formulas (I think it was about physics, but it still used a lot of math). Dear lord, it was so immeasurably better than the traditional mathematical notation. I really wish more people joined this movement of ditching the mathematical notation in favor of something more regular and typography-friendly as Scheme...
- tangentstorm 3y agoNice to see this getting some attention again. I hope some people venture out to learn about the actual J language: https://code.jsoftware.com/wiki/Guides/GettingStarted https://code.jsoftware.com/wiki/Guides/GettingStarted For what it's worth, I've also studied this code a bit. This repo has an annotated and (somewhat) reformatted version of the code: https://github.com/tangentstorm/j-incunabulum https://github.com/tangentstorm/j-incunabulum
- bbwbsb 3y agoSince we are on the topic, I've thought about APLs a decent amount so here are some other resources/notes. I'm not an expert on this topic - I don't work with or research the language or anything. These probably are not good getting-started resources. There is a VM model for APL languages[1] which can make optimizations comparable to those made by CLP(FD). If you read about CLP(FD) implementations[2], you'll see operations similar to what the "An APL Machine" paper calls beating. I'm not sure if any APL-like languages actually implement such optimizations. There are different models of arrays (and their types) used by APL-like languages[3]. Also array frame agreement can be statically typed[4], though it usually isn't. Some other OSS implementations of similar languages include Nial[5], ngn/k[6], and GNU APL[7]. My favorite is ngn/k. If you use a K-like language, a great source of inspiration is nsl[8]. There is an unusual and fun calculus book that uses J, by Iverson, but it moves somewhat quickly and loosely[9]. It perhaps gives a good example of what APL was intended to be(?). On that note, his original paper, "Notation as a Tool of Thought" is interesting[10]. There is also podcast interview with Robert Kowalski, one of the creators of Prolog, who says - if I remember correctly - that he was looking for a better way of thinking when he came up with SLD resolution[11]. It's interesting how these languages came out of different paths towards a similar goal. Also beware the reverence of Arthur Whitney. His work is definitely inspired, but the community around K can seem schizoid-like[12], in a way comparable to Wolfram's projects[13]. That said, J is an exceptionally fun language to use. My favorite insight from an APL-like language that generalizes is how K encourages writing functions that converge by the easiest-to-use loop operator being one that applies a function to an argument repeatedly until the output stops changing. --- [1]: https://www.softwarepreservation.org/projects/apl/Papers/197002_An%20APL%20Machine-Abrams.pdf https://www.softwarepreservation.org/projects/apl/Papers/197... [2]: http://cri-dist.univ-paris1.fr/diaz/publications/GNU-PROLOG/tplp12.pdf http://cri-dist.univ-paris1.fr/diaz/publications/GNU-PROLOG/... (there are probably more to the point papers, this is just the one I read when I noticed the similarities). [3]: https://aplwiki.com/wiki/Array_model https://aplwiki.com/wiki/Array_model [4]: https://www.khoury.northeastern.edu/home/jrslepak/typed-j.pdf https://www.khoury.northeastern.edu/home/jrslepak/typed-j.pd... (implemented in racket iirc) [5]: https://www.nial-array-language.org/ https://www.nial-array-language.org/ [6]: https://codeberg.org/ngn/k https://codeberg.org/ngn/k (honestly it is a miracle this exists) [7]: https://www.gnu.org/software/apl/ https://www.gnu.org/software/apl/ [8]: https://nsl.com https://nsl.com [10]: https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.pdf https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.p... [11]: https://thesearch.space/episodes/1-the-poet-of-logic-programming https://thesearch.space/episodes/1-the-poet-of-logic-program... [12]: https://www.ijpsy.com/volumen3/num2/63/the-schizoid-personality-of-our-time-la-EN.pdf https://www.ijpsy.com/volumen3/num2/63/the-schizoid-personal... [13]: http://genius.cat-v.org/richard-feynman/writtings/letters/wolfram http://genius.cat-v.org/richard-feynman/writtings/letters/wo...
- rramadass 3y agoA previous HN thread on Arthur Whitney's "B" is relevant here. Follow my previous comment here - https://news.ycombinator.com/item?id=30416737 https://news.ycombinator.com/item?id=30416737 where user "yiyus" goes through the code line-by-line adding detailed notes for comprehension. Also see https://github.com/tlack/b-decoded https://github.com/tlack/b-decoded