5 ms·
J Source to be released under GPL
- silentbicycle 16y agoFor those of you who don't know anything about J, it's a modern dialect of APL; an extremely concise functional programming language based on function concatenation and vector operation. The APL languages are very interesting, but have historically been proprietary and somewhat insular. * http://jsoftware.com/ http://jsoftware.com/ * http://en.wikipedia.org/wiki/J_%28programming_language%29 http://en.wikipedia.org/wiki/J_%28programming_language%29 * A good intro - _J for C Programmers_ (http://www.jsoftware.com/help/jforc/contents.htm http://www.jsoftware.com/help/jforc/contents.htm) * A more casual intro - "Mind if I do a J?" (http://jeffzellner.com/miidaj/ http://jeffzellner.com/miidaj/)
- gruseom 16y agoThanks. I'm glad you keep on top of this stuff for us. Interesting to see the name Iverson in the OP; is Eric Ken's son?
- sofuture 16y agoI believe so, yes.
- limmeau 16y agoI glanced over the J for C table of contents to find out where J keeps anything like product and sum types, but I found no promising headlines. Is that just J's way of saying "if it's not a matrix, don't use J", or am I missing something fundamental here?
- silentbicycle 16y agoBox/open are the primitives you want. Box wraps other values (possibly with different types or sizes) in one array, kind of like a C struct. Open extracts sub-elements. Box: http://www.jsoftware.com/help/dictionary/d010.htm http://www.jsoftware.com/help/dictionary/d010.htm Open: http://www.jsoftware.com/help/dictionary/d020.htm http://www.jsoftware.com/help/dictionary/d020.htm
- ableal 16y ago> _J for C Programmers_ (http://www.jsoftware.com/help/jforc/contents.htm http://www.jsoftware.com/help/jforc/contents.htm) Thanks. For those who prefer PDFs, that book and more material are available at http://www.jsoftware.com/jwiki/Books http://www.jsoftware.com/jwiki/Books . (Had to dig around a bit, because, in spite of the original URL, the book was not listed in the help page.) Question: I have a vague memory of seeing a web page named something like "A Garden of ..." with neat examples, either for J or K. However, my search-fu is failing me.
- silentbicycle 16y agoSomething like http://www.jsoftware.com/jwiki/Essays http://www.jsoftware.com/jwiki/Essays ?
- ableal 16y agoYes, that's probably it, thank you. (There's a couple of brain cells in the back muttering that the page was less dense and tan colored, but I told them to shut up ;-) Now let's sell tickets to some cage fights, for instance http://www.jsoftware.com/jwiki/Essays/Sudoku http://www.jsoftware.com/jwiki/Essays/Sudoku versus http://norvig.com/sudoku.html http://norvig.com/sudoku.html P.S. The credit at the bottom of the J Sudoku piece led me here: http://www.vector.org.uk/ http://www.vector.org.uk/ . Seems an interesting place to visit. It even features articles headed "APL is not for programmers" (quote: "At this point the average programmer turns off, drops out, gets his coat and leaves the building, heading for mom and the kids. We, on the other hand, will continue.")
- beagle3 16y agoIf you want cage fights, you should also include the lean contender: http://nsl.com/k/sudoku/aw3.k http://nsl.com/k/sudoku/aw3.k (I'll copy it here, because it's short enough for that: p,:3/:_(p:9\:!81)%3 s:{*(,x)(,/{@[x;y;:;]'&21=x[&|/p[;y]=p]?!10}')/&~x}
- gtani 16y agoVery cool, I should look into this. IBM APL2 was one of the first languages I spewed out lots of code in (the others being awk, C, scheme and some proprietary database langauges, ). The APL workspaces I worked on were some of the largest in existence, according to IBM consultants we had on-site (tens of thousands of lines of code, if I remember correctly). Whew.
- beagle3 16y agoSuper ultra extra awesome. There is already an open source K implementation called kona https://github.com/kevinlawler/kona https://github.com/kevinlawler/kona , and now J is joining. There are old J source codes floating around, but the latest is from 1993 if I'm not mistaken.
- silentbicycle 16y agoYes! I've been experimenting a LOT with kona.* K seems more my style, but I'm really excited about J being opened too! The APL family is way too interesting to have it confined by extremely expensive licenses and niche industries. * Also, from communicating with the author: it's a clean re-implementation based on experience with it, not an open-sourced version of "real" K. (I've never used K or Q.) I got the '93 J to work, too (on OpenBSD), but it's evolved a lot since then, and having the official version open will draw a lot more attention. Also, thanks for answering some of my questions about J, K, and valence/rank a while back.
- kcl 16y ago> it's a clean re-implementation ... not an open-sourced version of "real" K Thanks, I didn't realize there was an ambiguity here. I've updated the GitHub page to be clearer on this point.
- beagle3 16y agoK is a lot more my style too: J has the kitchen sink. K provides closer to the "bare necessities". And yet, K programs are often shorter, simpler and more verbose. Also, K operators often rhyme with the C meaning of the same characters: &=and/min, |=or/max, monadic*=first (like C dereference when applied to a vector; trenary?=[vector]choose. I think there are a few others. Also, you're welcome :)
- beagle3 16y ago> and more verbose. I meant less verbose, of course. But it's too late to edit.
- 16y ago
- rararational 16y agoThat is actually quite cool, I do remember seeing all the crazy solutions to projecteuler when I was doing those and it even made me try to grok some of what J did and you don't even need an APL keyboard to write it.
- Groxx 16y agoI keep wondering if it's worth learning J, if only to understand this thing: quicksort=: (($:@(<#[) , (=#[) , $:@(>#[)) ({~ ?@#)) ^: (1<#) Anyone who does any significant amount of work in J care to comment? It seems like a super-niche language, which would take more time to come up with and mentally-parse existing code than the same operations in other languages. Of course, once you're fluent, you're fluent, but it looks like Vim to the Vim'th power...
- forkandwait 16y agoWe have a guy at work who uses J for everything, since he came of age doing data analysis in APL, when APL was the only interpreted and powerful matrix language out there. (Fortran was compiled and low level.) He loves it, but he doesn't know any other languages. Personally, I found J a very interesting interesting exercise, and APL is historically SUPER important, but for practical uses they have been way superseded by matlab/ Octave/ R and the T/P/R* scripting languages. (At times my friend will say something like "in J you can compute the sum of a matrix IN JUST ONE LINE... and I will point to "sum(A)" in matlab, as opposed "$&$%^%$%M" in J, or whatever it is.) K may be more brain friendly than J. But as far as I am concerned, J makes assembler and badly written Perl look easy to read.
- klettow 16y agoSum in J is +/ not, $&$%^%$%M. Is +/ really too hard to comprehend? I agree with you that APL is historically important, but J is Ken Iverson's last and greatest gift to the programming community. He used the 26 years between the release of APL and J to address many of the shortcomings of APL. Take a look at http://bit.ly/hMmGWV http://bit.ly/hMmGWV for some background.
- gcanyon 16y agoI know enough J to wish other languages had some of its features. Like macros in Lisp, working in J expands your mind.
- beagle3 16y agoIt's a lot like math notations. To draw an analogy, it's hard to go back from "a*b" (i.e. k/j/apl) to "a multiplied by b" (i.e. lisp) to "start with zero, add a, add a again, ....., repeat b times (i.e. java/cobol) once you've gotten used to a concise notation. And even if you _do_ go back to verbose, you are overall much better for knowing what's a concise way to putting everything, and converging towards that with your limited tools.
- lambda 16y agoExcellent! I've been intrigued by J for a while, but I won't use languages which don't have at least one free/open-source implementation. Now I'll need to take another look at it!
- chalst 16y agoHui & Iverson (1991) The J Dictionary. http://cs.nyu.edu/courses/fall05/G22.2110-001/dictionary.pdf http://cs.nyu.edu/courses/fall05/G22.2110-001/dictionary.pdf This is the reason to learn J. It is a clean, fast course in a programming style that puts linear algebraic concepts at its heart. If you are interested in functional programming, work through this book. The "tutorial" part is about 60 pages, which should be worked through, and the dictionary part about 150 pages, which can be dipped into.
- klettow 16y agoYou should really reference the online version of the dictionary http://www.jsoftware.com/help/dictionary/contents.htm http://www.jsoftware.com/help/dictionary/contents.htm, it is the current version.
- regularfry 16y agoBrilliant news! Good idea to get some friendly eyes on the pre-release package, too.