3 ms·
I've been dabbling with learning J recently and, yes, it's really really humbling. However, I think it can be much easier. The thing I have the most trouble wit
by minikomi 12y ago
I've been dabbling with learning J recently and, yes, it's really really humbling. However, I think it can be much easier. The thing I have the most trouble with is, predictably, unfamiliarity with the large amount of verbs.
So, what to do?
I'm beginning to think approaching it more like a foreign language will make more sense - i.e., reading & spaced repetition of phrases (short programs - J's specialty!) / vocab (useful hooks, forks) using a flash card system.
It's a compelling language to learn (even just for the fact you can pretty much program using a pen and paper while waiting for the bus - short little rows of verbs you build out gradually as you reason about it or type them in your iphone), and I hope my approach has merit.
- qznc 12y agoThere is a public Anki (spaced repetition app) deck available: https://ankiweb.net/shared/info/832417998 https://ankiweb.net/shared/info/832417998 That one still looks very cryptic, though.
- minikomi 12y agoAh, good find! I'll give it a whirl.
- RBerenguel 12y agoActually, I'm learning APL with a homemade Anki deck (APL is slightly easier for me to read than J, since it uses symbols)
- klibertp 12y agoI learned J in very much this way, although instead of reading J code I chose to write it. I worked my way through a cheatsheet (http://www.jsoftware.com/jwiki/HenryRich?action=AttachFile&do=view&target=J602_RefCard_color_letter_current.pdf http://www.jsoftware.com/jwiki/HenryRich?action=AttachFile&d...) inventing little toy problems to solve with particular verbs along the way. But words (verbs, gerunds, etc.) are not enough - you need to know the rules for composing them. Fortunately this is rather easy to learn. I'd say that you need to know about hooks, forks (trains in general) and ranks before starting to learn the vocabulary. But maybe you can learn those things along the vocabulary too.
- eggy 12y agoI have been toying with J for the past few years, and I think you only appreciate it when you see it as equivalent to mathematical notation, alien at first, but succinct and very useable when you know what the symbols mean. See Iverson's paper on 'Notation as a Tool of Thought' (http://www.jsoftware.com/papers/tot.htm http://www.jsoftware.com/papers/tot.htm). I am self-teaching mathematics, and even when trying Julia as a math tool, I find the basic unit of J, the array, as more amenable to my studies. It's interesting how there is all the talk about 'vectorization' and such in other languages, which J has been doing for decades. J is functional, and can have 'for' loops, but loopless programming is encouraged and easy. When dealing with images or large data sets that are memory mapped, the operations are succinct and powerful and eye-opening. My latest epiphany from moving away from using J as just a sophisticated calculator came after watching the 4 videos by Martin Saurer (https://www.youtube.com/watch?v=VSJpJt3c11c https://www.youtube.com/watch?v=VSJpJt3c11c). Iverson's books on arithmetic and calculus using J are mind-blowing. You are engaged, not distracted by the language. J is fast too. From another talk (https://www.youtube.com/watch?v=IKfJRyoiBlY&feature=youtu.be https://www.youtube.com/watch?v=IKfJRyoiBlY&feature=youtu.be), creating a 1x10^6 element array and summing over columns or rows is fast, and the code is simply: b=: ? 1000 1000 $ 10 +/+/b These two lines create a 1x10^6 element array and then sums the columns, and then sums the single row total. Fast. These guys have really distilled the libraries and made them work well with J (lapacke c interface to lapack). You get c speeds from an interpreter. I guess this is why q with kdb+ is used so much by the finance community despite how expensive it is. Anyway, I am currently staying with J, and I am writing my little tasks in J and julia to see how they fare against each other in speed and development efforts. Now that I have the knowledge to do Qt interfaces for J, I may just stick with J for the sheer joy.
- oddthink 12y agoIMHO, q's (and K's) big advantage over J is that they have tables and dictionaries as an available data type. This makes basic tasks like reading csv files and merging different data sources much easier in q. q also has a nicer syntax for anonymous functions. Of course, q is also very expensive, and it tries to be too clever at times: I remember running in to all sorts of weird corner cases, with things like NAs being skipped in float arrays, but not in int arrays, etc.