Category:J: Difference between revisions

m
→‎The J language: link to some well thought out reflection on implications
m (→‎The J language: link to some well thought out reflection on implications)
 
(One intermediate revision by one other user not shown)
Line 19:
== The J language ==
 
A frequent reaction when one first encounters a J program is often something along the lines of "that's cheating". The thought here is that the problem could not possibly be that simple, so -- instead -- the issue must be that J was specifically designed to tackle that problem.
 
The flip side of this issue is that J is a dialect of APL -- a language whose development started in the 1950s and which was implemented in the early 1960s. And, originally, APL was designed as a language to describe computer architecture. The implementation as a programming language was motivated by its original successes in documenting computer hardware and instructions, and the relative simplicity of its concepts.
 
See also https://github.com/cratelyn/j for some reflection on some of the linguistic character of J.
 
== Introduction ==
Line 33 ⟶ 35:
Object-module and imperative techniques are supported, but not required.
 
The J programming language was designed and developed by [http[wp://en.wikipedia.org/wiki/Kenneth_E._Iverson Ken Iverson]] and Roger Hui. It is a closely related successor to [[APL]], also by Iverson which itself was a successor to the notation Ken Iverson used to teach his classes about computers in the 1950s.
<br clear="all"/>
 
Line 49 ⟶ 51:
For example, the phrase <code>(+/ % #)</code> finds the average of a list of numbers.
 
<syntaxhighlight lang="j">
<lang J> (+/ % #) 1 2 3
2</lang>
2
</syntaxhighlight>
 
To understand how this works, you might try working with simpler sentences and their variations.
 
<syntaxhighlight lang="j">
<lang J> +/ 1 2 3
6
+/4 5 6
Line 67 ⟶ 72:
5
(+/ % #) 4 5 6
5
5</lang>
</syntaxhighlight>
 
By themselves, these experiments mean nothing, but if you know that +/ was finding the sum of a list and # was finding the length of a list and that % was dividing the two quantities (and looks almost like one of the old school division symbols) then these experiments might help confirm that you have understood things properly.
 
== Some Perspectiveperspective ==
 
If you wish to use J you will also have to learn a few grammatical rules (J's parser has [http://www.jsoftware.com/help/dictionary/dicte.htm 9 reduction rules] and "shift" and "accept" - the above examples use four of those rules). J verbs have two definitions - a single argument "monadic" definition and a two argument "dyadic" definition.
Line 97 ⟶ 103:
 
Discussion of the goals of the J community on RC and general guidelines for presenting J solutions takes place at [[J/HouseStyle|House Style]].
 
 
== Jedi on RosettaCode ==
6,951

edits