Live data from Hacker News

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

scottlocklin.wordpress.com

11–20 of 70 posts

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

#11
post #6

I would see J solutions to Project Euler problems a lot, and they would often be the most terse and cryptic solutions. Good introduction. Its always nice to see a "community review".

Shameless plug: I'm currently working through Project Euler problems using J, and the language is obscenely well-suited to this kind of problems. The terseness has grown on me, as for the other thing - well, I guess code in any language can look like line noise, it's all up to the programmer.

Please take a look at https://ciumei.ca/blog/2020-07-25/j.html and do let me know if the code is at all cryptic.

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

#12
post #3

Earlier quoted context omitted.

People always compare J, K and APL as if they were almost identical apart from the character set, but that's far from the truth. https://aplwiki.com/wiki/Array_model#:~:text=In%20APL%20it%2... .

APL and J are different between themselves (I started with APL but jumped into J) like FORTRAN and C are... What is your point?

But do they implement the same programming paradigm, or is there any fundamental differences

For example, C# and Java implement the same paradigm , they are different, many argue which provide a better set of feature, but I would not call the differences fundamental

C#, F#, implement completely different paradigms

F# and Clojure, same paradigm, but have fundamental differences, F# being static and come from the ML family , Clojure dynamic and come from the Lisp family

So APL to J, is more like what to what, C# to Java, or F# to Clojure ??

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

#13
post #9

I've learned a bunch of different languages[1], but J (and its friends APL and K) has been both the one that I don't feel I have the patience to learn AND the one that I feel like I might fall in love with if I actually learned it. The incomprehensible programs just seem to hint that there is some sort of maximal information density where every keystroke provides maximal productivity. There's also something artistica…

> Here's a video that really illustrates the power of this paradigm: https://www.youtube.com/watch?v=a9xAKttWgP4

Amazing game of life code!

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

#14
post #9

I've learned a bunch of different languages[1], but J (and its friends APL and K) has been both the one that I don't feel I have the patience to learn AND the one that I feel like I might fall in love with if I actually learned it. The incomprehensible programs just seem to hint that there is some sort of maximal information density where every keystroke provides maximal productivity. There's also something artistica…

I struggled a lot too. I think the main issue is the problem domain in which these languages excel at.

I like compilers, systems programming, distributed systems... but math? statistics? I'm admittedly terrible at that and find it really uninteresting. It doesn't help that most literature on J tries to teach its language concepts showing you how to solve math problems. I have no need for a fancy calculator.

For what it's worth, I like K and Klong and found them very approachable. Basically because you can get away by writing Scheme with m-expressions.

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

#15
Someone who was _very competent_ with J gave a demo of it at one of the Recurse Center (ne Hackruiter) _Brain Dump_ meetups back in the day and broke the crowd's collective brain. It might as well have been Brainfuck to all of us, but the proof was in the ... STDOUT. I believe they were demonstrating the standard factorial, map/reduce, etc. sorts of solutions you'd expect, but I remember being shocked by the small amount of code required to achieve the desired outcome. To the point the article appears to make, this may or may not be a good thing in terms of team productivity and maintainability, but it was damn impressive.

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

#16
post #9

I've learned a bunch of different languages[1], but J (and its friends APL and K) has been both the one that I don't feel I have the patience to learn AND the one that I feel like I might fall in love with if I actually learned it. The incomprehensible programs just seem to hint that there is some sort of maximal information density where every keystroke provides maximal productivity. There's also something artistica…

> Here's a video that really illustrates the power of this paradigm: https://www.youtube.com/watch?v=a9xAKttWgP4 Amazing game of life code!

The first time I watched the video my response was that he was literally doing magic or that it was some sort of joke. Over time the video has become more approachable and I have a pretty good idea of what is going on. However, if I was asked to approach game of life in APL myself then I think I would still be pretty lost.

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

#17
post #12

Earlier quoted context omitted.

APL and J are different between themselves (I started with APL but jumped into J) like FORTRAN and C are... What is your point?

But do they implement the same programming paradigm, or is there any fundamental differences For example, C# and Java implement the same paradigm , they are different, many argue which provide a better set of feature, but I would not call the differences fundamental C#, F#, implement completely different paradigms F# and Clojure, same paradigm, but have fundamental differences, F# being static and come from the ML fa…

It's more like C# to Java. Setting aside the different character sets used, a lot of code written in one can be translated almost directly to the other. Whereas F# and Clojure, while using many similar idioms, have fundamentally different approaches to types which significantly alters your program structure and design approach.

Both J and APL work on the same type of things (principally, arrays and nested arrays) with functions being applied over the arrays or across multiple arrays. And both languages encourage a point-free or tacit style of programming (though J, from my limited experience with both, seems to push this a bit further sometimes). For a functional paradigm example it's probably more like the difference between SML and Ocaml, or between two similar lisps like Common Lisp and Emacs Lisp. There are clear differences in focus in the two language designs, but much more in common (again, setting aside the choice of characters, you can find an equivalent for most APL symbols in J and vice versa without needing to create too many new definitions).

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

#18
post #12

Earlier quoted context omitted.

APL and J are different between themselves (I started with APL but jumped into J) like FORTRAN and C are... What is your point?

But do they implement the same programming paradigm, or is there any fundamental differences For example, C# and Java implement the same paradigm , they are different, many argue which provide a better set of feature, but I would not call the differences fundamental C#, F#, implement completely different paradigms F# and Clojure, same paradigm, but have fundamental differences, F# being static and come from the ML fa…

APL and J are similar but for a pretty fundamental difference: APL has nested array theory while J is flat array theory. In practice, this does not make them that different to the user, except APL's model is arguably more elegant since it's "turtles all the way down" (J array elements are not array themselves).

K on the other hand, is really different! K doesn't have true multidimensional arrays, but lists of vectors. So it's ideal for its use case: finance (1d/2d numeric tables).

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

#19
post #9

I've learned a bunch of different languages[1], but J (and its friends APL and K) has been both the one that I don't feel I have the patience to learn AND the one that I feel like I might fall in love with if I actually learned it. The incomprehensible programs just seem to hint that there is some sort of maximal information density where every keystroke provides maximal productivity. There's also something artistica…

I struggled a lot too. I think the main issue is the problem domain in which these languages excel at. I like compilers, systems programming, distributed systems... but math? statistics? I'm admittedly terrible at that and find it really uninteresting. It doesn't help that most literature on J tries to teach its language concepts showing you how to solve math problems. I have no need for a fancy calculator. For what…

My general belief is that these languages would be far more useful as embedded languages; occasionally there is a need for the core of some complicated system to take advantage of their power, but the same design that makes them good at math makes them horrible for writing APIs or database access.

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

#20
post #6

I would see J solutions to Project Euler problems a lot, and they would often be the most terse and cryptic solutions. Good introduction. Its always nice to see a "community review".

Shameless plug: I'm currently working through Project Euler problems using J, and the language is obscenely well-suited to this kind of problems. The terseness has grown on me, as for the other thing - well, I guess code in any language can look like line noise, it's all up to the programmer. Please take a look at https://ciumei.ca/blog/2020-07-25/j.html and do let me know if the code is at all cryptic.

I found them surprisingly readable as someone with no prior J /APL/OtherBlackMagic experience :)
Post reply on HN