Live data from Hacker News

A look at the J language: the fine line between genius and insanity (2012)

scottlocklin.wordpress.com

41–50 of 70 posts

Re: A look at the J language: the fine line between genius and insanity (2012)

#41

The TSDB is now called 'jd'[0] FWIIW. Funny, I've been using J on and off since then and I'm still not sure if it's genius or insane. It, along with the other APLs, is definitely its own thing, just as much as Lisp is (my previous favorite weird language was Yann LeCun and Leon Bottou's "Lush,"[1] which I continue to think is an amazing design). Once you get a little bit proficient at it, you finally realize what an…

The user community is really outstanding. Just have a look on https://stackoverflow.com/questions/tagged/j

Questions are answered in no time, the folks are very friendly and treat everyone on eye level. A great role model for any programming language / software communities!

Re: A look at the J language: the fine line between genius and insanity (2012)

#42

The TSDB is now called 'jd'[0] FWIIW. Funny, I've been using J on and off since then and I'm still not sure if it's genius or insane. It, along with the other APLs, is definitely its own thing, just as much as Lisp is (my previous favorite weird language was Yann LeCun and Leon Bottou's "Lush,"[1] which I continue to think is an amazing design). Once you get a little bit proficient at it, you finally realize what an…

I started with Lush a long time ago before being obliged to switch to MATLAB and then C.

Recently I have been trying to learn Futhark which is a ML like language generating parallel code (E.g. OpenCL or CUDA) from pure functional code with nested array structures. I find this exciting because when using the GPU with a thin layer like OpenCL directly, you have to write kernels from scratch without much abstraction possible. Higher level APIs like PyTorch or Jax give you easy ways to flexibly structure the computation but you just have to hope for kernel fusion. In Futhark this is in principle explicit and well handled.

ISPC is another example of a C like language where SIMD style parallelism is unambiguous while staying relatively high level.

Re: A look at the J language: the fine line between genius and insanity (2012)

#43

The TSDB is now called 'jd'[0] FWIIW. Funny, I've been using J on and off since then and I'm still not sure if it's genius or insane. It, along with the other APLs, is definitely its own thing, just as much as Lisp is (my previous favorite weird language was Yann LeCun and Leon Bottou's "Lush,"[1] which I continue to think is an amazing design). Once you get a little bit proficient at it, you finally realize what an…

I started with Lush a long time ago before being obliged to switch to MATLAB and then C. Recently I have been trying to learn Futhark which is a ML like language generating parallel code (E.g. OpenCL or CUDA) from pure functional code with nested array structures. I find this exciting because when using the GPU with a thin layer like OpenCL directly, you have to write kernels from scratch without much abstraction pos…

If your primary interest is in parallel code that runs on a GPU, and not autograd features of Pytorch/Jax, take a look at CuPy: https://cupy.dev/

Re: A look at the J language: the fine line between genius and insanity (2012)

#44

Earlier quoted context omitted.

Definitely no; I tried something similar with the J dictionary. The right way to learn is to go through "J for C programmers" (it comes with the language), or just grab NuVoc[0] and start writing code for something non trivial. Labs can also help for areas you're not familiar with. Its the composition in J which carries meaning; and stuff like hooks and forks (more or less, writing J AST's directly) make it non-obvio…

I couldn't find "J for C programmers" in my installation, but there seems to be more info here. https://code.jsoftware.com/wiki/Books#J_for_C_Programmers

Memory failing me; it used to be part of the IDE, with a copy of it and the dictionary stored on local storage, but I guess J has changed enough recently it needed to go up on the wiki where it can be changed. You can always find it from nuvoc.

Usr Pri JfC LJ Phr Dic Voc !:

All these are interesting; some primers, some the old version of the dictionary (I think it's depreciated for now). I end up !: a lot for the foreigns.

Re: A look at the J language: the fine line between genius and insanity (2012)

#46

J seems like a language I should learn using flash cards. Make a flash card for each character, for each operation, and just learn all the operators, and then I will know J. Any truth to this? I suppose it might be like telling someone, "you know conditionals and loops, now you know how to program!"

It would be a lot like that. There's a mindset shift to thinking of arrays as geometric objects to manipulate in space instead of as boundaries on valid indices. One of my favorite examples is computing a moving average over some vector of input data. Instead of thinking about looping over each sub-range to find its average, and having that nested inside a loop over possible sub-ranges, you can build a 2D array whose rows are time-shifted versions of the original 1D array. Sum that column-wise and divide by the number of rows to get your answer.

Understanding how you can build that iteration space as reified data gives you a lot more expressive power than you get from remembering that `|.` means "rotate." It's easy to look up which symbol corresponds to a chosen operation (and you'll memorize the ones you use a lot anyhow).

Re: A look at the J language: the fine line between genius and insanity (2012)

#47

The TSDB is now called 'jd'[0] FWIIW. Funny, I've been using J on and off since then and I'm still not sure if it's genius or insane. It, along with the other APLs, is definitely its own thing, just as much as Lisp is (my previous favorite weird language was Yann LeCun and Leon Bottou's "Lush,"[1] which I continue to think is an amazing design). Once you get a little bit proficient at it, you finally realize what an…

I started with Lush a long time ago before being obliged to switch to MATLAB and then C. Recently I have been trying to learn Futhark which is a ML like language generating parallel code (E.g. OpenCL or CUDA) from pure functional code with nested array structures. I find this exciting because when using the GPU with a thin layer like OpenCL directly, you have to write kernels from scratch without much abstraction pos…

Yeah, I've been looking for some higher level way of taking advantage of GPUs. Pascal Jasmin wrote a doodad for J talking to Arrayfire, but I never got it to work properly.

https://github.com/Pascal-J/Jfire

Lush: it just felt comfy for a data science workflow. No DB adapters, or even real csv readers, but you could do whatever you needed in the interpreted language and go pretty fast with the compiled bits. Still feels like the future.

Re: A look at the J language: the fine line between genius and insanity (2012)

#48
post #43

Earlier quoted context omitted.

I started with Lush a long time ago before being obliged to switch to MATLAB and then C. Recently I have been trying to learn Futhark which is a ML like language generating parallel code (E.g. OpenCL or CUDA) from pure functional code with nested array structures. I find this exciting because when using the GPU with a thin layer like OpenCL directly, you have to write kernels from scratch without much abstraction pos…

If your primary interest is in parallel code that runs on a GPU, and not autograd features of Pytorch/Jax, take a look at CuPy: https://cupy.dev/

Right, but does CuPy fuse kernels? I can’t find anything in the docs about it.

Re: A look at the J language: the fine line between genius and insanity (2012)

#49
post #43

Earlier quoted context omitted.

If your primary interest is in parallel code that runs on a GPU, and not autograd features of Pytorch/Jax, take a look at CuPy: https://cupy.dev/

Right, but does CuPy fuse kernels? I can’t find anything in the docs about it.

Not sure, but you can write your own cuda kernels inline if you want to.

Re: A look at the J language: the fine line between genius and insanity (2012)

#50
I stumbled across J years ago when I was messing with Supercollider[0]. I wish I had a use for J, it's very cool.

Slight tangent, Supercollier is one of the best langs I've ever played with. Smalltalk + J. Totally blew my mind when I first wrapped my brain around it!

[0] https://supercollider.github.io/

Post reply on HN