News for hackers. Stuff that matters.
Re:J Has the Best Development Environment (2009) by chubot on Friday September 19, 2014 @05:05AM (#8339589)
I like vectorized languages -- I know R fairly well, and used to use Matlab.

J's syntax, where everything is a single character, kind of turns me off. Is that incidental or is the syntax essential to the language? (In the case of Lisp, the "weird" syntax isn't incidental but rather essential, since code is data)

If it's incidental, I'd like to see some elegant J programs "written out" with some more friendly syntax.

EDIT: If you want a laugh, download the source for J, and run wc -l .c .h.

http://www.jsoftware.com/source.htm

Re:J Has the Best Development Environment (2009) by klibertp on Friday September 19, 2014 @06:05AM (#8339725)
> where everything is a single character

Most things in J are actually two characters, take a look at the Vocabulary (http://www.jsoftware.com/help/dictionary/vocabul.htm)

> I'd like to see some elegant J programs "written out" with some more friendly syntax

The problem with J is that the syntax is highly context sensitive, not the length of identifiers. See here: http://www.jsoftware.com/jwiki/Guides/Language%20FAQ#Guides....

Also, you can use aliases for every word, which are defined in stdlib. You can write "each", "cut" etc. if you want. The reason nobody does that is a little complex.

J is suited for exploratory programming and rapid prototyping. This means that expressive power per character should be as high as possible - and J delivers on this promise. Also the standard J words you can see in the Vocabulary are all there is to J. Everything else is always defined in terms of those and you can't define words with symbolic names, like you can in Haskell, OCaml etc. - so once you know those, you can say you know the language. And as for reading J code, it's meant to be read with the help of the J system: you have at least three possible representation to choose from when viewing J code, and you have ability to evaluate each subexpression to see what it does.

Anyway, J is hard to learn, but after initial hump it's a pleasure to write, and then after a while it becomes possible to read it. In exchange for this difficulty level you get incredible expressive power and performance.

Re:J Has the Best Development Environment (2009) by minikomi on Friday September 19, 2014 @05:08AM (#8339597)
Check out Tracy Harms's talk:

http://www.infoq.com/presentations/j-language

Or, perhaps, this chapter of the (rather dense) "Learning J":

http://www.jsoftware.com/help/learning/03.htm

Re:J Has the Best Development Environment (2009) by huehue on Friday September 19, 2014 @06:01AM (#8339717)
I guess it's a matter of taste.

As someone versed in both APL and K/Kona, J's syntax puts me off as well.

Re:J Has the Best Development Environment (2009) by Avshalom on Friday September 19, 2014 @07:48AM (#8339992)
J suffers vs APL/K. The verb trains; number of verbs vs number of available symbols; variable lengths and semantic baggage we bring to various symbols contribute to a much worse 'line barf problem'. I understand why Iverson went with ascii but frankly I don't even know APL beyond 'advanced calculator' level but every time I look at an APL program it just seems cleaner.
Re:J Has the Best Development Environment (2009) by seanstickle on Friday September 19, 2014 @08:24AM (#8340124)
This is my difficulty with J as well.

APL has a better mental "feeling" for me, more like mathematical symbols. Oftentimes, these are pretty direct.

Want to drop the first element of a vector?

APL: 1 ↓ 1 2 3 4 5

J: 1 }. 1 2 3 4 5

The APL version looks like a drop to me. The J version looks like two characters that I have to remember the meaning of.

I'm sure if I was deeply proficient at J, the two-characters would stand out by their meaning, but it's hard for me to get that far when APL is so much cleaner for me to read.

Re:J Has the Best Development Environment (2009) by klibertp on Saturday September 20, 2014 @04:03AM (#8344007)
The APL version looks like addition (cons, prepending value to a list) to me. The point being that you have to learn the meaning of symbols anyway, no matter which character set they use. Going for easier input (from the keyboard) and sacrificing a bit of legibility for this is a perfectly fine design trade off to me.
Re:J Has the Best Development Environment (2009) by judk on Friday September 19, 2014 @01:34PM (#8341494)
Of course APL is cleaner. But it requires a special keyboard. J tried to work around that, and flopped.

The language need the aliases to be learnable.

Re:J Has the Best Development Environment (2009) by eggy on Sunday September 21, 2014 @12:08AM (#8346243)
There are aliases built-in and you can define your own. Drop is built-in. To borrow an example above:

  1 drop 1 2 3 4 5      NB. this is how to comment
  2 3 4 5               NB. drop is }. in J
Exactly how did it 'flop'? Popularity, or your understanding of it?

Math symbols are cryptic, and Math is not popular, but I would not want to write:

"The derivative of x with respect to t" everytime instead of, dx/dt everytime I needed to write a formula.

I am sure beginners find 'for' ambiguous unless they have experience with programming as in 'for i = 1 to 10'. It's syntax you are highlighting, not meaning. People extoll the brevity of Haskell, and other functional languages, because they take the time to understand its syntax. J has been around a lot longer, and was created by some very smart people. I didn't choose it for its job market or popularity, but to expand my mind, and further my mathematics studies.